Search in sources :

Example 1 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project tdi-studio-se by Talend.

the class AbstractTalendEditor method configureGraphicalViewer.

@Override
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    /** * Manage the view in the Outline ** */
    ScrollingGraphicalViewer viewer = (ScrollingGraphicalViewer) getGraphicalViewer();
    viewer.setSelectionManager(new TalendSelectionManager());
    TalendScalableFreeformRootEditPart root = new TalendScalableFreeformRootEditPart(getEditorInput());
    List<String> zoomLevels = new ArrayList<String>();
    zoomLevels.add(ZoomManager.FIT_ALL);
    zoomLevels.add(ZoomManager.FIT_WIDTH);
    zoomLevels.add(ZoomManager.FIT_HEIGHT);
    root.getZoomManager().setZoomLevelContributions(zoomLevels);
    // root.getZoomManager().setZoomAnimationStyle(ZoomManager.ANIMATE_NEVER);
    IAction zoomIn = new ZoomInAction(root.getZoomManager());
    IAction zoomOut = new ZoomOutAction(root.getZoomManager());
    getActionRegistry().registerAction(zoomIn);
    getActionRegistry().registerAction(zoomOut);
    IHandlerService service = (IHandlerService) getEditorSite().getService(IHandlerService.class);
    service.activateHandler(zoomIn.getActionDefinitionId(), new ActionHandler(zoomIn));
    service.activateHandler(zoomOut.getActionDefinitionId(), new ActionHandler(zoomOut));
    IAction directEditAction = new DirectEditAction(this);
    getActionRegistry().registerAction(directEditAction);
    getSelectionActions().add(directEditAction.getId());
    IAction copyAction = new GEFCopyAction(this);
    getActionRegistry().registerAction(copyAction);
    getSelectionActions().add(copyAction.getId());
    // setAction(copyAction.getId(), copyAction);
    IAction pasteAction = new GEFPasteAction(this);
    getActionRegistry().registerAction(pasteAction);
    getSelectionActions().add(pasteAction.getId());
    // setAction(pasteAction.getId(), pasteAction);
    IAction deleteAction = new GEFDeleteAction(this);
    getActionRegistry().registerAction(deleteAction);
    getSelectionActions().add(deleteAction.getId());
    // setAction(deleteAction.getId(), deleteAction);
    IAction undoAction = new GEFUndoAction(this);
    getActionRegistry().registerAction(undoAction);
    getSelectionActions().add(undoAction.getId());
    IAction redoAction = new GEFRedoAction(this);
    getActionRegistry().registerAction(redoAction);
    getSelectionActions().add(redoAction.getId());
    IAction setRefAction = new ConnectionSetAsMainRef(this);
    getActionRegistry().registerAction(setRefAction);
    getSelectionActions().add(setRefAction.getId());
    IAction modifyMergeAction = new ModifyMergeOrderAction(this);
    getActionRegistry().registerAction(modifyMergeAction);
    getSelectionActions().add(modifyMergeAction.getId());
    IAction modifyOutputOrderAction = new ModifyOutputOrderAction(this);
    getActionRegistry().registerAction(modifyOutputOrderAction);
    getSelectionActions().add(modifyOutputOrderAction.getId());
    List<IAction> calcOrderActions = ModifyConnectionOrderAction.getOrderActions(this);
    for (IAction orderAction : calcOrderActions) {
        getActionRegistry().registerAction(orderAction);
        getSelectionActions().add(orderAction.getId());
    }
    viewer.setRootEditPart(root);
    PartFactory partFactory = new PartFactory();
    // set the factory to use for creating EditParts for elements in the model
    getGraphicalViewer().setEditPartFactory(partFactory);
    getGraphicalViewer().setKeyHandler(new NodePartKeyHander(getGraphicalViewer()).setParent(getCommonKeyHandler()));
    // GraphicalViewer graViewer = getGraphicalViewer();
    // graViewer.setKeyHandler(new GraphicalViewerKeyHandler(graViewer));
    initializeActivationCodeTrigger();
    /** * Management of the context menu ** */
    ContextMenuProvider cmProvider = new TalendEditorContextMenuProvider(this, viewer, getActionRegistry());
    viewer.setContextMenu(cmProvider);
    /** * Management of the Zoom ** */
    /*
         * ZoomManager manager = (ZoomManager) getGraphicalViewer().getProperty(ZoomManager.class.toString()); if
         * (manager != null) { manager.setZoom(getProcess().getZoom()); }
         */
    // Scroll-wheel Zoom
    getGraphicalViewer().setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    /** * Snap To Grid ** */
    // Grid properties
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(AbstractTalendEditor.GRID_SIZE, AbstractTalendEditor.GRID_SIZE));
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, new Boolean(true));
    // We keep grid visibility and enablement in sync
    getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, new Boolean(true));
    IAction showGrid = new ToggleGridAction(getGraphicalViewer());
    getActionRegistry().registerAction(showGrid);
    /** * Snap To Geometry ** */
    getGraphicalViewer().setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, new Boolean(false));
    IAction snapAction = new ToggleSnapToGeometryAction(getGraphicalViewer());
    getActionRegistry().registerAction(snapAction);
    configurationSubJob(viewer);
}
Also used : ModifyMergeOrderAction(org.talend.designer.core.ui.action.ModifyMergeOrderAction) ToggleSnapToGeometryAction(org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction) GEFCopyAction(org.talend.designer.core.ui.action.GEFCopyAction) GEFPasteAction(org.talend.designer.core.ui.action.GEFPasteAction) GEFDeleteAction(org.talend.designer.core.ui.action.GEFDeleteAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ProcessTreePartFactory(org.talend.designer.core.ui.editor.outline.ProcessTreePartFactory) ArrayList(java.util.ArrayList) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) NodePartKeyHander(org.talend.designer.core.ui.NodePartKeyHander) ModifyOutputOrderAction(org.talend.designer.core.ui.action.ModifyOutputOrderAction) DirectEditAction(org.eclipse.gef.ui.actions.DirectEditAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) IAction(org.eclipse.jface.action.IAction) ConnectionSetAsMainRef(org.talend.designer.core.ui.action.ConnectionSetAsMainRef) ToggleGridAction(org.eclipse.gef.ui.actions.ToggleGridAction) GEFUndoAction(org.talend.designer.core.ui.action.GEFUndoAction) Dimension(org.eclipse.draw2d.geometry.Dimension) IHandlerService(org.eclipse.ui.handlers.IHandlerService) GEFRedoAction(org.talend.designer.core.ui.action.GEFRedoAction) ActionHandler(org.eclipse.jface.commands.ActionHandler)

Example 2 with ZoomInAction

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

the class MonitorDashboardEditor method configureGraphicalViewer.

/**
	 * @see org.eclipse.gef.ui.parts.GraphicalEditor.configureGraphicalViewer
	 */
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    GraphicalViewer viewer = getGraphicalViewer();
    ScalableFreeformRootEditPart rootEditPart = new ScalableFreeformRootEditPart();
    viewer.setRootEditPart(rootEditPart);
    viewer.setEditPartFactory(new MonitorEditPartFacotry());
    ZoomManager manager = rootEditPart.getZoomManager();
    double[] zoomLevels = new double[] { 1.0, 1.2, 1.4, 1.6, 1.8, 2.0 };
    manager.setZoomLevels(zoomLevels);
    getActionRegistry().registerAction(new ZoomInAction(manager));
    getActionRegistry().registerAction(new ZoomOutAction(manager));
    KeyHandler keyHandler = new GefViewerKeyHandler(viewer);
    keyHandler.put(KeyStroke.getReleased('', 97, SWT.CONTROL), getActionRegistry().getAction(ActionFactory.SELECT_ALL.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));
    viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);
    viewer.setKeyHandler(keyHandler);
    //initialize context menu
    MenuManager menuManager = new MenuManager();
    menuManager.setRemoveAllWhenShown(true);
    menuManager.addMenuListener(new IMenuListener() {

        /**
			 * get menus to show.
			 * 
			 * @param manager IMenuManager
			 */
        public void menuAboutToShow(IMenuManager manager) {
            IStructuredSelection selection = (IStructuredSelection) getGraphicalViewer().getSelection();
            String[] ids = new String[] {};
            if (null == selection || selection.isEmpty() || selection.getFirstElement() instanceof DashboardPart) {
                manager.add(getActionRegistry().getAction(ActionFactory.SELECT_ALL.getId()));
                ids = new String[] { AddHostMonitorAction.ID, SEPARATOR, DashboardRefreshAction.ID };
            } else if (selection.getFirstElement() instanceof HostMonitorPart) {
                ids = new String[] { MonitorDetailAction.ID, DeleteHostMonitorAction.ID, EditAliasNameAction.ID, SEPARATOR, //HARoleChangeAction.ID, SEPARATOR,
                HostDashboardHistoryAction.ID, AddDatabaseMonitorAction.ID, AddBrokerMonitorAction.ID, SEPARATOR, HideHostAction.ID, MinimizeFigureAction.ID, DashboardRefreshAction.ID };
            } else if (selection.getFirstElement() instanceof DatabaseMonitorPart) {
                ids = new String[] { MonitorDetailAction.ID, DeleteDatabaseMonitorAction.ID, EditAliasNameAction.ID, SEPARATOR, DbDashboardHistoryAction.ID, OpenApplyLogDBLogAction.ID, OpenCopyLogDBLogAction.ID, OpenDatabaseLogAction.ID, SEPARATOR, ShowHostAction.ID, MinimizeFigureAction.ID, DashboardRefreshAction.ID };
            } else if (selection.getFirstElement() instanceof BrokerMonitorPart) {
                ids = new String[] { MonitorDetailAction.ID, DeleteBrokerMonitorAction.ID, EditAliasNameAction.ID, SEPARATOR, ShowBrokerClientAction.ID, ShowBrokerDabaseAction.ID, SEPARATOR, ShowHostAction.ID, MinimizeFigureAction.ID, DashboardRefreshAction.ID };
            } else if (selection.getFirstElement() instanceof ClientMonitorPart) {
                ids = new String[] { EditAliasNameAction.ID };
            } else if (selection.getFirstElement() instanceof BrokerDBListMonitorPart) {
                ids = new String[] { EditAliasNameAction.ID };
            }
            for (String id : ids) {
                if (id.equals(SEPARATOR)) {
                    manager.add(new Separator());
                } else {
                    IAction action = ActionManager.getInstance().getAction(id);
                    ((ISelectionAction) action).setSelectionProvider(getGraphicalViewer());
                    ActionManager.addActionToManager(manager, action);
                }
            }
            manager.update(true);
        }
    });
    viewer.setContextMenu(menuManager);
}
Also used : GraphicalViewer(org.eclipse.gef.GraphicalViewer) BrokerDBListMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerDBListMonitorPart) IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) BrokerMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.BrokerMonitorPart) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) HostMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.HostMonitorPart) IMenuListener(org.eclipse.jface.action.IMenuListener) ScalableFreeformRootEditPart(org.eclipse.gef.editparts.ScalableFreeformRootEditPart) ClientMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.ClientMonitorPart) ZoomManager(org.eclipse.gef.editparts.ZoomManager) DashboardPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DashboardPart) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) DatabaseMonitorPart(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.DatabaseMonitorPart) MonitorEditPartFacotry(com.cubrid.cubridmanager.ui.mondashboard.editor.parts.MonitorEditPartFacotry) KeyHandler(org.eclipse.gef.KeyHandler) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) Separator(org.eclipse.jface.action.Separator)

Example 3 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project jbosstools-hibernate by jbosstools.

the class DiagramViewer method initializeGraphicalViewer.

protected void initializeGraphicalViewer() {
    final GraphicalViewer viewer = getGraphicalViewer();
    viewer.setEditPartFactory(new OrmEditPartFactory());
    // 
    viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer).setParent(getCommonKeyHandler()));
    // 
    List<String> zoomLevels = new ArrayList<String>(3);
    zoomLevels.add(ZoomManager.FIT_ALL);
    zoomLevels.add(ZoomManager.FIT_WIDTH);
    zoomLevels.add(ZoomManager.FIT_HEIGHT);
    gefRootEditPart.getZoomManager().setZoomLevelContributions(zoomLevels);
    IAction zoomIn = new ZoomInAction(gefRootEditPart.getZoomManager());
    IAction zoomOut = new ZoomOutAction(gefRootEditPart.getZoomManager());
    getActionRegistry().registerAction(zoomIn);
    getActionRegistry().registerAction(zoomOut);
    // 
    viewer.setRootEditPart(gefRootEditPart);
    viewer.addDropTargetListener(createTransferDropTargetListener());
    viewer.setContents(getOrmDiagram());
    PopupMenuProvider provider = new PopupMenuProvider(viewer, getActionRegistry());
    viewer.setContextMenu(provider);
    // $NON-NLS-1$
    getSite().registerContextMenu("FlowDiagramContextmenu", provider, viewer);
    // Scroll-wheel Zoom
    viewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
    // Ruler properties
    DiagramRuler ruler = getOrmDiagram().getRuler(PositionConstants.WEST);
    RulerProvider rulerProvider = null;
    if (ruler != null) {
        rulerProvider = new DiagramRulerProvider(ruler);
    }
    getGraphicalViewer().setProperty(RulerProvider.PROPERTY_VERTICAL_RULER, rulerProvider);
    ruler = getOrmDiagram().getRuler(PositionConstants.NORTH);
    rulerProvider = null;
    if (ruler != null) {
        rulerProvider = new DiagramRulerProvider(ruler);
    }
    getGraphicalViewer().setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER, rulerProvider);
    getGraphicalViewer().setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, new Boolean(getOrmDiagram().getRulerVisibility()));
    loadProperties();
    updateConnectionRouterActions();
}
Also used : ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) GraphicalViewer(org.eclipse.gef.GraphicalViewer) IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ArrayList(java.util.ArrayList) DiagramRulerProvider(org.jboss.tools.hibernate.ui.diagram.rulers.DiagramRulerProvider) DiagramRulerProvider(org.jboss.tools.hibernate.ui.diagram.rulers.DiagramRulerProvider) RulerProvider(org.eclipse.gef.rulers.RulerProvider) DiagramRuler(org.jboss.tools.hibernate.ui.diagram.rulers.DiagramRuler) GraphicalViewerKeyHandler(org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler) OrmEditPartFactory(org.jboss.tools.hibernate.ui.diagram.editors.parts.OrmEditPartFactory) PopupMenuProvider(org.jboss.tools.hibernate.ui.diagram.editors.popup.PopupMenuProvider) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction)

Example 4 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project jbosstools-hibernate by jbosstools.

the class DiagramViewer method createActions.

@SuppressWarnings("unchecked")
protected void createActions() {
    // super.createActions();
    // BEGIN: redefine super.createActions
    ActionRegistry registry = getActionRegistry();
    IAction action;
    action = new RefreshAction(this);
    registry.registerAction(action);
    getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.REFRESH.getId(), action);
    action = new UndoAction(this);
    registry.registerAction(action);
    getStackActions().add(action.getId());
    action = new RedoAction(this);
    registry.registerAction(action);
    getStackActions().add(action.getId());
    action = new SelectAllAction(this);
    registry.registerAction(action);
    action = new DeleteAction((IWorkbenchPart) this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new SaveAction(this);
    registry.registerAction(action);
    getPropertyActions().add(action.getId());
    registry.registerAction(new PrintDiagramViewerAction(this));
    // END: redefine super.createActions
    getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(), getActionRegistry().getAction(ActionFactory.PRINT.getId()));
    getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getActionRegistry().getAction(ActionFactory.SELECT_ALL.getId()));
    action = new OpenMappingAction(this);
    registry.registerAction(action);
    action = new OpenSourceAction(this);
    registry.registerAction(action);
    action = new ExportImageAction(this);
    registry.registerAction(action);
    action = new AutoLayoutAction(this);
    registry.registerAction(action);
    ToggleConnectionsAction actionToggleConnections = new ToggleConnectionsAction(this);
    registry.registerAction(actionToggleConnections);
    action = new ToggleAssociationAction(this);
    registry.registerAction(action);
    action = new ToggleClassMappingAction(this);
    registry.registerAction(action);
    action = new ToggleForeignKeyConstraintAction(this);
    registry.registerAction(action);
    action = new TogglePropertyMappingAction(this);
    registry.registerAction(action);
    action = new ConnectionRouterFanAction(this);
    registry.registerAction(action);
    getPropertyActions().add(action.getId());
    action = new ConnectionRouterManhattanAction(this);
    registry.registerAction(action);
    getPropertyActions().add(action.getId());
    ToggleShapeExpandStateAction actionToggleShapeExpandState = new ToggleShapeExpandStateAction(this);
    registry.registerAction(actionToggleShapeExpandState);
    getSelectionActions().add(actionToggleShapeExpandState.getId());
    action = new ShapeExpandAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new ShapeCollapseAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    ToggleShapeVisibleStateAction actionToggleShapeVisibleState = new ToggleShapeVisibleStateAction(this);
    registry.registerAction(actionToggleShapeVisibleState);
    getSelectionActions().add(actionToggleShapeVisibleState.getId());
    action = new ShapeHideAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new ShapeShowAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    // action = new CollapseAllAction(this);
    // registry.registerAction(action);
    // action = new ExpandAllAction(this);
    // registry.registerAction(action);
    action = new ZoomInAction(gefRootEditPart.getZoomManager());
    registry.registerAction(action);
    action = new ZoomOutAction(gefRootEditPart.getZoomManager());
    registry.registerAction(action);
    action = new LexicalSortingAction(this, null);
    registry.registerAction(action);
    Action[] act = new Action[4];
    act[0] = (Action) registry.getAction(TogglePropertyMappingAction.ACTION_ID);
    act[1] = (Action) registry.getAction(ToggleClassMappingAction.ACTION_ID);
    act[2] = (Action) registry.getAction(ToggleAssociationAction.ACTION_ID);
    act[3] = (Action) registry.getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
    // act[4] = null;
    // act[5] = (Action)registry.getAction(ConnectionRouterManhattanAction.ACTION_ID);
    // act[6] = (Action)registry.getAction(ConnectionRouterFanAction.ACTION_ID);
    actionToggleConnections.setMenuCreator(new ActionMenu(act));
// act = new Action[2];
// act[0] = (Action)registry.getAction(ShapeExpandAction.ACTION_ID);
// act[1] = (Action)registry.getAction(ShapeCollapseAction.ACTION_ID);
// actionToggleShapeExpandState.setMenuCreator(new ActionMenu(act));
// act = new Action[2];
// act[0] = (Action)registry.getAction(ShapeShowAction.ACTION_ID);
// act[1] = (Action)registry.getAction(ShapeHideAction.ACTION_ID);
// actionToggleShapeVisibleState.setMenuCreator(new ActionMenu(act));
}
Also used : SaveAction(org.eclipse.gef.ui.actions.SaveAction) ToggleAssociationAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleAssociationAction) IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) TogglePropertyMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.TogglePropertyMappingAction) ToggleRulerVisibilityAction(org.eclipse.gef.ui.actions.ToggleRulerVisibilityAction) ToggleConnectionsAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction) ToggleClassMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleClassMappingAction) RedoAction(org.eclipse.gef.ui.actions.RedoAction) RefreshAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.RefreshAction) ShapeCollapseAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeCollapseAction) ShapeShowAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeShowAction) OpenMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenMappingAction) UndoAction(org.eclipse.gef.ui.actions.UndoAction) PrintDiagramViewerAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.PrintDiagramViewerAction) ConnectionRouterFanAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ConnectionRouterFanAction) ExportImageAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ExportImageAction) ToggleShapeVisibleStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction) AutoLayoutAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction) LexicalSortingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.LexicalSortingAction) ToggleGridAction(org.eclipse.gef.ui.actions.ToggleGridAction) OpenSourceAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenSourceAction) SelectAllAction(org.eclipse.gef.ui.actions.SelectAllAction) ToggleShapeExpandStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction) SaveAction(org.eclipse.gef.ui.actions.SaveAction) Action(org.eclipse.jface.action.Action) DeleteAction(org.eclipse.gef.ui.actions.DeleteAction) ShapeExpandAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeExpandAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) ShapeHideAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeHideAction) ToggleForeignKeyConstraintAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleForeignKeyConstraintAction) ToggleSnapToGeometryAction(org.eclipse.gef.ui.actions.ToggleSnapToGeometryAction) ConnectionRouterManhattanAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ConnectionRouterManhattanAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ShapeExpandAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeExpandAction) ActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry) ToggleShapeExpandStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeExpandStateAction) ToggleShapeVisibleStateAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleShapeVisibleStateAction) PrintDiagramViewerAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.PrintDiagramViewerAction) OpenMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenMappingAction) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) RedoAction(org.eclipse.gef.ui.actions.RedoAction) AutoLayoutAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.AutoLayoutAction) ShapeHideAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeHideAction) ShapeShowAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeShowAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction) OpenSourceAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.OpenSourceAction) ToggleConnectionsAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleConnectionsAction) IAction(org.eclipse.jface.action.IAction) ToggleAssociationAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleAssociationAction) ExportImageAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ExportImageAction) ToggleForeignKeyConstraintAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleForeignKeyConstraintAction) LexicalSortingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.LexicalSortingAction) ConnectionRouterFanAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ConnectionRouterFanAction) RefreshAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.RefreshAction) TogglePropertyMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.TogglePropertyMappingAction) SelectAllAction(org.eclipse.gef.ui.actions.SelectAllAction) ConnectionRouterManhattanAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ConnectionRouterManhattanAction) DeleteAction(org.eclipse.gef.ui.actions.DeleteAction) ShapeCollapseAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ShapeCollapseAction) ActionMenu(org.jboss.tools.hibernate.ui.diagram.editors.actions.ActionMenu) ToggleClassMappingAction(org.jboss.tools.hibernate.ui.diagram.editors.actions.ToggleClassMappingAction) UndoAction(org.eclipse.gef.ui.actions.UndoAction)

Example 5 with ZoomInAction

use of org.eclipse.gef.ui.actions.ZoomInAction in project statecharts by Yakindu.

the class StatechartDiagramEditor method registerZoomActions.

@SuppressWarnings("unchecked")
protected void registerZoomActions() {
    IAction action;
    action = new ZoomInAction(getZoomManager());
    // $NON-NLS-1$ // no text necessary since this
    action.setText("");
    // is not a visible action
    getActionRegistry().registerAction(action);
    getSelectionActions().add(action.getId());
    action = new ZoomOutAction(getZoomManager());
    // $NON-NLS-1$ // no text necessary since this
    action.setText("");
    // is not a visible action
    getActionRegistry().registerAction(action);
    getSelectionActions().add(action.getId());
}
Also used : IAction(org.eclipse.jface.action.IAction) ZoomOutAction(org.eclipse.gef.ui.actions.ZoomOutAction) ZoomInAction(org.eclipse.gef.ui.actions.ZoomInAction)

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