KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > part > services > PartToEditorActionBarsAdapter


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

11 package org.eclipse.ui.internal.part.services;
12
13 import org.eclipse.jface.action.IAction;
14 import org.eclipse.jface.action.ICoolBarManager;
15 import org.eclipse.jface.action.IMenuManager;
16 import org.eclipse.jface.action.IStatusLineManager;
17 import org.eclipse.jface.action.IToolBarManager;
18 import org.eclipse.ui.IActionBars2;
19 import org.eclipse.ui.internal.components.Assert;
20 import org.eclipse.ui.internal.part.components.services.IPartActionBars;
21 import org.eclipse.ui.internal.part.components.services.IStatusFactory;
22 import org.eclipse.ui.internal.part.components.services.IStatusHandler;
23
24 public class PartToEditorActionBarsAdapter implements IActionBars2 {
25
26     private IPartActionBars parent;
27     private IStatusLineManager statusLine;
28     
29     public PartToEditorActionBarsAdapter(IPartActionBars toAdapt, IStatusHandler statusHandler, IStatusFactory statusFactory) {
30         Assert.isNotNull(toAdapt);
31         Assert.isNotNull(statusHandler);
32         Assert.isNotNull(statusFactory);
33         parent = toAdapt;
34         this.statusLine = new StatusLineManagerAdapter(statusHandler, statusFactory);
35     }
36     
37     public ICoolBarManager getCoolBarManager() {
38         return parent.getCoolBarManager();
39     }
40     
41     public void clearGlobalActionHandlers() {
42         parent.clearGlobalActionHandlers();
43     }
44
45     public IAction getGlobalActionHandler(String JavaDoc actionId) {
46         return parent.getGlobalActionHandler(actionId);
47     }
48
49     public IMenuManager getMenuManager() {
50         return parent.getMenuBarManager();
51     }
52
53     public IStatusLineManager getStatusLineManager() {
54         return statusLine;
55     }
56
57     public IToolBarManager getToolBarManager() {
58         return parent.getToolBarManager();
59     }
60
61     public void setGlobalActionHandler(String JavaDoc actionId, IAction handler) {
62         parent.setGlobalActionHandler(actionId, handler);
63     }
64
65     public void updateActionBars() {
66         parent.updateActionBars();
67     }
68
69 }
70
Popular Tags