Search in sources :

Example 6 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project cubrid-manager by CUBRID.

the class ERSchemaEditor method getCommonKeyHandler.

protected KeyHandler getCommonKeyHandler() {
    KeyHandler sharedKeyHandler = new KeyHandler();
    Action action = new ZoomInAction(zoomManager);
    getActionRegistry().registerAction(action);
    action = new ZoomOutAction(zoomManager);
    getActionRegistry().registerAction(action);
    sharedKeyHandler.put(KeyStroke.getPressed('+', SWT.KEYPAD_ADD, 0), getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
    sharedKeyHandler.put(KeyStroke.getPressed('-', SWT.KEYPAD_SUBTRACT, 0), getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
    sharedKeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(DeleteAction.ID));
    sharedKeyHandler.put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));
    sharedKeyHandler.put(KeyStroke.getReleased('', 97, SWT.CTRL), getActionRegistry().getAction(ActionFactory.SELECT_ALL.getId()));
    getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
    graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, new Boolean(true));
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, true);
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(10, 10));
    return sharedKeyHandler;
}
Also used : SelectionAction(org.eclipse.gef.ui.actions.SelectionAction) RedoAction(org.eclipse.gef.ui.actions.RedoAction) ImportERwinDataAction(com.cubrid.common.ui.er.action.ImportERwinDataAction) ModifyTableNameAction(com.cubrid.common.ui.er.action.ModifyTableNameAction) UndoAction(org.eclipse.gef.ui.actions.UndoAction) EditTableAction(com.cubrid.common.ui.er.action.EditTableAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) DeleteAction(com.cubrid.common.ui.er.action.DeleteAction) IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) AddColumnAction(com.cubrid.common.ui.er.action.AddColumnAction) UpdateAction(org.eclipse.gef.ui.actions.UpdateAction) StackAction(org.eclipse.gef.ui.actions.StackAction) WorkbenchPartAction(org.eclipse.gef.ui.actions.WorkbenchPartAction) Action(org.eclipse.jface.action.Action) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) Dimension(org.eclipse.draw2d.geometry.Dimension) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler) KeyHandler(org.eclipse.gef.KeyHandler) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction)

Example 7 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project cubrid-manager by CUBRID.

the class ReplicationEditor method configureGraphicalViewer.

/**
	 * @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
	 */
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    GraphicalViewer viewer = getGraphicalViewer();
    ScalableRootEditPart rootEditPart = new ScalableRootEditPart();
    viewer.setRootEditPart(rootEditPart);
    viewer.setEditPartFactory(new PartFactory(this));
    ZoomManager manager = rootEditPart.getZoomManager();
    getActionRegistry().registerAction(new ZoomInAction(manager));
    getActionRegistry().registerAction(new ZoomOutAction(manager));
    double[] zoomLevels = new double[] { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 2.5, 3.0, 4.0, 5.0, 10.0, 20.0 };
    manager.setZoomLevels(zoomLevels);
    List<String> zoomContributions = new ArrayList<String>();
    zoomContributions.add(ZoomManager.FIT_ALL);
    zoomContributions.add(ZoomManager.FIT_HEIGHT);
    zoomContributions.add(ZoomManager.FIT_WIDTH);
    manager.setZoomLevelContributions(zoomContributions);
    KeyHandler keyHandler = new KeyHandler();
    if (isEditable) {
        keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));
    }
    keyHandler.put(KeyStroke.getPressed('+', SWT.KEYPAD_ADD, 0), getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
    keyHandler.put(KeyStroke.getPressed('-', SWT.KEYPAD_SUBTRACT, 0), getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
    keyHandler.put(KeyStroke.getPressed('a', 97, 0), getActionRegistry().getAction(ActionFactory.SELECT_ALL.getId()));
    viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.NONE), MouseWheelZoomHandler.SINGLETON);
    viewer.setKeyHandler(keyHandler);
    ContextMenuProvider provider = new ReplEditorContextMenuProvider(viewer, getActionRegistry());
    viewer.setContextMenu(provider);
}
Also used : GraphicalViewer(org.eclipse.gef.GraphicalViewer) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) PartFactory(com.cubrid.cubridmanager.ui.replication.editor.parts.PartFactory) ScalableRootEditPart(org.eclipse.gef.editparts.ScalableRootEditPart) ArrayList(java.util.ArrayList) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) ZoomManager(org.eclipse.gef.editparts.ZoomManager) KeyHandler(org.eclipse.gef.KeyHandler) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction)

Example 8 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project webtools.sourceediting by eclipse.

the class CommonMultiPageEditor method configureGraphicalViewer.

protected void configureGraphicalViewer() {
    graphicalViewer.getControl().setBackground(ColorConstants.listBackground);
    // Set the root edit part
    // ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
    RootEditPart root = new RootEditPart();
    ZoomManager zoomManager = root.getZoomManager();
    List zoomLevelContributions = new ArrayList(3);
    zoomLevelContributions.add(ZoomManager.FIT_ALL);
    zoomLevelContributions.add(ZoomManager.FIT_WIDTH);
    zoomLevelContributions.add(ZoomManager.FIT_HEIGHT);
    zoomManager.setZoomLevelContributions(zoomLevelContributions);
    double[] zoomLevels = { .10, .25, .5, .75, 1.0, 1.25, 1.5, 2.0, 2.5, 3, 4, 5 };
    zoomManager.setZoomLevels(zoomLevels);
    IAction zoomIn = new ZoomInAction(zoomManager);
    IAction zoomOut = new ZoomOutAction(zoomManager);
    getActionRegistry().registerAction(zoomIn);
    getActionRegistry().registerAction(zoomOut);
    getSite().getKeyBindingService().registerAction(zoomIn);
    getSite().getKeyBindingService().registerAction(zoomOut);
    // ConnectionLayer connectionLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
    // connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
    // connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(connectionLayer));
    // connectionLayer.setVisible(false);
    // Zoom
    zoomManager.setZoom(1.0);
    // Scroll-wheel Zoom
    graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
    graphicalViewer.setRootEditPart(root);
    graphicalViewer.setEditPartFactory(getEditPartFactory());
}
Also used : IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ZoomManager(org.eclipse.gef.editparts.ZoomManager) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) RootEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart)

Example 9 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project yamcs-studio by yamcs.

the class OPIEditor method configureGraphicalViewer.

@Override
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    var viewer = (ScrollingGraphicalViewer) getGraphicalViewer();
    viewer.setEditPartFactory(new WidgetEditPartFactory(ExecutionMode.EDIT_MODE));
    ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart() {

        @Override
        public Object getAdapter(@SuppressWarnings("rawtypes") final Class key) {
            if (key == AutoexposeHelper.class) {
                return new ViewportAutoexposeHelper(this);
            }
            return super.getAdapter(key);
        }
    };
    // set clipping strategy for connection layer of connection can be hide
    // when its source or target is not showing.
    var connectionLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
    connectionLayer.setClippingStrategy(new PatchedConnectionLayerClippingStrategy(connectionLayer));
    viewer.setRootEditPart(root);
    viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer).setParent(getCommonKeyHandler()));
    ContextMenuProvider cmProvider = new OPIEditorContextMenuProvider(viewer, getActionRegistry());
    viewer.setContextMenu(cmProvider);
    getSite().registerContextMenu(cmProvider, viewer);
    // Grid Action
    IAction action = new ToggleGridAction(getGraphicalViewer()) {

        @Override
        public boolean isChecked() {
            return getDisplayModel().isShowGrid();
        }

        @Override
        public void run() {
            getCommandStack().execute(new SetWidgetPropertyCommand(displayModel, DisplayModel.PROP_SHOW_GRID, !isChecked()));
        }
    };
    getActionRegistry().registerAction(action);
    // Ruler Action
    configureRuler();
    action = new ToggleRulerVisibilityAction(getGraphicalViewer()) {

        @Override
        public boolean isChecked() {
            return getDisplayModel().isShowRuler();
        }

        @Override
        public void run() {
            getCommandStack().execute(new SetWidgetPropertyCommand(displayModel, DisplayModel.PROP_SHOW_RULER, !isChecked()));
        }
    };
    getActionRegistry().registerAction(action);
    // Snap to Geometry Action
    IAction geometryAction = new ToggleSnapToGeometryAction(getGraphicalViewer()) {

        @Override
        public boolean isChecked() {
            return getDisplayModel().isSnapToGeometry();
        }

        @Override
        public void run() {
            getCommandStack().execute(new SetWidgetPropertyCommand(displayModel, DisplayModel.PROP_SNAP_GEOMETRY, !isChecked()));
        }
    };
    getActionRegistry().registerAction(geometryAction);
    // configure zoom actions
    var zm = root.getZoomManager();
    if (zm != null) {
        List<String> zoomLevels = new ArrayList<>(3);
        zoomLevels.add(ZoomManager.FIT_ALL);
        zoomLevels.add(ZoomManager.FIT_WIDTH);
        zoomLevels.add(ZoomManager.FIT_HEIGHT);
        zm.setZoomLevelContributions(zoomLevels);
        zm.setZoomLevels(createZoomLevels());
        IAction zoomIn = new ZoomInAction(zm);
        IAction zoomOut = new ZoomOutAction(zm);
        getActionRegistry().registerAction(zoomIn);
        getActionRegistry().registerAction(zoomOut);
    }
    /* scroll-wheel zoom */
    getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    // status line listener
    getGraphicalViewer().addSelectionChangedListener(new ISelectionChangedListener() {

        private IStatusLineManager statusLine = ((ActionBarContributor) getEditorSite().getActionBarContributor()).getActionBars().getStatusLineManager();

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            updateStatusLine(statusLine);
        }
    });
}
Also used : ToggleSnapToGeometryAction(org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction) WidgetEditPartFactory(org.csstudio.opibuilder.editparts.WidgetEditPartFactory) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ArrayList(java.util.ArrayList) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) ViewportAutoexposeHelper(org.eclipse.gef.editparts.ViewportAutoexposeHelper) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) IAction(org.eclipse.jface.action.IAction) RunOPIAction(org.csstudio.opibuilder.actions.RunOPIAction) IStatusLineManager(org.eclipse.jface.action.IStatusLineManager) ToggleGridAction(org.eclipse.gef.ui.actions.ToggleGridAction) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) ToggleRulerVisibilityAction(org.eclipse.gef.ui.actions.ToggleRulerVisibilityAction) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) SetWidgetPropertyCommand(org.csstudio.opibuilder.commands.SetWidgetPropertyCommand) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler) PatchedConnectionLayerClippingStrategy(org.csstudio.opibuilder.runmode.PatchedConnectionLayerClippingStrategy)

Example 10 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project archi by archimatetool.

the class AbstractDiagramEditor method createActions.

/**
 * Add some extra Actions - *after* the graphical viewer has been created
 */
@SuppressWarnings("unchecked")
protected void createActions(GraphicalViewer viewer) {
    ActionRegistry registry = getActionRegistry();
    IAction action;
    // Zoom Manager tweaking
    ZoomManager zoomManager = (ZoomManager) getAdapter(ZoomManager.class);
    double[] zoomLevels = { .25, .5, .75, 1, 1.5, 2, 3, 4, 6, 8 };
    zoomManager.setZoomLevels(zoomLevels);
    List<String> zoomContributionLevels = new ArrayList<String>();
    zoomContributionLevels.add(ZoomManager.FIT_ALL);
    zoomContributionLevels.add(ZoomManager.FIT_WIDTH);
    zoomContributionLevels.add(ZoomManager.FIT_HEIGHT);
    zoomManager.setZoomLevelContributions(zoomContributionLevels);
    // Zoom Actions
    IAction zoomIn = new ZoomInAction(zoomManager);
    IAction zoomOut = new ZoomOutAction(zoomManager);
    IAction zoomNormal = new ZoomNormalAction(zoomManager);
    registry.registerAction(zoomIn);
    registry.registerAction(zoomOut);
    registry.registerAction(zoomNormal);
    // Add these zoom actions to the key binding service
    IHandlerService service = getEditorSite().getService(IHandlerService.class);
    service.activateHandler(zoomIn.getActionDefinitionId(), new ActionHandler(zoomIn));
    service.activateHandler(zoomOut.getActionDefinitionId(), new ActionHandler(zoomOut));
    service.activateHandler(zoomNormal.getActionDefinitionId(), new ActionHandler(zoomNormal));
    // Add our own Select All Action so we can select connections as well
    action = new SelectAllAction(this);
    registry.registerAction(action);
    // Add our own Print Action
    action = new PrintDiagramAction(this);
    registry.registerAction(action);
    // Direct Edit Rename
    action = new DirectEditAction(this);
    // Set this for Global Handler
    action.setId(ActionFactory.RENAME.getId());
    // Externalise this one
    action.setText(Messages.AbstractDiagramEditor_4);
    action.setToolTipText(Messages.AbstractDiagramEditor_13);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Change the Delete Action label
    action = registry.getAction(ActionFactory.DELETE.getId());
    action.setText(Messages.AbstractDiagramEditor_2);
    action.setToolTipText(action.getText());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Paste
    PasteAction pasteAction = new PasteAction(this, viewer);
    registry.registerAction(pasteAction);
    getSelectionActions().add(pasteAction.getId());
    // Paste Special
    PasteSpecialAction pasteSpecialAction = new PasteSpecialAction(this, viewer);
    registry.registerAction(pasteSpecialAction);
    getSelectionActions().add(pasteSpecialAction.getId());
    // Cut
    action = new CutAction(this, pasteAction);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Copy
    action = new CopyAction(this, pasteAction);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Use Grid Action
    action = new ToggleGridEnabledAction();
    registry.registerAction(action);
    // Show Grid Action
    action = new ToggleGridVisibleAction();
    registry.registerAction(action);
    // Snap to Alignment Guides
    action = new ToggleSnapToAlignmentGuidesAction();
    registry.registerAction(action);
    // Ruler
    // IAction showRulers = new ToggleRulerVisibilityAction(getGraphicalViewer());
    // registry.registerAction(showRulers);
    action = new MatchWidthAction(this);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_5);
    action.setToolTipText(Messages.AbstractDiagramEditor_14);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new MatchHeightAction(this);
    registry.registerAction(action);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_6);
    action.setToolTipText(Messages.AbstractDiagramEditor_15);
    getSelectionActions().add(action.getId());
    action = new MatchSizeAction(this);
    registry.registerAction(action);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_22);
    action.setToolTipText(Messages.AbstractDiagramEditor_23);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.LEFT);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_7);
    action.setToolTipText(Messages.AbstractDiagramEditor_16);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_8);
    action.setToolTipText(Messages.AbstractDiagramEditor_17);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.TOP);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_9);
    action.setToolTipText(Messages.AbstractDiagramEditor_18);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.BOTTOM);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_10);
    action.setToolTipText(Messages.AbstractDiagramEditor_19);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.CENTER);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_11);
    action.setToolTipText(Messages.AbstractDiagramEditor_20);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new AlignmentAction((IWorkbenchPart) this, PositionConstants.MIDDLE);
    // Externalise string as it's internal to GEF
    action.setText(Messages.AbstractDiagramEditor_12);
    action.setToolTipText(Messages.AbstractDiagramEditor_21);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    // Default Size
    action = new DefaultEditPartSizeAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Reset Aspect Ratio
    action = new ResetAspectRatioAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Properties
    action = new PropertiesAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    // Fill Colour
    action = new FillColorAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Connection Line Width
    action = new ConnectionLineWidthAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Connection Line Color
    action = new LineColorAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Font
    action = new FontAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Font Colour
    action = new FontColorAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Fill Opacity
    action = new OpacityAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Outline Opacity
    action = new OutlineOpacityAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Export As Image
    action = new ExportAsImageAction(this);
    registry.registerAction(action);
    // Export As Image to Clipboard
    action = new ExportAsImageToClipboardAction(this);
    registry.registerAction(action);
    // Connection Router types
    action = new ConnectionRouterAction.BendPointConnectionRouterAction(this);
    registry.registerAction(action);
    action = new ConnectionRouterAction.ManhattanConnectionRouterAction(this);
    registry.registerAction(action);
    // Send Backward
    action = new SendBackwardAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Bring Forward
    action = new BringForwardAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Send to Back
    action = new SendToBackAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Bring To Front
    action = new BringToFrontAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Text Alignment Actions
    for (TextAlignmentAction a : TextAlignmentAction.createActions(this)) {
        registry.registerAction(a);
        getSelectionActions().add(a.getId());
        getUpdateCommandStackActions().add(a);
    }
    // Text Position Actions
    for (TextPositionAction a : TextPositionAction.createActions(this)) {
        registry.registerAction(a);
        getSelectionActions().add(a.getId());
        getUpdateCommandStackActions().add(a);
    }
    // Lock Object
    action = new LockObjectAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Border Color
    action = new BorderColorAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    getUpdateCommandStackActions().add((UpdateAction) action);
    // Full Screen
    if (!PlatformUtils.isMac()) {
        action = new FullScreenAction(this);
        registry.registerAction(action);
    }
    // Select Element in Tree
    action = new SelectElementInTreeAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
}
Also used : MatchHeightAction(org.eclipse.gef.ui.actions.MatchHeightAction) MatchSizeAction(org.eclipse.gef.ui.actions.MatchSizeAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ArrayList(java.util.ArrayList) LineColorAction(com.archimatetool.editor.diagram.actions.LineColorAction) ConnectionRouterAction(com.archimatetool.editor.diagram.actions.ConnectionRouterAction) TextPositionAction(com.archimatetool.editor.diagram.actions.TextPositionAction) FullScreenAction(com.archimatetool.editor.diagram.actions.FullScreenAction) ActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry) PropertiesAction(com.archimatetool.editor.diagram.actions.PropertiesAction) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) ZoomNormalAction(com.archimatetool.editor.diagram.actions.ZoomNormalAction) DirectEditAction(org.eclipse.gef.ui.actions.DirectEditAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) MatchWidthAction(org.eclipse.gef.ui.actions.MatchWidthAction) FillColorAction(com.archimatetool.editor.diagram.actions.FillColorAction) SendToBackAction(com.archimatetool.editor.diagram.actions.SendToBackAction) ToggleGridEnabledAction(com.archimatetool.editor.diagram.actions.ToggleGridEnabledAction) BringForwardAction(com.archimatetool.editor.diagram.actions.BringForwardAction) ConnectionLineWidthAction(com.archimatetool.editor.diagram.actions.ConnectionLineWidthAction) TextAlignmentAction(com.archimatetool.editor.diagram.actions.TextAlignmentAction) IHandlerService(org.eclipse.ui.handlers.IHandlerService) SelectAllAction(com.archimatetool.editor.diagram.actions.SelectAllAction) ExportAsImageToClipboardAction(com.archimatetool.editor.diagram.actions.ExportAsImageToClipboardAction) OpacityAction(com.archimatetool.editor.diagram.actions.OpacityAction) OutlineOpacityAction(com.archimatetool.editor.diagram.actions.OutlineOpacityAction) ActionHandler(org.eclipse.jface.commands.ActionHandler) PrintDiagramAction(com.archimatetool.editor.diagram.actions.PrintDiagramAction) CutAction(com.archimatetool.editor.diagram.actions.CutAction) PasteSpecialAction(com.archimatetool.editor.diagram.actions.PasteSpecialAction) FontColorAction(com.archimatetool.editor.diagram.actions.FontColorAction) ResetAspectRatioAction(com.archimatetool.editor.diagram.actions.ResetAspectRatioAction) BringToFrontAction(com.archimatetool.editor.diagram.actions.BringToFrontAction) SelectElementInTreeAction(com.archimatetool.editor.diagram.actions.SelectElementInTreeAction) IAction(org.eclipse.jface.action.IAction) CopyAction(com.archimatetool.editor.diagram.actions.CopyAction) TextAlignmentAction(com.archimatetool.editor.diagram.actions.TextAlignmentAction) AlignmentAction(org.eclipse.gef.ui.actions.AlignmentAction) ToggleGridVisibleAction(com.archimatetool.editor.diagram.actions.ToggleGridVisibleAction) FontAction(com.archimatetool.editor.diagram.actions.FontAction) SendBackwardAction(com.archimatetool.editor.diagram.actions.SendBackwardAction) DefaultEditPartSizeAction(com.archimatetool.editor.diagram.actions.DefaultEditPartSizeAction) PasteAction(com.archimatetool.editor.diagram.actions.PasteAction) BorderColorAction(com.archimatetool.editor.diagram.actions.BorderColorAction) ZoomManager(org.eclipse.gef.editparts.ZoomManager) ToggleSnapToAlignmentGuidesAction(com.archimatetool.editor.diagram.actions.ToggleSnapToAlignmentGuidesAction) OutlineOpacityAction(com.archimatetool.editor.diagram.actions.OutlineOpacityAction) ExportAsImageAction(com.archimatetool.editor.diagram.actions.ExportAsImageAction) LockObjectAction(com.archimatetool.editor.diagram.actions.LockObjectAction)

Aggregations

ZoomInAction (org.eclipse.gef.ui.actions.ZoomInAction)10 ZoomOutAction (org.eclipse.gef.ui.actions.ZoomOutAction)10 IAction (org.eclipse.jface.action.IAction)9 ArrayList (java.util.ArrayList)6 ZoomManager (org.eclipse.gef.editparts.ZoomManager)4 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)3 KeyHandler (org.eclipse.gef.KeyHandler)3 GraphicalViewerKeyHandler (org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler)3 GraphicalViewer (org.eclipse.gef.GraphicalViewer)2 ToggleGridAction (org.eclipse.gef.ui.actions.ToggleGridAction)2 ToggleSnapToGeometryAction (org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction)2 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)2 BorderColorAction (com.archimatetool.editor.diagram.actions.BorderColorAction)1 BringForwardAction (com.archimatetool.editor.diagram.actions.BringForwardAction)1 BringToFrontAction (com.archimatetool.editor.diagram.actions.BringToFrontAction)1 ConnectionLineWidthAction (com.archimatetool.editor.diagram.actions.ConnectionLineWidthAction)1 ConnectionRouterAction (com.archimatetool.editor.diagram.actions.ConnectionRouterAction)1 CopyAction (com.archimatetool.editor.diagram.actions.CopyAction)1 CutAction (com.archimatetool.editor.diagram.actions.CutAction)1 DefaultEditPartSizeAction (com.archimatetool.editor.diagram.actions.DefaultEditPartSizeAction)1