Examples of IOperationHistory


Examples of org.eclipse.core.commands.operations.IOperationHistory

   *
   * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
   */
  public void dispose() {

    IOperationHistory history = getHistory();
    if (history != null) {
      history.removeOperationHistoryListener(historyListener);
    }

    if (isInvalid()) {
      return;
    }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

   *
   * @return the operation history for workbench operations.
   * @since 3.1
   */
  public IOperationHistory getOperationHistory() {
    IOperationHistory history = OperationHistoryFactory.getOperationHistory();
    /*
     * Set up the history if we have not done so before.
     */
    if (approver == null) {
      /*
       * install an operation approver that prevents linear undo violations
       * in any context
       */
      approver = new AdvancedValidationUserApprover(getUndoContext());
      history.addOperationApprover(approver);
      /*
       * set a limit for the workbench undo context
       */
      history.setLimit(getUndoContext(), 25);
    }
    return history;
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

      }
      if (operation != null) {
        WidgetAdapter adapter = WidgetAdapter
            .getWidgetAdapter(container);
        operation.addContext(adapter.getUndoContext());
        IOperationHistory operationHistory = PlatformUI.getWorkbench()
            .getOperationSupport().getOperationHistory();
        try {
          operationHistory.execute(operation, null, null);
        } catch (ExecutionException e) {
          GroupLayoutPlugin.getLogger().error(e);
        }
      }
    }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

      operation = getTop();
    }
    if (operation != null) {
      CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
      operation.addContext(parent.getUndoContext());
      IOperationHistory operationHist = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
      try {
        operationHist.execute(operation, null, null);
        return true;
      } catch (ExecutionException e) {
        GroupLayoutPlugin.getLogger().error(e);
        return false;
      }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

    Border border = target.getBorder();
    if (border == null || border.getClass() != borderClass) {
      IUndoableOperation operation = new BorderSwitchOperation(target, factory);
      WidgetAdapter targetAdapter = WidgetAdapter.getWidgetAdapter(target);
      operation.addContext(targetAdapter.getUndoContext());
      IOperationHistory history = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
      try {
        history.execute(operation, null, null);
        setChecked(true);
      } catch (ExecutionException e) {
        BorderPlugin.getLogger().error(e);
      }
    }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

  public void run() {
    if (target.getBorder() != null) {
      IUndoableOperation operation = new NullBorderSwitchOperation(target);
      WidgetAdapter targetAdapter = WidgetAdapter.getWidgetAdapter(target);
      operation.addContext(targetAdapter.getUndoContext());
      IOperationHistory history = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
      try {
        history.execute(operation, null, null);
        setChecked(true);
      } catch (ExecutionException e) {
        BorderPlugin.getLogger().error(e);
      }
    }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

        operation = doSameWidth();
      else if (id.equals(EditorAction.SAME_HEIGHT))
        operation = doSameHeight();
      if (operation != null) {
        operation.addContext(getUndoContext());
        IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
        try {
          operationHistory.execute(operation, null, null);
          return true;
        } catch (Exception e) {
          WidgetPlugin.getLogger().error(e);
          return false;
        }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

  }

  public void run() {
    IUndoableOperation operation = new ButtonGroupRenamingOperation(adapter, group);
    operation.addContext(adapter.getUndoContext());
    IOperationHistory history = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
    try {
      history.execute(operation, null, null);
    } catch (ExecutionException e) {
      WidgetPlugin.getLogger().error(e);
    }
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

  public void run() {
    JPanel jpanel = (JPanel) adapter.getWidget();
    if (jpanel.getLayout() != null) {
      IUndoableOperation operation = new NullLayoutOperation(adapter);
      operation.addContext(adapter.getUndoContext());
      IOperationHistory operationHistory = PlatformUI.getWorkbench()
          .getOperationSupport().getOperationHistory();
      try {
        operationHistory.execute(operation, null, null);
      } catch (ExecutionException e) {
        WidgetPlugin.getLogger().error(e);
      }
    }
  }
View Full Code Here

Examples of org.eclipse.core.commands.operations.IOperationHistory

  public void run() {
    if (!newClassname.equals(oldClassname)) {
      IUndoableOperation operation = new SetLayoutOperation(config,
          jpaneladapter);
      operation.addContext(jpaneladapter.getUndoContext());
      IOperationHistory operationHistory = PlatformUI.getWorkbench()
          .getOperationSupport().getOperationHistory();
      try {
        operationHistory.execute(operation, null, null);
      } catch (ExecutionException e) {
        WidgetPlugin.getLogger().error(e);
      }
    }
  }
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.