Examples of ActionRegistry


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

   
    this.editorInput = null;
    this.activeConfig = null;

    // dispose the ActionRegistry (will dispose all actions)
    ActionRegistry actionRegistry = getActionRegistry();
    if (actionRegistry != null) {
      actionRegistry.dispose();
    }
    // important: always call super implementation of dispose
    if (getDiagramTypeProvider() != null)
      super.dispose();
  }
View Full Code Here

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

        getGraphicalViewer(), TextTransfer.getInstance()));
}

protected void createActions() {
  super.createActions();
  ActionRegistry registry = getActionRegistry();
  IAction action;
 
  action = new CopyTemplateAction(this);
  registry.registerAction(action);

  action = new MatchWidthAction(this);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());
 
  action = new MatchHeightAction(this);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());
 
  action = new LogicPasteTemplateAction(this);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());

  action = new IncrementDecrementAction(this, true);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());

  action = new IncrementDecrementAction(this, false);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());

  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.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.BOTTOM);
  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.MIDDLE);
  registry.registerAction(action);
  getSelectionActions().add(action.getId());
}
View Full Code Here

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

  public OutlinePage(EditPartViewer viewer){
    super(viewer);
  }
  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));
    id = IncrementDecrementAction.INCREMENT;
    bars.setGlobalActionHandler(id, registry.getAction(id));
    id = IncrementDecrementAction.DECREMENT;
    bars.setGlobalActionHandler(id, registry.getAction(id));
    bars.updateActionBars();
  }
View Full Code Here

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

   *
   * @param actionId
   *          the id of the action to run
   */
  public static final void runAction(final String actionId) {
    final ActionRegistry registry = getActionRegistry();
    if (registry != null) {
      final IAction action = registry.getAction(actionId);
      if (action != null) {
        action.run();
      }
    }
  }
View Full Code Here

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

  }

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

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

    action = new PrintAction(this);
    registry.registerAction(action);

    action = new ExportAction(this);
    registry.registerAction(action);

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

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

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

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

  /**
   * Creates actions for this editor and registers them with the {@link ActionRegistry}.
   */
  protected void createActions() {
    ActionRegistry registry = getActionRegistry();
    IAction action;

    action = new ExportAction(this);
    registry.registerAction(action);

    action = new OpenJavaType(this);
    registry.registerAction(action);

    action = new OpenConfigFile(this);
    registry.registerAction(action);

    action = new PrintAction(this);
    registry.registerAction(action);
  }
View Full Code Here

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

   * Lazily creates and returns the action registry.
   * @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

   * by looking up the ID in the {@link #getActionRegistry() action registry}. If the corresponding action is an
   * {@link UpdateAction}, it will have its <code>update()</code> method called.
   * @param actionIds the list of IDs to update
   */
  protected void updateActions(List actionIds) {
    ActionRegistry registry = getActionRegistry();
    Iterator iter = actionIds.iterator();
    while (iter.hasNext()) {
      IAction action = registry.getAction(iter.next());
      if (action instanceof UpdateAction) {
        ((UpdateAction) action).update();
      }
    }
  }
View Full Code Here

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

public class IntegrationGraphicalEditor extends AbstractConfigGraphicalEditor {

  @Override
  protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();
    IAction action = new CreateExplicitChannelAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());
  }
View Full Code Here

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

    if (actionBars != null && configEditor != null) {
      if (activeEditorPart instanceof AbstractConfigGraphicalEditor) {
        AbstractConfigGraphicalEditor editor = (AbstractConfigGraphicalEditor) activeEditorPart;
        Object obj = editor.getAdapter(ActionRegistry.class);
        if (obj instanceof ActionRegistry) {
          ActionRegistry registry = (ActionRegistry) obj;
          actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
              registry.getAction(ActionFactory.UNDO.getId()));
          actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(),
              registry.getAction(ActionFactory.REDO.getId()));
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(),
              registry.getAction(ActionFactory.PRINT.getId()));
          actionBars
              .setGlobalActionHandler(ActionFactory.EXPORT.getId(), registry.getAction(ExportAction.ID));
        }
      }
      else if (activeEditorPart instanceof SpringConfigGraphPage) {
        SpringConfigGraphPage editor = (SpringConfigGraphPage) activeEditorPart;
        Object obj = editor.getAdapter(ActionRegistry.class);
        if (obj instanceof ActionRegistry) {
          ActionRegistry registry = (ActionRegistry) obj;
          actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), null);
          actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), null);
          actionBars.setGlobalActionHandler(ActionFactory.PRINT.getId(),
              registry.getAction(ActionFactory.PRINT.getId()));
          actionBars
              .setGlobalActionHandler(ActionFactory.EXPORT.getId(), registry.getAction(ExportAction.ID));
        }
      }
      else {
        ITextEditor editor = configEditor.getSourcePage();
        actionBars.setGlobalActionHandler(ActionFactory.UNDO.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.