Package org.eclipse.emf.common.command

Examples of org.eclipse.emf.common.command.Command


                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here


                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

        redoAction.setDescription(REDO_ACTION_DESC_DEFAULT);
      }
      if (fStructuredModel.getUndoManager() != null) {
        IStructuredTextUndoManager undoManager = fStructuredModel.getUndoManager();
        // get undo command
        Command undoCommand = undoManager.getUndoCommand();
        // set undo label and description
        if (undoAction != null) {
          undoAction.setEnabled(undoManager.undoable());
          if (undoCommand != null) {
            String label = undoCommand.getLabel();
            if (label != null) {
              String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
              updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
              undoAction.setText(customText);
            }
            String desc = undoCommand.getDescription();
            if (desc != null) {
              String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
              updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
              undoAction.setDescription(customDesc);
            }
          }
        }
        // get redo command
        Command redoCommand = undoManager.getRedoCommand();
        // set redo label and description
        if (redoAction != null) {
          redoAction.setEnabled(undoManager.redoable());
          if (redoCommand != null) {
            String label = redoCommand.getLabel();
            if (label != null) {
              String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
              updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
              redoAction.setText(customText);
            }
            String desc = redoCommand.getDescription();
            if (desc != null) {
              String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
              updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
              redoAction.setDescription(customDesc);
            }
View Full Code Here

        redoAction.setDescription(REDO_ACTION_DESC_DEFAULT);
      }
      if (fStructuredModel.getUndoManager() != null) {
        IStructuredTextUndoManager undoManager = fStructuredModel.getUndoManager();
        // get undo command
        Command undoCommand = undoManager.getUndoCommand();
        // set undo label and description
        if (undoAction != null) {
          undoAction.setEnabled(undoManager.undoable());
          if (undoCommand != null) {
            String label = undoCommand.getLabel();
            if (label != null) {
              String customText = MessageFormat.format(UNDO_ACTION_TEXT, new String[]{label});
              updateActions = updateActions || customText == null || previousUndoText == null || !customText.equals(previousUndoText);
              undoAction.setText(customText);
            }
            String desc = undoCommand.getDescription();
            if (desc != null) {
              String customDesc = MessageFormat.format(UNDO_ACTION_DESC, new String[]{desc});
              updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousUndoDesc);
              undoAction.setDescription(customDesc);
            }
          }
        }
        // get redo command
        Command redoCommand = undoManager.getRedoCommand();
        // set redo label and description
        if (redoAction != null) {
          redoAction.setEnabled(undoManager.redoable());
          if (redoCommand != null) {
            String label = redoCommand.getLabel();
            if (label != null) {
              String customText = MessageFormat.format(REDO_ACTION_TEXT, new String[]{label});
              updateActions = updateActions || customText == null || previousRedoText == null || !customText.equals(previousRedoText);
              redoAction.setText(customText);
            }
            String desc = redoCommand.getDescription();
            if (desc != null) {
              String customDesc = MessageFormat.format(REDO_ACTION_DESC, new String[]{desc});
              updateActions = updateActions || customDesc == null || previousRedoDesc == null || !customDesc.equals(previousRedoDesc);
              redoAction.setDescription(customDesc);
            }
View Full Code Here

   */
  public void update() {
    IStructuredTextUndoManager undoManager = _designer.getHTMLEditor()
        .getModel().getUndoManager();
    if (_undo) {
      Command c = undoManager.getUndoCommand();
      this.setEnabled(undoManager.undoable());
      if (c != null) {
        String label = c.getLabel();
        this
            .setText(MessageFormat
                .format(
                    ActionsMessages
                        .getString("DesignerUndoRedoAction.UNDO_LABEL"), new Object[] { label })); //$NON-NLS-1$
      } else {
        this.setText(ActionsMessages
            .getString("DesignerUndoRedoAction.UNDO")); //$NON-NLS-1$
      }
    } else {
      Command c = undoManager.getRedoCommand();
      this.setEnabled(undoManager.redoable());
      if (c != null) {
        String label = c.getLabel();
        this
            .setText(MessageFormat
                .format(
                    ActionsMessages
                        .getString("DesignerUndoRedoAction.REDO_LABEL"), new Object[] { label })); //$NON-NLS-1$
View Full Code Here

                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

                public void run() {
                  firePropertyChange(IEditorPart.PROP_DIRTY);

                  // Try to select the affected objects.
                  //
                  Command mostRecentCommand = ((CommandStack)event.getSource()).getMostRecentCommand();
                  if (mostRecentCommand != null) {
                    setSelectionToViewer(mostRecentCommand.getAffectedObjects());
                  }
                  if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) {
                    propertySheetPage.refresh();
                  }
                }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.command.Command

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.