001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.internal;
011:
012: import org.eclipse.core.runtime.Assert;
013: import org.eclipse.jface.action.IAction;
014: import org.eclipse.jface.action.ICoolBarManager;
015: import org.eclipse.jface.action.IMenuManager;
016: import org.eclipse.jface.action.IStatusLineManager;
017: import org.eclipse.jface.action.IToolBarManager;
018: import org.eclipse.ui.IActionBars2;
019: import org.eclipse.ui.services.IServiceLocator;
020:
021: public class WWinActionBars implements IActionBars2 {
022: private WorkbenchWindow window;
023:
024: /**
025: * PerspActionBars constructor comment.
026: */
027: public WWinActionBars(WorkbenchWindow window) {
028: super ();
029: this .window = window;
030: }
031:
032: /**
033: * Clears the global action handler list.
034: */
035: public void clearGlobalActionHandlers() {
036: }
037:
038: /**
039: * Returns the cool bar manager.
040: *
041: */
042: public ICoolBarManager getCoolBarManager() {
043: return window.getCoolBarManager2();
044: }
045:
046: /**
047: * Get the handler for a window action.
048: *
049: * @param actionID an action ID declared in the registry
050: * @return an action handler which implements the action ID, or
051: * <code>null</code> if none is registered.
052: */
053: public IAction getGlobalActionHandler(String actionID) {
054: return null;
055: }
056:
057: /**
058: * Returns the menu manager. If items are added or
059: * removed from the manager be sure to call <code>updateActionBars</code>.
060: *
061: * @return the menu manager
062: */
063: public IMenuManager getMenuManager() {
064: return window.getMenuManager();
065: }
066:
067: public final IServiceLocator getServiceLocator() {
068: return window;
069: }
070:
071: /**
072: * Returns the status line manager. If items are added or
073: * removed from the manager be sure to call <code>updateActionBars</code>.
074: *
075: * @return the status line manager
076: */
077: public IStatusLineManager getStatusLineManager() {
078: return window.getStatusLineManager();
079: }
080:
081: /**
082: * Returns the tool bar manager.
083: *
084: */
085: public IToolBarManager getToolBarManager() {
086: // This should never be called
087: Assert.isTrue(false);
088: return null;
089: }
090:
091: /**
092: * Add a handler for a window action.
093: *
094: * The standard action ID's for the workbench are defined in
095: * <code>IWorkbenchActions</code>.
096: *
097: * @see IWorkbenchActions
098: *
099: * @param actionID an action ID declared in the registry
100: * @param handler an action which implements the action ID.
101: * <code>null</code> may be passed to deregister a handler.
102: */
103: public void setGlobalActionHandler(String actionID, IAction handler) {
104: }
105:
106: /**
107: * Commits all UI changes. This should be called
108: * after additions or subtractions have been made to a
109: * menu, status line, or toolbar.
110: */
111: public void updateActionBars() {
112: window.updateActionBars();
113: }
114: }
|