Overview

 
Package  Use  Tree  Deprecated  Index  Help 
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD


 

org.eclipse.emf.edit.command
Interface OverrideableCommand

All Superinterfaces:
Command

All Known Implementing Classes:
AbstractOverrideableCommand


public interface OverrideableCommand
extends Command

This represents a command that can be overridden by another command. The intended use of this is that an overrideable command should call EditingDomain.createOverrideCommand in its constructor to set up the override command. All its Command methods should then be guarded as follows:

   public void execute()
   {
     if (getOverride() != null)
     {
       getOverride().execute();
     }
     else
     {
       doExecute();
     }
   }
 
The contract with the overriding command is that the overrideable command will implement all its methods in corresponding doXxx methods, e.g., execute() is implemented in doExecute(), so that the overriding command can call back to the overrideable command's doXxx methods if it wants to extend rather than replace the original implementation. AbstractOverrideableCommand provides a convienient base implementation for overrideable commands.


Method Summary
 boolean doCanExecute()
          This is overrideable command's implementation of canExecute.
 boolean doCanUndo()
          This is overrideable command's implementation of canUndo.
 void doDispose()
          This is overrideable command's implementation of dispose.
 void doExecute()
          This is overrideable command's implementation of execute.
 Collection doGetAffectedObjects()
          This is overrideable command's implementation of getAffectedObjects.
 String doGetDescription()
          This is overrideable command's implementation of getDescription.
 String doGetLabel()
          This is overrideable command's implementation of getLabel.
 Collection doGetResult()
          This is overrideable command's implementation of getResult.
 void doRedo()
          This is overrideable command's implementation of redo.
 void doUndo()
          This is overrideable command's implementation of undo.
 Command getOverride()
          This returns the command that overrides this command.
 void setOverride(Command overrideCommand)
          This sets the command that overrides this command.
 
Methods inherited from interface org.eclipse.emf.common.command.Command
canExecute, canUndo, chain, dispose, execute, getAffectedObjects, getDescription, getLabel, getResult, redo, undo
 

Method Detail

 

 

getOverride

public Command getOverride()

This returns the command that overrides this command.


 

 

setOverride

public void setOverride(Command overrideCommand)

This sets the command that overrides this command.


 

 

doCanExecute

public boolean doCanExecute()

This is overrideable command's implementation of canExecute.


 

 

doExecute

public void doExecute()

This is overrideable command's implementation of execute.


 

 

doCanUndo

public boolean doCanUndo()

This is overrideable command's implementation of canUndo.


 

 

doUndo

public void doUndo()

This is overrideable command's implementation of undo.


 

 

doRedo

public void doRedo()

This is overrideable command's implementation of redo.


 

 

doGetResult

public Collection doGetResult()

This is overrideable command's implementation of getResult.


 

 

doGetAffectedObjects

public Collection doGetAffectedObjects()

This is overrideable command's implementation of getAffectedObjects.


 

 

doGetLabel

public String doGetLabel()

This is overrideable command's implementation of getLabel.


 

 

doGetDescription

public String doGetDescription()

This is overrideable command's implementation of getDescription.


 

 

doDispose

public void doDispose()

This is overrideable command's implementation of dispose.


 

Overview

 
Package  Use  Tree  Deprecated  Index  Help 
Copyright 2001-2004 IBM Corporation and others.
All Rights Reserved.
 PREV CLASS   NEXT CLASS FRAMES    NO FRAMES  
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD