Java 类org.eclipse.gef.commands.CommandStackListener 实例源码

项目:limpet    文件:StackedchartsEditControl.java   
public void init(IViewPart view)
{
  IActionBars actionBars = view.getViewSite().getActionBars();
  IToolBarManager toolBarManager = actionBars.getToolBarManager();

  final UndoAction undoAction = new UndoAction(view);
  toolBarManager.add(undoAction);
  undoAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/undo.png"));
  final RedoAction redoAction = new RedoAction(view);
  redoAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID, "icons/redo.png"));
  toolBarManager.add(redoAction);

  viewer.getEditDomain().getCommandStack().addCommandStackListener(
      new CommandStackListener()
      {

        @Override
        public void commandStackChanged(EventObject event)
        {
          undoAction.setEnabled(undoAction.isEnabled());
          redoAction.setEnabled(redoAction.isEnabled());
        }
      });

}
项目:NEXCORE-UML-Modeler    文件:UMLDiagramCommandStack.java   
/**
 * @see org.eclipse.gef.commands.CommandStack#addCommandStackListener(org.eclipse.gef.commands.CommandStackListener)
 */
@Override
public void addCommandStackListener(CommandStackListener listener) {
    if (!commandStackListenerList.contains(listener)) {
        commandStackListenerList.add(listener);
    }
    super.addCommandStackListener(listener);
}
项目:NEXCORE-UML-Modeler    文件:UMLDiagramCommandStack.java   
/**
 * 
 * void
 */
@SuppressWarnings("unused")
private void fireNotifyCommandStackListener() {
    for (Iterator<CommandStackListener> iter = this.commandStackListenerList.iterator(); iter.hasNext();) {
        iter.next().commandStackChanged(new EventObject(this));
    }
}
项目:gef-gwt    文件:UndoablePropertySheetEntry.java   
/**
 * Constructs the root entry using the given command stack.
 * 
 * @param commandStack
 *            the command stack to use
 * @since 3.1
 */
public UndoablePropertySheetEntry(CommandStack commandStack) {
    this.commandStack = commandStack;
    this.commandStackListener = new CommandStackListener() {
        public void commandStackChanged(EventObject e) {
            refreshFromRoot();
        }
    };
    this.commandStack.addCommandStackListener(commandStackListener);
}
项目:birt    文件:WrapperCommandStack.java   
/**
 * @deprecated
 * 
 *             Do not use, use
 *             addCommandStackListener(ActivityStackListener) instead
 * 
 * @see org.eclipse.gef.commands.CommandStack#addCommandStackListener(org.eclipse.gef.commands.CommandStackListener)
 */
public void addCommandStackListener( CommandStackListener listener )
{
    // use addCommandStackListener(ActivityStackListener) instead
    // this method will called by GEF.
    // can't assert false.
    // see bugzilla 147687
    // assert false;
}
项目:snaker-designer    文件:SnakerFlowDesignerEditor.java   
protected CommandStackListener getDelegatingCommandStackListener() {
    return this.delegatingCommandStackListener;
}
项目:birt    文件:WrapperCommandStack.java   
/**
 * @deprecated
 * 
 *             Do not use, use
 *             removeCommandStackListener(ActivityStackListener) instead
 * 
 * @see org.eclipse.gef.commands.CommandStack#removeCommandStackListener(org.eclipse.gef.commands.CommandStackListener)
 */
public void removeCommandStackListener( CommandStackListener listener )
{
    // use removeCommandStackListener(ActivityStackListener) instead
    // assert false;
}