KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > WWinActionBars


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal;
12
13 import org.eclipse.core.runtime.Assert;
14 import org.eclipse.jface.action.IAction;
15 import org.eclipse.jface.action.ICoolBarManager;
16 import org.eclipse.jface.action.IMenuManager;
17 import org.eclipse.jface.action.IStatusLineManager;
18 import org.eclipse.jface.action.IToolBarManager;
19 import org.eclipse.ui.IActionBars2;
20 import org.eclipse.ui.services.IServiceLocator;
21
22 public class WWinActionBars implements IActionBars2 {
23     private WorkbenchWindow window;
24
25     /**
26      * PerspActionBars constructor comment.
27      */

28     public WWinActionBars(WorkbenchWindow window) {
29         super();
30         this.window = window;
31     }
32
33     /**
34      * Clears the global action handler list.
35      */

36     public void clearGlobalActionHandlers() {
37     }
38
39     /**
40      * Returns the cool bar manager.
41      *
42      */

43     public ICoolBarManager getCoolBarManager() {
44         return window.getCoolBarManager2();
45     }
46
47     /**
48      * Get the handler for a window action.
49      *
50      * @param actionID an action ID declared in the registry
51      * @return an action handler which implements the action ID, or
52      * <code>null</code> if none is registered.
53      */

54     public IAction getGlobalActionHandler(String JavaDoc actionID) {
55         return null;
56     }
57
58     /**
59      * Returns the menu manager. If items are added or
60      * removed from the manager be sure to call <code>updateActionBars</code>.
61      *
62      * @return the menu manager
63      */

64     public IMenuManager getMenuManager() {
65         return window.getMenuManager();
66     }
67
68     public final IServiceLocator getServiceLocator() {
69         return window;
70     }
71
72     /**
73      * Returns the status line manager. If items are added or
74      * removed from the manager be sure to call <code>updateActionBars</code>.
75      *
76      * @return the status line manager
77      */

78     public IStatusLineManager getStatusLineManager() {
79         return window.getStatusLineManager();
80     }
81
82     /**
83      * Returns the tool bar manager.
84      *
85      */

86     public IToolBarManager getToolBarManager() {
87         // This should never be called
88
Assert.isTrue(false);
89         return null;
90     }
91
92     /**
93      * Add a handler for a window action.
94      *
95      * The standard action ID's for the workbench are defined in
96      * <code>IWorkbenchActions</code>.
97      *
98      * @see IWorkbenchActions
99      *
100      * @param actionID an action ID declared in the registry
101      * @param handler an action which implements the action ID.
102      * <code>null</code> may be passed to deregister a handler.
103      */

104     public void setGlobalActionHandler(String JavaDoc actionID, IAction handler) {
105     }
106
107     /**
108      * Commits all UI changes. This should be called
109      * after additions or subtractions have been made to a
110      * menu, status line, or toolbar.
111      */

112     public void updateActionBars() {
113         window.updateActionBars();
114     }
115 }
116
Popular Tags