Package org.eclipse.core.commands.operations

Examples of org.eclipse.core.commands.operations.IUndoableOperation.addContext()


        }
      }
      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) {
View Full Code Here


    } else if (id.equals("top")) { //$NON-NLS-1$
      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) {
View Full Code Here

  public void run() {
    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) {
View Full Code Here

  @Override
  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) {
View Full Code Here

      else if (id.equals(EditorAction.SAME_WIDTH))
        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) {
View Full Code Here

    this.group = group;
  }

  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

  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) {
View Full Code Here

  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) {
View Full Code Here

    String oldplacement = (String) parent.getChildConstraints(child);
    if (!placement.equals(oldplacement)) {
      IOperationHistory operationHistory = PlatformUI.getWorkbench()
          .getOperationSupport().getOperationHistory();
      IUndoableOperation operation = new JSplitPanePlacementOperation(container, child, placement);
      operation.addContext(parent.getUndoContext());
      try {
        operationHistory.execute(operation, null, null);
      } catch (ExecutionException e) {
        WidgetPlugin.getLogger().error(e);
      }
View Full Code Here

    if (!placement.equals(oldplacement)) {
      IOperationHistory operationHistory = PlatformUI.getWorkbench()
          .getOperationSupport().getOperationHistory();
      IUndoableOperation operation = new BorderLayoutPlacementOperation(
          container, child, placement);
      operation.addContext(parent.getUndoContext());
      try {
        operationHistory.execute(operation, null, null);
      } catch (ExecutionException e) {
        LayoutPlugin.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.