Package org.eclipse.core.commands.operations

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


      designer.getClipboard().add(adapter);
    }
    IOperationHistory operationHistory = PlatformUI.getWorkbench()
        .getOperationSupport().getOperationHistory();
    IUndoableOperation operation = new CutOperation(designer.getSelectedComponents());
    operation.addContext(designer.getUndoContext());
    try {
      operationHistory.execute(operation, null, null);
    } catch (ExecutionException e) {
      VisualSwingPlugin.getLogger().error(e);
    }
View Full Code Here


          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          if (b instanceof Component) {
            Component jcomp = (Component) b;
            WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(jcomp);
            if (adapter != null) {
              operation.addContext(adapter.getUndoContext());
            }
          }
          operationHistory.execute(operation, null, null);
        }
      } catch (Exception e) {
View Full Code Here

        WidgetAdapter childAdapter = WidgetAdapter.getWidgetAdapter(child);
        CompositeAdapter parentAdapter = (CompositeAdapter) childAdapter.getParentAdapter();
        IUndoableOperation operation = parentAdapter.doKeyPressed(e);
        if (operation != null) {
          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          operation.addContext(getUndoContext());
          try {
            operationHistory.execute(operation, null, null);
          } catch (ExecutionException ex) {
            VisualSwingPlugin.getLogger().error(ex);
          }
View Full Code Here

      return;
    IOperationHistory operationHistory = PlatformUI.getWorkbench()
        .getOperationSupport().getOperationHistory();
    IUndoableOperation operation = new DeleteOperation(designer
        .getSelectedComponents(), designer.getRoot());
    operation.addContext(designer.getUndoContext());
    try {
      operationHistory.execute(operation, null, null);
    } catch (ExecutionException e) {
      VisualSwingPlugin.getLogger().error(e);
    }
View Full Code Here

    setToolTipText(Messages.VarChangeAction_Change_Var_Name);
  }

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

                Component child = wa.getParentContainer();
                children.add(child);
                new_constraints.add(compositeAdapter.getChildConstraints(child));
              }
              IUndoableOperation operation = new MoveResizeOperation(lastParent, compositeAdapter, children, lastConstraints, new_constraints);
              operation.addContext(designer.getUndoContext());
              try {
                operationHistory.execute(operation, null, null);
              } catch (ExecutionException e) {
                VisualSwingPlugin.getLogger().error(e);
              }
View Full Code Here

          List<Component> children = new ArrayList<Component>();
          for (WidgetAdapter wa : designer.getSelectedWidget()) {
            children.add(wa.getParentContainer());
          }
          IUndoableOperation operation = new DragDropOperation(lastParent, children, lastConstraints);
          operation.addContext(designer.getUndoContext());
          try {
            operationHistory.execute(operation, null, null);
          } catch (ExecutionException e) {
            VisualSwingPlugin.getLogger().error(e);
          }
View Full Code Here

            Component child = wa.getParentContainer();
            children.add(child);
            new_constraints.add(((CompositeAdapter) adapter).getChildConstraints(child));
          }
          IUndoableOperation operation = new MoveResizeOperation(lastParent, ((CompositeAdapter) adapter), children, lastConstraints, new_constraints);
          operation.addContext(designer.getUndoContext());
          try {
            operationHistory.execute(operation, null, null);
          } catch (ExecutionException e) {
            VisualSwingPlugin.getLogger().error(e);
          }
View Full Code Here

        Object newValue = iEditor.getValue();
        Object oldValue = iEditor.getOldValue();
        if (isValueChanged(oldValue, newValue)) {
          IUndoableOperation operation = new SetWidgetValueOperation(adapter, oldValue, newValue);
          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          operation.addContext(adapter.getUndoContext());
          operationHistory.execute(operation, null, null);
          adapter.setDirty(true);
          CompositeAdapter container = (CompositeAdapter) adapter.getParentAdapter();
          if (container != null)
            container.adjustLayout(adapter.getWidget());
View Full Code Here

          IOperationHistory operationHistory = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
          if (b instanceof Component) {
            Component jcomp = (Component) b;
            WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(jcomp);
            if (adapter != null) {
              operation.addContext(adapter.getUndoContext());
            }
          }
          operationHistory.execute(operation, null, null);
        }
      } catch (Exception 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.