KickJava   Java API By Example, From Geeks To Geeks.

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


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