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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
              extended by org.eclipse.gmt.umlx.mm.editor.regimes.E2AssociationRegime
All Implemented Interfaces:
ILinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>, ILinkRegimeEnums, IRegime, IRegimeCo0<E2Association,Orphanage>, IClassExtension

public class E2AssociationRegime
extends AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>


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 E2AssociationRegime INSTANCE
           
 
Constructor Summary
E2AssociationRegime(E2Direction direction)
           
 
Method Summary
 void addConnection(int sourceIndex, ILinkEnd newSourceEnd, E2Association link, ILinkEnd newTargetEnd, int targetIndex)
           
 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)
           
 CreateCommand createCreateCommand(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object context, ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 DeleteCommand createDeleteCommand(DeleteDomain deleteDomain, E2Association model)
           
 void createFacets(java.util.List<IFacet<? super E2Association>> facetList)
           
 E2AssociationLinkEnd createLinkEnd(java.lang.Object object)
          Create an object to describe the end of a link terminating at object.
 E2Association createModelObject(ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 AbstractOutline createOutline(OutlineViewer viewer, E2Association modelObject)
           
 AbstractPropertySource createPropertySource(E2Association 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).
 java.lang.String getLabel()
          Return a descriptive label for the managed object type
 E2Association 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.
 org.eclipse.emf.ecore.EReference getSource0(E2Association 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(E2Association 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, E2Association 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, cannotConnectBetween, createFigure, getActualConnection, getBendpoints, getCoCoModelsFor, getCoRegime, getPotentialCoConnection, getPotentialCoConnectionsBetween, getPotentialConnectionsBetween, 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 E2AssociationRegime INSTANCE
Constructor Detail

E2AssociationRegime

public E2AssociationRegime(E2Direction direction)
Method Detail

addConnection

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
cannotConnectFrom in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
cannotConnectTo in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
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 CreateCommand 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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
createCreateCommand in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>

createDeleteCommand

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

createFacets

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>

createModelObject

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

createPropertySource

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

createOutline

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
createReconnectCommand in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
getActualConnectionsBetween in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
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 E2Association 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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
getPotentialConnection in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Parameters:
source - source of required connection
target - target of required connection
Returns:
the connection or null.

getSource0

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

getSourceLinkEnd

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
getSourceNode in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Parameters:
model - to traverse
Returns:
the source node

getTarget0

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

getTargetLinkEnd

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
getTargetNode in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Parameters:
model - to traverse
Returns:
the target node

removeConnection

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

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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
sourceIsOptional in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
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,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Overrides:
targetIsOptional in class AbstractLinkRegimeCo0<org.eclipse.emf.ecore.EReference,E2Association,org.eclipse.emf.ecore.EReference,Orphanage>
Returns:
true if target need not be present in a valid model.