diff options
Diffstat (limited to 'org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/part/ComrelDiagramActionBarContributor.java')
-rw-r--r-- | org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/part/ComrelDiagramActionBarContributor.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/part/ComrelDiagramActionBarContributor.java b/org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/part/ComrelDiagramActionBarContributor.java new file mode 100644 index 0000000..ff1fe40 --- /dev/null +++ b/org.eclipse.emf.refactor.comrel.diagram/src/comrel/diagram/part/ComrelDiagramActionBarContributor.java @@ -0,0 +1,57 @@ +/*
+ *
+ */
+package comrel.diagram.part;
+
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor;
+import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.EnhancedPrintActionHelper;
+import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.RenderedPrintPreviewAction;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPage;
+
+/**
+ * @generated
+ */
+public class ComrelDiagramActionBarContributor extends
+ DiagramActionBarContributor {
+
+ /**
+ * @generated
+ */
+ protected Class getEditorClass() {
+ return ComrelDiagramEditor.class;
+ }
+
+ /**
+ * @generated
+ */
+ protected String getEditorId() {
+ return ComrelDiagramEditor.ID;
+ }
+
+ /**
+ * @generated
+ */
+ public void init(IActionBars bars, IWorkbenchPage page) {
+ super.init(bars, page);
+ // print preview
+ IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath(
+ IWorkbenchActionConstants.M_FILE);
+ assert fileMenu != null;
+ IAction printPreviewAction = new RenderedPrintPreviewAction(
+ new EnhancedPrintActionHelper());
+ fileMenu.insertBefore("print", printPreviewAction); //$NON-NLS-1$
+ IMenuManager editMenu = bars.getMenuManager().findMenuUsingPath(
+ IWorkbenchActionConstants.M_EDIT);
+ assert editMenu != null;
+ if (editMenu.find("validationGroup") == null) { //$NON-NLS-1$
+ editMenu.add(new GroupMarker("validationGroup")); //$NON-NLS-1$
+ }
+ IAction validateAction = new ValidateAction(page);
+ editMenu.appendToGroup("validationGroup", validateAction); //$NON-NLS-1$
+ }
+}
|