|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.common.command.AbstractCommand org.eclipse.emf.mapping.command.CreateMappingCommand
public class CreateMappingCommand
The create mapping command creates a new mapping in a MappingDomain
from a set of the domain's input and output objects.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.emf.common.command.AbstractCommand |
---|
AbstractCommand.NonDirtying |
Field Summary | |
---|---|
protected static java.lang.String |
DESCRIPTION
This cachaes the description. |
protected MappingDomain |
domain
This keeps track of the mapping domain in which the command operates. |
static int |
ENABLE_ALL
Deprecated. - use MappingDomain.ENABLE_ALL |
static int |
ENABLE_EMPTY_INPUTS
Deprecated. - use MappingDomain.ENABLE_EMPTY_INPUTS |
static int |
ENABLE_EMPTY_OUTPUTS
Deprecated. - use MappingDomain.ENABLE_EMPTY_OUTPUTS |
static int |
ENABLE_INCOMPATIBLE_METAOBJECTS
Deprecated. - use MappingDomain.ENABLE_INCOMPATIBLE_METAOBJECTS |
static int |
ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS
Deprecated. - use MappingDomain.ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS |
static int |
ENABLE_MAPPED_INPUTS
Deprecated. - use MappingDomain.ENABLE_MULTIPLE_INPUT_MAPPINGS |
static int |
ENABLE_MAPPED_OUTPUTS
Deprecated. - use MappingDomain.ENABLE_MULTIPLE_OUTPUT_MAPPINGS |
static int |
ENABLE_MULTIPLE_INPUTS
Deprecated. - use MappingDomain.ENABLE_MULTIPLE_INPUTS |
static int |
ENABLE_MULTIPLE_OUTPUTS
Deprecated. - use MappingDomain.ENABLE_MULTIPLE_OUTPUTS |
static int |
ENABLE_UNMAPPED_PARENTS
Deprecated. - use MappingDomain.ENABLE_UNMAPPED_PARENTS |
protected java.util.Collection<?> |
inputs
This keeps track of the input objects that are to be mapped. |
protected static java.lang.String |
LABEL
This caches the label. |
protected Mapping |
newMapping
This is set during execute() to record the new mapping that is created. |
protected java.util.Collection<?> |
outputs
This keeps track of the output objects that are to be mapped. |
protected Command |
subcommand
This is set during execute() to record the command used to add the newly created mapping to the mapping root. |
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand |
---|
description, isExecutable, isPrepared, label |
Constructor Summary | |
---|---|
CreateMappingCommand(MappingDomain domain,
java.util.Collection<?> collection)
This creates a command that creates a new mapping involving the given domain's collection of input and output objects. |
|
CreateMappingCommand(MappingDomain domain,
java.util.Collection<?> collection,
int enablementFlags)
Deprecated. |
Method Summary | |
---|---|
static Command |
create(MappingDomain domain,
java.util.Collection<?> collection)
This creates a command that creates a new mapping involving the given domain's collection of input and output objects. |
static Command |
create(MappingDomain domain,
java.util.Collection<?> inputs,
java.util.Collection<?> outputs)
This creates a command that creates a new mapping with the given collections of inputs and outputs. |
static Command |
create(MappingDomain domain,
java.util.Collection<?> inputs,
java.lang.Object output)
This creates a command that creates a new mapping with the given collection of inputs and output. |
static Command |
create(MappingDomain domain,
java.lang.Object input,
java.util.Collection<?> outputs)
This creates a command that creates a new mapping with the given input and collection of outputs. |
static Command |
create(MappingDomain domain,
java.lang.Object input,
java.lang.Object output)
This creates a command that creates a new mapping between the given input and output. |
void |
dispose()
Called to indicate that the command will never be used again. |
void |
execute()
Performs the command activity required for the effect. |
java.util.Collection<?> |
getAffectedObjects()
Returns an empty list. |
java.lang.String |
getDescription()
Returns a string suitable to help describe the effect of this command. |
java.lang.String |
getLabel()
Returns a string suitable to represent the label that identifies this command. |
java.util.Collection<?> |
getResult()
Returns an empty list. |
protected boolean |
prepare()
Called at most once in AbstractCommand.canExecute() to give the command an opportunity to ready itself for execution. |
void |
redo()
Performs the command activity required to redo the effect after undoing the effect. |
java.lang.String |
toString()
This gives an abbreviated name using this object's own class' name, without package qualification, followed by a space separated list of field:value pairs. |
void |
undo()
Throws a runtime exception. |
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand |
---|
canExecute, canUndo, chain, setDescription, setLabel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final int ENABLE_MULTIPLE_INPUTS
@Deprecated public static final int ENABLE_MULTIPLE_OUTPUTS
@Deprecated public static final int ENABLE_MAPPED_INPUTS
@Deprecated public static final int ENABLE_MAPPED_OUTPUTS
@Deprecated public static final int ENABLE_INCOMPATIBLE_METAOBJECTS
@Deprecated public static final int ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS
@Deprecated public static final int ENABLE_EMPTY_INPUTS
@Deprecated public static final int ENABLE_EMPTY_OUTPUTS
@Deprecated public static final int ENABLE_UNMAPPED_PARENTS
@Deprecated public static final int ENABLE_ALL
protected static final java.lang.String LABEL
protected static final java.lang.String DESCRIPTION
protected MappingDomain domain
protected java.util.Collection<?> inputs
protected java.util.Collection<?> outputs
protected Mapping newMapping
execute()
to record the new mapping that is created.
protected Command subcommand
execute()
to record the command used to add the newly created mapping to the mapping root.
Constructor Detail |
---|
@Deprecated public CreateMappingCommand(MappingDomain domain, java.util.Collection<?> collection, int enablementFlags)
public CreateMappingCommand(MappingDomain domain, java.util.Collection<?> collection)
Method Detail |
---|
public static Command create(MappingDomain domain, java.util.Collection<?> collection)
public static Command create(MappingDomain domain, java.lang.Object input, java.lang.Object output)
public static Command create(MappingDomain domain, java.util.Collection<?> inputs, java.util.Collection<?> outputs)
public static Command create(MappingDomain domain, java.util.Collection<?> inputs, java.lang.Object output)
public static Command create(MappingDomain domain, java.lang.Object input, java.util.Collection<?> outputs)
protected boolean prepare()
AbstractCommand
AbstractCommand.canExecute()
to give the command an opportunity to ready itself for execution.
The returned value is stored in AbstractCommand.canExecute()
.
In other words, you can override this method to initialize
and to yield a cached value for the all subsequent calls to canExecute.
prepare
in class AbstractCommand
public void execute()
Command
execute
when canExecute
returns false
,
or when canExecute
hasn't been called, is undefined.
public void undo()
AbstractCommand
undo
in interface Command
undo
in class AbstractCommand
public void redo()
Command
redo
the effect after undoing the effect.
The effect, if any, of calling redo
before undo
is called is undefined.
Note that if you implement redo
to call execute
then any derived class will be restricted by that decision also.
public java.util.Collection<?> getResult()
AbstractCommand
getResult
in interface Command
getResult
in class AbstractCommand
public java.util.Collection<?> getAffectedObjects()
AbstractCommand
getAffectedObjects
in interface Command
getAffectedObjects
in class AbstractCommand
public void dispose()
Command
dispose
in interface Command
dispose
in class AbstractCommand
public java.lang.String getLabel()
Command
getLabel
in interface Command
getLabel
in class AbstractCommand
public java.lang.String getDescription()
Command
getDescription
in interface Command
getDescription
in class AbstractCommand
public java.lang.String toString()
toString
in class AbstractCommand
|
Copyright 2001-2012 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |