| 1 | /* |
| 2 | *Copyright 2007, SDQ, IPD, Uni Karlsruhe (TH) |
| 3 | */ |
| 4 | package de.uka.ipd.sdq.pcm.gmf.composite.part; |
| 5 | |
| 6 | import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramActionBarContributor; |
| 7 | import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.EnhancedPrintActionHelper; |
| 8 | import org.eclipse.gmf.runtime.diagram.ui.printing.render.actions.RenderedPrintPreviewAction; |
| 9 | import org.eclipse.jface.action.IAction; |
| 10 | import org.eclipse.jface.action.IMenuManager; |
| 11 | import org.eclipse.ui.IActionBars; |
| 12 | import org.eclipse.ui.IWorkbenchActionConstants; |
| 13 | import org.eclipse.ui.IWorkbenchPage; |
| 14 | |
| 15 | /** |
| 16 | * @generated |
| 17 | */ |
| 18 | public class PalladioComponentModelDiagramActionBarContributor extends |
| 19 | DiagramActionBarContributor { |
| 20 | |
| 21 | /** |
| 22 | * @generated |
| 23 | */ |
| 24 | protected Class getEditorClass() { |
| 25 | return PalladioComponentModelDiagramEditor.class; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @generated |
| 30 | */ |
| 31 | protected String getEditorId() { |
| 32 | return PalladioComponentModelDiagramEditor.ID; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @generated |
| 37 | */ |
| 38 | public void init(IActionBars bars, IWorkbenchPage page) { |
| 39 | super.init(bars, page); |
| 40 | // print preview |
| 41 | IMenuManager fileMenu = bars.getMenuManager().findMenuUsingPath( |
| 42 | IWorkbenchActionConstants.M_FILE); |
| 43 | assert fileMenu != null; |
| 44 | IAction printPreviewAction = new RenderedPrintPreviewAction( |
| 45 | new EnhancedPrintActionHelper()); |
| 46 | fileMenu.insertBefore("print", printPreviewAction); //$NON-NLS-1$ |
| 47 | } |
| 48 | } |