KickJava   Java API By Example, From Geeks To Geeks.

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


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.jface.action.IMenuManager;
14 import org.eclipse.jface.action.IToolBarManager;
15 import org.eclipse.ui.IActionBars;
16 import org.eclipse.ui.SubActionBars;
17 import org.eclipse.ui.services.IServiceLocator;
18
19 /**
20  * An editor container manages the services for an editor.
21  */

22 public class ViewActionBars extends SubActionBars {
23     private ViewPane pane;
24
25     /**
26      * ViewActionBars constructor comment.
27      */

28     public ViewActionBars(IActionBars parent,
29             final IServiceLocator serviceLocator, ViewPane pane) {
30         super(parent, serviceLocator);
31         this.pane = pane;
32     }
33
34     /**
35      * Returns the menu manager. If items are added or removed from the manager
36      * be sure to call <code>updateActionBars</code>.
37      *
38      * @return the menu manager
39      */

40     public IMenuManager getMenuManager() {
41         return pane.getMenuManager();
42     }
43
44     /**
45      * Returns the tool bar manager. If items are added or removed from the
46      * manager be sure to call <code>updateActionBars</code>.
47      *
48      * @return the tool bar manager
49      */

50     public IToolBarManager getToolBarManager() {
51         return pane.getToolBarManager();
52     }
53
54     /**
55      * Commits all UI changes. This should be called after additions or
56      * subtractions have been made to a menu, status line, or toolbar.
57      */

58     public void updateActionBars() {
59         pane.updateActionBars();
60         getStatusLineManager().update(false);
61         fireActionHandlersChanged();
62     }
63 }
64
Popular Tags