1 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 34 public GraphActionBarContributor() { 35 super(); 36 } 37 38 39 42 protected void buildActions() { 43 addRetargetAction(new ZoomInRetargetAction()); 44 addRetargetAction(new ZoomOutRetargetAction()); 45 } 46 47 50 protected void declareGlobalActionKeys() { 51 addGlobalActionKey(IWorkbenchActionConstants.PRINT); 52 } 53 54 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 |