Package org.eclipse.gef.ui.actions

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


   * 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

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

    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

public class WebFlowGraphicalEditor extends AbstractConfigGraphicalEditor {

  @Override
  protected void createActions() {
    super.createActions();
    ActionRegistry registry = getActionRegistry();
    IAction action = new ToggleActionStateAction(this);
    registry.registerAction(action);
    getSelectionActions().add(action.getId());

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

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

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

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

  public void performRequest(Request request) {
    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
      IEditorPart editor = PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage()
          .getActiveEditor();
      ActionRegistry actionRegistry = (ActionRegistry) editor
          .getAdapter(ActionRegistry.class);
      IAction action = actionRegistry
          .getAction(EditPropertiesAction.EDITPROPERTIES);
      if (action != null && action.isEnabled()) {
        action.run();
      }
    }
View Full Code Here

      public void widgetSelected(SelectionEvent e) {
        IEditorPart editor = PlatformUI.getWorkbench()
            .getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();
        ActionRegistry actionRegistry = (ActionRegistry) editor
            .getAdapter(ActionRegistry.class);
        EditPropertiesAction action = (EditPropertiesAction) actionRegistry
            .getAction(EditPropertiesAction.EDITPROPERTIES);
        action.setOpenDialog(true);
       
        EditPropertiesCommand command = new EditPropertiesCommand();
View Full Code Here

  }

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

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

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

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

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

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

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

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

  }
View Full Code Here

  public void performRequest(Request request) {
    if (request.getType().equals(RequestConstants.REQ_OPEN)) {
      IEditorPart editor = PlatformUI.getWorkbench()
          .getActiveWorkbenchWindow().getActivePage()
          .getActiveEditor();
      ActionRegistry actionRegistry = (ActionRegistry) editor
          .getAdapter(ActionRegistry.class);
      IAction action = actionRegistry
          .getAction(EditPropertiesAction.EDITPROPERTIES);
      if (action != null && action.isEnabled()) {
        action.run();
      }
    }
View Full Code Here

    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) {
      performDirectEdit();
    }
    else if (request.getType().equals(RequestConstants.REQ_OPEN)) {
      IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
      ActionRegistry actionRegistry = (ActionRegistry) editor.getAdapter(ActionRegistry.class);
      IAction action = actionRegistry.getAction(EditPropertiesAction.EDITPROPERTIES);
      if (action != null && action.isEnabled()) {
        action.run();
      }
    }
  }
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.