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.common.command
Class IdentityCommand

java.lang.Object
  extended byorg.eclipse.emf.common.command.AbstractCommand
      extended byorg.eclipse.emf.common.command.IdentityCommand

All Implemented Interfaces:
Command


public class IdentityCommand
extends AbstractCommand

A command that always produces the same result.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying
 
Field Summary
static IdentityCommand INSTANCE
          An empty instance of this object.
protected  Collection result
          Keeps track of the result returned from getResult().
 
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label
 
Constructor Summary
IdentityCommand()
          Creates an empty instance.
IdentityCommand(Collection result)
          Creates an instance with the given result collection.
IdentityCommand(Object result)
          Creates an instance with a result collection containing the given result object.
IdentityCommand(String label)
          Creates an instance with the given label.
IdentityCommand(String label, Collection result)
          Creates an instance with the given label the result collection.
IdentityCommand(String label, Object result)
          Creates an instance with the given label and a result collection containing the given result object.
IdentityCommand(String label, String description)
          Creates an instance with the given label and description.
IdentityCommand(String label, String description, Collection result)
          Creates an instance with the given label, description, result collection.
IdentityCommand(String label, String description, Object result)
          Creates an instance with the given label, description, and a result collection containing the given result object.
 
Method Summary
 boolean canExecute()
          Returns true.
 void execute()
          Do nothing.
 String getDescription()
          Returns a string suitable to help describe the effect of this command.
 String getLabel()
          Returns a string suitable to represent the label that identifies this command.
 Collection getResult()
          Return the identity result.
 void redo()
          Do nothing.
 void undo()
          Do nothing.
 
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
canUndo, chain, dispose, getAffectedObjects, prepare, setDescription, setLabel, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

 

Field Detail

 

 

INSTANCE

public static final IdentityCommand INSTANCE

An empty instance of this object.


 

 

result

protected Collection result

Keeps track of the result returned from getResult().

Constructor Detail

 

 

IdentityCommand

public IdentityCommand()

Creates an empty instance.


 

 

IdentityCommand

public IdentityCommand(Object result)

Creates an instance with a result collection containing the given result object.

Parameters:
result - the one object in the result collection.


 

 

IdentityCommand

public IdentityCommand(Collection result)

Creates an instance with the given result collection.

Parameters:
result - the result collection.


 

 

IdentityCommand

public IdentityCommand(String label)

Creates an instance with the given label.

Parameters:
label - the label.


 

 

IdentityCommand

public IdentityCommand(String label,
                       Object result)

Creates an instance with the given label and a result collection containing the given result object.

Parameters:
label - the label.
result - the one object in the result collection.


 

 

IdentityCommand

public IdentityCommand(String label,
                       Collection result)

Creates an instance with the given label the result collection.

Parameters:
label - the label.
result - the result collection.


 

 

IdentityCommand

public IdentityCommand(String label,
                       String description)

Creates an instance with the given label and description.

Parameters:
label - the label.
description - the description.


 

 

IdentityCommand

public IdentityCommand(String label,
                       String description,
                       Object result)

Creates an instance with the given label, description, and a result collection containing the given result object.

Parameters:
label - the label.
description - the description.
result - the one object in the result collection.


 

 

IdentityCommand

public IdentityCommand(String label,
                       String description,
                       Collection result)

Creates an instance with the given label, description, result collection.

Parameters:
label - the label.
description - the description.
result - the result collection.
Method Detail

 

 

canExecute

public boolean canExecute()

Returns true.

Specified by:
canExecute in interface Command
Overrides:
canExecute in class AbstractCommand

Returns:
true.


 

 

execute

public void execute()

Do nothing.


 

 

undo

public void undo()

Do nothing.

Specified by:
undo in interface Command
Overrides:
undo in class AbstractCommand


 

 

redo

public void redo()

Do nothing.


 

 

getLabel

public String getLabel()

Description copied from interface: Command
Returns a string suitable to represent the label that identifies this command.

Specified by:
getLabel in interface Command
Overrides:
getLabel in class AbstractCommand


 

 

getDescription

public String getDescription()

Description copied from interface: Command
Returns a string suitable to help describe the effect of this command.

Specified by:
getDescription in interface Command
Overrides:
getDescription in class AbstractCommand


 

 

getResult

public Collection getResult()

Return the identity result.

Specified by:
getResult in interface Command
Overrides:
getResult in class AbstractCommand

Returns:
the identity result.


 

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