Search in sources :

Example 1 with BusinessDiagramActionProvider

use of org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider in project tdi-studio-se by Talend.

the class BusinessDiagramEditor method configureGraphicalViewer.

/**
     * @generated
     */
@Override
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    IDiagramGraphicalViewer viewer = getDiagramGraphicalViewer();
    // customize popup menu
    ContextMenuProvider provider = new BusinessDiagramActionProvider(this, viewer);
    viewer.setContextMenu(provider);
    getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, viewer);
    DiagramRootEditPart root = (DiagramRootEditPart) getDiagramGraphicalViewer().getRootEditPart();
    LayeredPane printableLayers = (LayeredPane) root.getLayer(LayerConstants.PRINTABLE_LAYERS);
    FreeformLayer extLabelsLayer = new FreeformLayer();
    extLabelsLayer.setLayoutManager(new DelegatingLayout());
    printableLayers.addLayerAfter(extLabelsLayer, BusinessEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER);
    LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS);
    FreeformLayer scaledFeedbackLayer = new FreeformLayer();
    scaledFeedbackLayer.setEnabled(false);
    scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER);
}
Also used : IDiagramGraphicalViewer(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer) DelegatingLayout(org.eclipse.draw2d.DelegatingLayout) LayeredPane(org.eclipse.draw2d.LayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer) BusinessDiagramActionProvider(org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) DiagramRootEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart)

Aggregations

DelegatingLayout (org.eclipse.draw2d.DelegatingLayout)1 FreeformLayer (org.eclipse.draw2d.FreeformLayer)1 LayeredPane (org.eclipse.draw2d.LayeredPane)1 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)1 DiagramRootEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart)1 IDiagramGraphicalViewer (org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer)1 BusinessDiagramActionProvider (org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider)1