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.mapping.command
Class CreateMappingCommand

java.lang.Object
  extended byorg.eclipse.emf.common.command.AbstractCommand
      extended byorg.eclipse.emf.mapping.command.CreateMappingCommand

All Implemented Interfaces:
Command


public class CreateMappingCommand
extends AbstractCommand

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 inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying
 
Field Summary
protected static 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  Collection inputs
          This keeps track of the input objects that are to be mapped.
protected static String LABEL
          This caches the label.
protected  Mapping newMapping
          This is set during execute() to record the new mapping that is created.
protected  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, 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, Collection collection, int enablementFlags)
          Deprecated.  
 
Method Summary
static Command create(MappingDomain domain, 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, Collection inputs, Collection outputs)
          This creates a command that creates a new mapping with the given collections of inputs and outputs.
static Command create(MappingDomain domain, Collection inputs, Object output)
          This creates a command that creates a new mapping with the given collection of inputs and output.
static Command create(MappingDomain domain, Object input, Collection outputs)
          This creates a command that creates a new mapping with the given input and collection of outputs.
static Command create(MappingDomain domain, Object input, 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.
 Collection getAffectedObjects()
          Returns an empty list.
 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()
          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.
 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

 

 

ENABLE_MULTIPLE_INPUTS

public static final int ENABLE_MULTIPLE_INPUTS

Deprecated. - use MappingDomain.ENABLE_MULTIPLE_INPUTS

See Also:
Constant Field Values


 

 

ENABLE_MULTIPLE_OUTPUTS

public static final int ENABLE_MULTIPLE_OUTPUTS

Deprecated. - use MappingDomain.ENABLE_MULTIPLE_OUTPUTS

See Also:
Constant Field Values


 

 

ENABLE_MAPPED_INPUTS

public static final int ENABLE_MAPPED_INPUTS

Deprecated. - use MappingDomain.ENABLE_MULTIPLE_INPUT_MAPPINGS

See Also:
Constant Field Values


 

 

ENABLE_MAPPED_OUTPUTS

public static final int ENABLE_MAPPED_OUTPUTS

Deprecated. - use MappingDomain.ENABLE_MULTIPLE_OUTPUT_MAPPINGS

See Also:
Constant Field Values


 

 

ENABLE_INCOMPATIBLE_METAOBJECTS

public static final int ENABLE_INCOMPATIBLE_METAOBJECTS

Deprecated. - use MappingDomain.ENABLE_INCOMPATIBLE_METAOBJECTS

See Also:
Constant Field Values


 

 

ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS

public static final int ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS

Deprecated. - use MappingDomain.ENABLE_INCOMPATIBLE_TYPE_CLASSIFIERS

See Also:
Constant Field Values


 

 

ENABLE_EMPTY_INPUTS

public static final int ENABLE_EMPTY_INPUTS

Deprecated. - use MappingDomain.ENABLE_EMPTY_INPUTS

See Also:
Constant Field Values


 

 

ENABLE_EMPTY_OUTPUTS

public static final int ENABLE_EMPTY_OUTPUTS

Deprecated. - use MappingDomain.ENABLE_EMPTY_OUTPUTS

See Also:
Constant Field Values


 

 

ENABLE_UNMAPPED_PARENTS

public static final int ENABLE_UNMAPPED_PARENTS

Deprecated. - use MappingDomain.ENABLE_UNMAPPED_PARENTS

See Also:
Constant Field Values


 

 

ENABLE_ALL

public static final int ENABLE_ALL

Deprecated. - use MappingDomain.ENABLE_ALL

See Also:
Constant Field Values


 

 

LABEL

protected static final String LABEL

This caches the label.


 

 

DESCRIPTION

protected static final String DESCRIPTION

This cachaes the description.


 

 

domain

protected MappingDomain domain

This keeps track of the mapping domain in which the command operates.


 

 

inputs

protected Collection inputs

This keeps track of the input objects that are to be mapped.


 

 

outputs

protected Collection outputs

This keeps track of the output objects that are to be mapped.


 

 

newMapping

protected Mapping newMapping

This is set during execute() to record the new mapping that is created.


 

 

subcommand

protected Command subcommand

This is set during execute() to record the command used to add the newly created mapping to the mapping root.

Constructor Detail

 

 

CreateMappingCommand

public CreateMappingCommand(MappingDomain domain,
                            Collection collection,
                            int enablementFlags)

Deprecated.  


 

 

CreateMappingCommand

public CreateMappingCommand(MappingDomain domain,
                            Collection collection)

This creates a command that creates a new mapping involving the given domain's collection of input and output objects.

Method Detail

 

 

create

public static Command create(MappingDomain domain,
                             Collection collection)

This creates a command that creates a new mapping involving the given domain's collection of input and output objects.


 

 

create

public static Command create(MappingDomain domain,
                             Object input,
                             Object output)

This creates a command that creates a new mapping between the given input and output.


 

 

create

public static Command create(MappingDomain domain,
                             Collection inputs,
                             Collection outputs)

This creates a command that creates a new mapping with the given collections of inputs and outputs.


 

 

create

public static Command create(MappingDomain domain,
                             Collection inputs,
                             Object output)

This creates a command that creates a new mapping with the given collection of inputs and output.


 

 

create

public static Command create(MappingDomain domain,
                             Object input,
                             Collection outputs)

This creates a command that creates a new mapping with the given input and collection of outputs.


 

 

prepare

protected boolean prepare()

Description copied from class: AbstractCommand
Called at most once in 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.

Overrides:
prepare in class AbstractCommand

Returns:
whether the command is executable.


 

 

execute

public void execute()

Description copied from interface: Command
Performs the command activity required for the effect. The effect of calling execute when canExecute returns false, or when canExecute hasn't been called, is undefined.


 

 

undo

public void undo()

Description copied from class: AbstractCommand
Throws a runtime exception.

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


 

 

redo

public void redo()

Description copied from interface: Command
Performs the command activity required to 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.


 

 

getResult

public Collection getResult()

Description copied from class: AbstractCommand
Returns an empty list.

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

Returns:
an empty list.


 

 

getAffectedObjects

public Collection getAffectedObjects()

Description copied from class: AbstractCommand
Returns an empty list.

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

Returns:
an empty list.


 

 

dispose

public void dispose()

Description copied from interface: Command
Called to indicate that the command will never be used again. Calling any other method after this one has undefined results.

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


 

 

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


 

 

toString

public 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.

Overrides:
toString in class AbstractCommand

Returns:
string representation.


 

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