Package org.eclipse.gef.ui.actions

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


    }

    @SuppressWarnings("unchecked")
    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


    }

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

        Collection<BoxAction> actions = PrintingPlugin.getBoxExtensionActions(this);

        for( IAction action : actions ) {
            registry.registerAction(action);
            getSelectionActions().add(action.getId());
        }

    }
View Full Code Here

  }

  @Override
  @SuppressWarnings("unchecked")
  public void createActions() {
    ActionRegistry registry = getActionRegistry();
    IAction 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) {
      {
        /*
         * Somehow it did not work to set a transparent color, let's use
         * the standard marquee icon for the moment
         */
        setHoverImageDescriptor(SharedImages.DESC_MARQUEE_TOOL_16);
        setImageDescriptor(SharedImages.DESC_MARQUEE_TOOL_16);
      }
    };
    registry.registerAction(action);

    action = new SXEDeleteAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

    action = new SaveAction(this);
    registry.registerAction(action);
    getPropertyActions().add(action.getId());

    registry.registerAction(new PrintAction(this));

    action = new CopyRecordAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

    action = new PasteRecordAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
  }
View Full Code Here

   *
   * @see org.eclipse.gef.ui.parts.GraphicalEditor#createActions()
   */
  protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();
    ISharedImages sharedImages = PlatformUI.getWorkbench()
        .getSharedImages();

    IAction action;

    action = new DesignerUndoRedoAction(true, this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO);
    action.setId(IWorkbenchCommandConstants.EDIT_UNDO);
    getSite().getKeyBindingService().registerAction(action);
    registry.registerAction(action);

    action = new DesignerUndoRedoAction(false, this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
    action.setId(IWorkbenchCommandConstants.EDIT_REDO);
    getSite().getKeyBindingService().registerAction(action);
    registry.registerAction(action);

    action = new DeleteAction(this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
    action.setId(IWorkbenchCommandConstants.EDIT_DELETE);
    getSite().getKeyBindingService().registerAction(action);
    this.getSelectionActions().add(action.getId());
    registry.registerAction(action);

    action = new CopyAction(this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
    action.setId(IWorkbenchCommandConstants.EDIT_COPY);
    getSite().getKeyBindingService().registerAction(action);
    this.getSelectionActions().add(action.getId());
    registry.registerAction(action);

    action = new CutAction(this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT);
    action.setId(IWorkbenchCommandConstants.EDIT_CUT);
    getSite().getKeyBindingService().registerAction(action);
    this.getSelectionActions().add(action.getId());
    registry.registerAction(action);

    action = new PasteAction(this);
    action.setImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
    action.setDisabledImageDescriptor(sharedImages
        .getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
    action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
    action.setId(IWorkbenchCommandConstants.EDIT_PASTE);
    getSite().getKeyBindingService().registerAction(action);
    this.getSelectionActions().add(action.getId());
    registry.registerAction(action);
  }
View Full Code Here

        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

        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

        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

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

  @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

    }

    @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

TOP

Related Classes of org.eclipse.gef.ui.actions.ActionRegistry

Copyright © 2018 www.massapicom. 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.