Examples of ActionRegistry


Examples of org.eclipse.gef.ui.actions.ActionRegistry

        popupManager.createActions(manager);
      }
    });

    keyHandler = new KeyHandler();
    ActionRegistry a = new ActionRegistry();
    keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
      new DeleteAction(this));

    keyHandler.put(KeyStroke.getPressed('+',SWT.KEYPAD_ADD, 0),
      new ZoomAction(this,1,null));

    keyHandler.put(KeyStroke.getPressed('-',SWT.KEYPAD_SUBTRACT, 0),
      new ZoomAction(this,-1,null));

    /*keyHandler.put(KeyStroke.getPressed(SWT.CTRL, 0),
      new ZoomAction(this,-1,null));*/

    keyHandler.put(KeyStroke.getPressed(SWT.F2, 0), a
      .getAction(GEFActionConstants.DIRECT_EDIT));

    this.higlightColor = ColorConstants.yellow;

    createCombos();
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

        popupManager.createActions(manager);
      }
    });

    keyHandler = new KeyHandler();
    ActionRegistry a = new ActionRegistry();
    keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
      new DeleteAction(this));

    keyHandler.put(KeyStroke.getPressed('+',SWT.KEYPAD_ADD, 0),
      new ZoomAction(this,1,null));

    keyHandler.put(KeyStroke.getPressed('-',SWT.KEYPAD_SUBTRACT, 0),
      new ZoomAction(this,-1,null));

    /*keyHandler.put(KeyStroke.getPressed(SWT.CTRL, 0),
      new ZoomAction(this,-1,null));*/

    keyHandler.put(KeyStroke.getPressed(SWT.F2, 0), a
      .getAction(GEFActionConstants.DIRECT_EDIT));

    this.higlightColor = ColorConstants.yellow;

    createCombos();
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

        popupManager.createActions(manager);
      }
    });

    keyHandler = new KeyHandler();
    ActionRegistry a = new ActionRegistry();
    keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0),
      new DeleteAction(this));

    keyHandler.put(KeyStroke.getPressed('+',SWT.KEYPAD_ADD, 0),
      new ZoomAction(this,1,null));

    keyHandler.put(KeyStroke.getPressed('-',SWT.KEYPAD_SUBTRACT, 0),
      new ZoomAction(this,-1,null));

    /*keyHandler.put(KeyStroke.getPressed(SWT.CTRL, 0),
      new ZoomAction(this,-1,null));*/

    keyHandler.put(KeyStroke.getPressed(SWT.F2, 0), a
      .getAction(GEFActionConstants.DIRECT_EDIT));

    this.higlightColor = ColorConstants.yellow;

    createCombos();
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

   *
   * @return the action registry
   */
  protected ActionRegistry getActionRegistry() {
    if (_actionRegistry == null)
      _actionRegistry = new ActionRegistry();
    return _actionRegistry;
  }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

  @Override
  @SuppressWarnings("unchecked")
  protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();
    IAction action;

    action = new CopyTemplateAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new MatchWidthAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new MatchHeightAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new DirectEditAction((IWorkbenchPart) this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    // action = new MeasureProofreadingAction(this);
    // registry.registerAction(action);
    action = new RelabelMeasuresAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
    action = new ManageSourcesAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

  }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

    }

    @Override
    public void init(IPageSite pageSite) {
      super.init(pageSite);
      ActionRegistry registry = getActionRegistry();
      IActionBars bars = pageSite.getActionBars();
      String id = ActionFactory.UNDO.getId();
      bars.setGlobalActionHandler(id, registry.getAction(id));
      id = ActionFactory.REDO.getId();
      bars.setGlobalActionHandler(id, registry.getAction(id));
      id = ActionFactory.DELETE.getId();
      bars.setGlobalActionHandler(id, registry.getAction(id));
      bars.updateActionBars();
    }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

  protected void createActions() {
    // create actions that will be used inside the editor, for instance in a
    // contextual menu
    super.createActions();

    ActionRegistry registry = getActionRegistry();
    Class<?> actions[] = { CopyAction.class, CutAction.class,
        PasteAction.class, PrintAction.class, SelectAllAction.class,
        SetRefinementAction.class };

    // Constructs all actions
    for (Class<?> clz : actions) {
      try {
        Constructor<?> ctor = clz.getConstructor(IWorkbenchPart.class);

        IAction action = (IAction) ctor.newInstance(this);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

  @Override
  public void buildContextMenu(IMenuManager menu) {
    IAction action;

    GEFActionConstants.addStandardActionGroups(menu);
    ActionRegistry registry = getActionRegistry();

    addIfEnabled(registry, menu, SetRefinementAction.getActionId());

    action = registry.getAction(ActionFactory.UNDO.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);

    action = registry.getAction(ActionFactory.REDO.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_UNDO, action);

    action = registry.getAction(ActionFactory.CUT.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_COPY, action);

    action = registry.getAction(ActionFactory.COPY.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_COPY, action);

    action = registry.getAction(ActionFactory.PASTE.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_COPY, action);

    action = registry.getAction(ActionFactory.DELETE.getId());
    menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
  }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

        /**
         * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite)
         */
        public void init(IPageSite pageSite) {
            super.init(pageSite);
            ActionRegistry registry = getActionRegistry();
            IActionBars bars = pageSite.getActionBars();
            String id = ActionFactory.UNDO.getId();
            bars.setGlobalActionHandler(id, registry.getAction(id));
            id = ActionFactory.REDO.getId();
            bars.setGlobalActionHandler(id, registry.getAction(id));
            id = ActionFactory.DELETE.getId();
            bars.setGlobalActionHandler(id, registry.getAction(id));
        }
View Full Code Here

Examples of org.eclipse.gef.ui.actions.ActionRegistry

        return model;
    }

    protected void createActions() {
        super.createActions();
        ActionRegistry registry = getActionRegistry();

        IAction action = new DirectEditAction((IWorkbenchPart) this);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.LEFT);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.CENTER);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.RIGHT);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.TOP);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.MIDDLE);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());

        action = new AlignmentAction((IWorkbenchPart) this,
                PositionConstants.BOTTOM);
        registry.registerAction(action);
        getSelectionActions().add(action.getId());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.