org.eclipse.gmt.umlx.mm.editor.regimes
Class E2DirectedAssociationRegime

java.lang.Object
  extended by org.eclipse.gmt.umlx.utils.ClassExtension<M>
      extended by org.eclipse.gmt.umlx.editor.regime.AbstractRegime<LM,P>
          extended by org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
              extended by org.eclipse.gmt.umlx.mm.editor.regimes.E2DirectedAssociationRegime
All Implemented Interfaces:
ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>, ILinkRegimeEnums, IRegime, IRegimeCo0<E2DirectedAssociation,E2Association>, IClassExtension

public class E2DirectedAssociationRegime
extends AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gmt.umlx.editor.regime.ILinkRegimeEnums
ILinkRegimeEnums.IsCreate, ILinkRegimeEnums.IsReconnect, ILinkRegimeEnums.IsReCreate
 
Field Summary
static E2DirectedAssociationRegime INSTANCE
           
 
Method Summary
 void addConnection(int sourceIndex, ILinkEnd sourceEnd, E2DirectedAssociation link, ILinkEnd targetEnd, int targetIndex)
           
 IErrorMessage cannotConnectBetween(java.lang.Object source, java.lang.Object target, ILinkRegimeEnums.IsReCreate isReCreate, CandidateLinks candidates)
          Return a reason why a connection cannot be made from source to target, or null if it can, and add the possible instantiations to candidates.
 IErrorMessage cannotConnectFrom(java.lang.Object source, ILinkRegimeEnums.IsCreate isCreate)
          Return a reason why a connection cannot start from source or null if it can.
 IErrorMessage cannotConnectFrom0(org.eclipse.emf.ecore.EReference source, org.eclipse.emf.ecore.EReference target, ILinkRegimeEnums.IsCreate isCreate)
           
 IErrorMessage cannotConnectTo(java.lang.Object target, ILinkRegimeEnums.IsCreate isCreate)
          Return a reason why a connection cannot finish at target or null if it can.
 IErrorMessage cannotConnectTo0(org.eclipse.emf.ecore.EReference source, org.eclipse.emf.ecore.EReference target, ILinkRegimeEnums.IsCreate isCreate)
           
 IModelStateCommand createCreateCommand(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object context, ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 DeleteCommand createDeleteCommand(DeleteDomain deleteDomain, E2DirectedAssociation model)
           
 void createFacets(java.util.List<IFacet<? super E2DirectedAssociation>> facetList)
           
 E2AssociationLinkEnd createLinkEnd(java.lang.Object object)
          Create an object to describe the end of a link terminating at object.
 E2DirectedAssociation createModelObject(ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 AbstractOutline createOutline(OutlineViewer viewer, E2DirectedAssociation modelObject)
           
 AbstractPropertySource createPropertySource(E2DirectedAssociation coModel)
           
 ReconnectCommand createReconnectCommand(java.lang.Object newSource, java.lang.Object link, java.lang.Object newTarget)
           
 IErrorMessage getActualConnectionsBetween(ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd, CandidateLinks candidates)
          Compute a list of the connections that currently exist between source and target or return an error message if connections are not possible.
 java.lang.Enum getIcon()
          Return the icon to be shown in the construction context (the Palette for GCore objects, the Outline for ECore objects).
static E2DirectedAssociationRegime getInstance(boolean oppositeShown)
           
 java.lang.String getLabel()
          Return a descriptive label for the managed object type
 E2DirectedAssociation getPotentialConnection(org.eclipse.emf.ecore.EReference source, org.eclipse.emf.ecore.EReference target)
          Return the connection between source and target that could be present in the model.
 void getPotentialConnectionsBetween(ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd, CandidateLinks candidates)
          Compute a list of the co-models of the connections between source and target that are or could be present in the model.
 org.eclipse.emf.ecore.EReference getSource0(E2DirectedAssociation model)
           
 org.eclipse.emf.ecore.EClass getSourceClass(java.lang.Object model)
           
 ILinkEnd getSourceLinkEnd(java.lang.Object model)
           
 org.eclipse.emf.ecore.EObject getSourceNode(java.lang.Object model)
          Return the node at the source of this link.
 org.eclipse.emf.ecore.EReference getTarget0(E2DirectedAssociation model)
           
 org.eclipse.emf.ecore.EClass getTargetClass(java.lang.Object model)
           
 ILinkEnd getTargetLinkEnd(java.lang.Object model)
           
 org.eclipse.emf.ecore.EObject getTargetNode(java.lang.Object model)
          Return the node at the target of this link.
 java.lang.Integer[] removeConnection(org.eclipse.emf.ecore.EReference source, E2DirectedAssociation link, org.eclipse.emf.ecore.EReference target)
           
 boolean sourceIsOptional()
          Return true if source need not be present in a valid model.
 boolean targetIsOptional()
          Return true if target need not be present in a valid model.
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo0
canBeReversed, createFigure, getActualConnection, getBendpoints, getCoCoModelsFor, getCoRegime, getPotentialCoConnection, getPotentialCoConnectionsBetween, getSource, getSourceConnections, getSourceModelClass, getTarget, getTargetConnections, getTargetModelClass, isContainment, isLink, isRegimeCo1, isRegimeCo2, resolveRegime
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractRegime
canCopy, canDelete, computeProblemMessage, createCreateChildLinkCommand, createCreateCommand, createModelObject, createView, getBackElement, getBasicClass, getCoModel, getCoModelClass, getCoModelParentClass, getFacets, getModelClass, getNewNamePrefix, getParentModelClass, getSheetClass, initialise, isNode, isRegimeCo0, load, refreshProblemMessage, setCoModel, toString
 
Methods inherited from class org.eclipse.gmt.umlx.utils.ClassExtension
toDebugString, toUserString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegimeCo0
canCopy, canDelete, computeProblemMessage, createModelObject, createView, getFacets, getModelClass, getParentModelClass, isNode, isRegimeCo0, refreshProblemMessage, setCoModel
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, getBackElement, getCoModel, getCoModelClass, getCoModelParentClass, getNewNamePrefix, getSheetClass
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 

Field Detail

INSTANCE

public static final E2DirectedAssociationRegime INSTANCE
Method Detail

getInstance

public static E2DirectedAssociationRegime getInstance(boolean oppositeShown)

addConnection

public void addConnection(int sourceIndex,
                          ILinkEnd sourceEnd,
                          E2DirectedAssociation link,
                          ILinkEnd targetEnd,
                          int targetIndex)
Specified by:
addConnection in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
addConnection in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

cannotConnectBetween

public final IErrorMessage cannotConnectBetween(java.lang.Object source,
                                                java.lang.Object target,
                                                ILinkRegimeEnums.IsReCreate isReCreate,
                                                CandidateLinks candidates)
Description copied from interface: ILinkRegimeCo0
Return a reason why a connection cannot be made from source to target, or null if it can, and add the possible instantiations to candidates.

Specified by:
cannotConnectBetween in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
cannotConnectBetween in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
source - source of required connection
target - target of required connection
candidates - list to receive candidate connections
Returns:
non-null reason for connection failure

cannotConnectFrom

public IErrorMessage cannotConnectFrom(java.lang.Object source,
                                       ILinkRegimeEnums.IsCreate isCreate)
Description copied from interface: ILinkRegimeCo0
Return a reason why a connection cannot start from source or null if it can.

Specified by:
cannotConnectFrom in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
cannotConnectFrom in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
source - source of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

cannotConnectFrom0

public IErrorMessage cannotConnectFrom0(org.eclipse.emf.ecore.EReference source,
                                        org.eclipse.emf.ecore.EReference target,
                                        ILinkRegimeEnums.IsCreate isCreate)

cannotConnectTo

public IErrorMessage cannotConnectTo(java.lang.Object target,
                                     ILinkRegimeEnums.IsCreate isCreate)
Description copied from interface: ILinkRegimeCo0
Return a reason why a connection cannot finish at target or null if it can.

Specified by:
cannotConnectTo in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
cannotConnectTo in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
target - target of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

cannotConnectTo0

public IErrorMessage cannotConnectTo0(org.eclipse.emf.ecore.EReference source,
                                      org.eclipse.emf.ecore.EReference target,
                                      ILinkRegimeEnums.IsCreate isCreate)

createCreateCommand

public IModelStateCommand createCreateCommand(IActiveEditDomain editDomain,
                                              java.lang.Object coModel,
                                              java.lang.Object context,
                                              ILinkEnd sourceLinkEnd,
                                              ILinkEnd targetLinkEnd)
Specified by:
createCreateCommand in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
createCreateCommand in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

createDeleteCommand

public DeleteCommand createDeleteCommand(DeleteDomain deleteDomain,
                                         E2DirectedAssociation model)
Specified by:
createDeleteCommand in interface IRegimeCo0<E2DirectedAssociation,E2Association>
Overrides:
createDeleteCommand in class AbstractRegime<E2DirectedAssociation,E2Association>

createFacets

public void createFacets(java.util.List<IFacet<? super E2DirectedAssociation>> facetList)
Overrides:
createFacets in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

createLinkEnd

public E2AssociationLinkEnd createLinkEnd(java.lang.Object object)
Description copied from interface: IRegime
Create an object to describe the end of a link terminating at object.

Specified by:
createLinkEnd in interface IRegime
Overrides:
createLinkEnd in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

createModelObject

public E2DirectedAssociation createModelObject(ILinkEnd sourceLinkEnd,
                                               ILinkEnd targetLinkEnd)
Specified by:
createModelObject in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
createModelObject in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

createOutline

public AbstractOutline createOutline(OutlineViewer viewer,
                                     E2DirectedAssociation modelObject)
Specified by:
createOutline in interface IRegimeCo0<E2DirectedAssociation,E2Association>
Overrides:
createOutline in class AbstractRegime<E2DirectedAssociation,E2Association>

createPropertySource

public AbstractPropertySource createPropertySource(E2DirectedAssociation coModel)
Specified by:
createPropertySource in interface IRegimeCo0<E2DirectedAssociation,E2Association>
Overrides:
createPropertySource in class AbstractRegime<E2DirectedAssociation,E2Association>

createReconnectCommand

public ReconnectCommand createReconnectCommand(java.lang.Object newSource,
                                               java.lang.Object link,
                                               java.lang.Object newTarget)
Specified by:
createReconnectCommand in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
createReconnectCommand in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

getActualConnectionsBetween

public IErrorMessage getActualConnectionsBetween(ILinkEnd sourceLinkEnd,
                                                 ILinkEnd targetLinkEnd,
                                                 CandidateLinks candidates)
Description copied from interface: ILinkRegimeCo0
Compute a list of the connections that currently exist between source and target or return an error message if connections are not possible.

Specified by:
getActualConnectionsBetween in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getActualConnectionsBetween in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
sourceLinkEnd - source of required connection
targetLinkEnd - target of required connection
candidates - list to which current connections are added
Returns:
a non-null error message if arguments illegal.

getIcon

public java.lang.Enum getIcon()
Description copied from interface: IRegime
Return the icon to be shown in the construction context (the Palette for GCore objects, the Outline for ECore objects).

Returns:
the icon

getLabel

public java.lang.String getLabel()
Description copied from interface: IRegime
Return a descriptive label for the managed object type

Returns:
label

getPotentialConnection

public E2DirectedAssociation getPotentialConnection(org.eclipse.emf.ecore.EReference source,
                                                    org.eclipse.emf.ecore.EReference target)
Description copied from interface: ILinkRegimeCo0
Return the connection between source and target that could be present in the model. Any required transient link is created. In the case of duplicates an arbitrary choice is made.

Specified by:
getPotentialConnection in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getPotentialConnection in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
source - source of required connection
target - target of required connection
Returns:
the connection or null.

getPotentialConnectionsBetween

public void getPotentialConnectionsBetween(ILinkEnd sourceLinkEnd,
                                           ILinkEnd targetLinkEnd,
                                           CandidateLinks candidates)
Description copied from interface: ILinkRegimeCo0
Compute a list of the co-models of the connections between source and target that are or could be present in the model. If connections already exist they alone are returned. Potential connections are only returned when no current connections exist.

Specified by:
getPotentialConnectionsBetween in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getPotentialConnectionsBetween in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
sourceLinkEnd - source of required connection
targetLinkEnd - target of required connection
candidates - list to which current and possible connections are added

getSource0

public org.eclipse.emf.ecore.EReference getSource0(E2DirectedAssociation model)
Specified by:
getSource0 in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Specified by:
getSource0 in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

getSourceClass

public org.eclipse.emf.ecore.EClass getSourceClass(java.lang.Object model)

getSourceLinkEnd

public ILinkEnd getSourceLinkEnd(java.lang.Object model)
Specified by:
getSourceLinkEnd in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getSourceLinkEnd in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

getSourceNode

public org.eclipse.emf.ecore.EObject getSourceNode(java.lang.Object model)
Description copied from interface: ILinkRegimeCo0
Return the node at the source of this link. This is normally the same as getSource() except for links of links such as E2Association for which this traverses to the node ratryher than the property.

Specified by:
getSourceNode in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getSourceNode in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
model - to traverse
Returns:
the source node

getTarget0

public org.eclipse.emf.ecore.EReference getTarget0(E2DirectedAssociation model)
Specified by:
getTarget0 in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Specified by:
getTarget0 in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

getTargetClass

public org.eclipse.emf.ecore.EClass getTargetClass(java.lang.Object model)

getTargetLinkEnd

public ILinkEnd getTargetLinkEnd(java.lang.Object model)
Specified by:
getTargetLinkEnd in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getTargetLinkEnd in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

getTargetNode

public org.eclipse.emf.ecore.EObject getTargetNode(java.lang.Object model)
Description copied from interface: ILinkRegimeCo0
Return the node at the target of this link. This is normally the same as getTarget() except for links of links such as E2Association for which this traverses to the node ratryher than the property.

Specified by:
getTargetNode in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
getTargetNode in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Parameters:
model - to traverse
Returns:
the target node

removeConnection

public java.lang.Integer[] removeConnection(org.eclipse.emf.ecore.EReference source,
                                            E2DirectedAssociation link,
                                            org.eclipse.emf.ecore.EReference target)
Specified by:
removeConnection in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
removeConnection in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>

sourceIsOptional

public boolean sourceIsOptional()
Description copied from interface: ILinkRegimeCo0
Return true if source need not be present in a valid model.

Specified by:
sourceIsOptional in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
sourceIsOptional in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Returns:
true if source need not be present in a valid model.

targetIsOptional

public boolean targetIsOptional()
Description copied from interface: ILinkRegimeCo0
Return true if target need not be present in a valid model.

Specified by:
targetIsOptional in interface ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Overrides:
targetIsOptional in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2DirectedAssociation,org.eclipse.emf.ecore.EReference,E2Association>
Returns:
true if target need not be present in a valid model.