Package org.eclipse.gef.commands

Examples of org.eclipse.gef.commands.CommandStack


            selectedPart = (EditPart) object;
        }
    }

    protected void executeCommand(Command command) {
        CommandStack commandStack;
        if (targetPart instanceof GraphicalEditor) {
            commandStack = (CommandStack) ((GraphicalEditor) targetPart).getAdapter(CommandStack.class);
        } else {
            commandStack = ((OutlineViewer) ((ContentOutline) targetPart).getCurrentPage()).getCommandStack();
        }
        commandStack.execute(command);
    }
View Full Code Here


            if (editor != null) {
                Work work = openEditor(editor, workDefinition);
                if (work != null) {
                    SetWorkCommand setCommand = new SetWorkCommand();
                    setCommand.setPropertyValue(work);
                    CommandStack stack = getViewer().getEditDomain().getCommandStack();
                    stack.execute(setCommand);
                }
            }
        }
    }
View Full Code Here

   * Executes the given command.
   *
   * @param command
   */
  public void executeCommand(Command command) {
    CommandStack stack = getEditDomain().getCommandStack();
    stack.execute(command);
  }
View Full Code Here

    {
      eraseFeedback();
      String newValue = (String)this.comboCellEditor.getValue();
      if (newValue != null && !newValue.equals(this.initialValue))
      {
        CommandStack stack = getEditPart().getViewer().getEditDomain()
            .getCommandStack();
        stack.execute(getEditPart().getCommand(getDirectEditRequest()));
      }     
    }
    finally
    {
      bringDown();
View Full Code Here

    return this.textPart;
  }
 
  private void internalCommit()
  {
    CommandStack stack = getEditPart().getViewer().getEditDomain()
        .getCommandStack();
    stack.execute(getEditPart().getCommand(getDirectEditRequest()));           
  }
View Full Code Here

      MessageDialog.openWarning(getSite().getShell(), EditorMessages.saveModifiedTextFailedTitle, message);
    }
  }

  public void markXmlSaved() {
    CommandStack stack = getCommandStack();
    if (stack == null) {
      Activator.getLogger().warning("No command stack available when trying to save document!");
    } else {
      stack.markSaveLocation();
    }
  }
View Full Code Here

            if (editor != null) {
                Work work = openEditor(editor, workDefinition);
                if (work != null) {
                    SetWorkCommand setCommand = new SetWorkCommand();
                    setCommand.setPropertyValue(work);
                    CommandStack stack = getViewer().getEditDomain().getCommandStack();
                    stack.execute(setCommand);
                }
            }
        }
    }
View Full Code Here

      // If leaving a graph page, clear the GEF command stack. This
      // ensures that graph pages can only undo/redo recent edits that
      // were performed in the page itself. All XML edits should remain
      // undo/redoable from the source and form pages.
      AbstractConfigGraphicalEditor editor = (AbstractConfigGraphicalEditor) activeEditorPart;
      CommandStack stack = (CommandStack) editor.getAdapter(CommandStack.class);
      stack.flush();
    }
    activeEditorPart = part;

    if (part instanceof StructuredTextEditor) {
      sourceViewerActionContributor.setActiveEditor(part);
View Full Code Here

TOP

Related Classes of org.eclipse.gef.commands.CommandStack

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.