KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ca > mcgill > sable > graph > actions > GraphActionBarContributor


1 /* Soot - a J*va Optimization Framework
2  * Copyright (C) 2005 Jennifer Lhotak
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */

19
20
21 package ca.mcgill.sable.graph.actions;
22
23 import org.eclipse.gef.ui.actions.ActionBarContributor;
24 import org.eclipse.jface.action.*;
25 import org.eclipse.gef.ui.actions.*;
26 import org.eclipse.ui.IWorkbenchActionConstants;
27 import org.eclipse.ui.*;
28
29 public class GraphActionBarContributor extends ActionBarContributor {
30
31     /**
32      *
33      */

34     public GraphActionBarContributor() {
35         super();
36     }
37     
38     
39     /* (non-Javadoc)
40      * @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
41      */

42     protected void buildActions() {
43         addRetargetAction(new ZoomInRetargetAction());
44         addRetargetAction(new ZoomOutRetargetAction());
45     }
46
47     /* (non-Javadoc)
48      * @see org.eclipse.gef.ui.actions.ActionBarContributor#declareGlobalActionKeys()
49      */

50     protected void declareGlobalActionKeys() {
51         addGlobalActionKey(IWorkbenchActionConstants.PRINT);
52     }
53     
54     // this is for zoom toolbar buttons
55
public void contributeToToolBar(IToolBarManager toolBarManager){
56         super.contributeToToolBar(toolBarManager);
57         toolBarManager.add(new Separator());
58     }
59     
60     public void contributeToMenu(IMenuManager menuManager){
61         super.contributeToMenu(menuManager);
62         
63         MenuManager viewMenu = new MenuManager("View");
64         viewMenu.add(getAction(GEFActionConstants.ZOOM_IN));
65         viewMenu.add(getAction(GEFActionConstants.ZOOM_OUT));
66         
67         menuManager.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu);
68     }
69     
70     public void setActiveEditor(IEditorPart editor) {
71         super.setActiveEditor(editor);
72         
73     }
74     
75 }
76
Popular Tags