org.eclipse.gmt.umlx.editor.regime
Interface ILinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM,TM extends org.eclipse.emf.ecore.EObject,P>

All Superinterfaces:
IClassExtension, ILinkRegimeEnums, IRegime, IRegimeCo0<LM,P>
All Known Subinterfaces:
ILinkRegimeCo1<SM,LM,TM,P,CM,CP>, ILinkRegimeCo2<SM,LM,TM,P,CM,CP>
All Known Implementing Classes:
AbstractAutoELinkRegime, AbstractAutoGLinkRegime, AbstractLinkRegimeCo0, AbstractLinkRegimeCo1, AbstractLinkRegimeCo2, AbstractTransientContainmentLinksCo0Regime, AbstractTransientLinkCo0Regime, AbstractTransientReferenceLinkCo0Regime, AbstractTransientReferenceLinksCo0Regime, E2AssociationRegime, E2AttributionRegime, E2DirectedAssociationRegime, E2InheritanceRegime, E2SheetLinkRegime, EReferenceRegime, GAssociationRegime, GAttributionRegime, GInheritanceRegime, GReferenceRegime, GSheetLinkRegimeCo0, GSheetLinkRegimeCo1, GSheetLinkRegimeCo2, GSheetTransientLinkRegimeCo1, GStickyLinkRegime, MmSheetLinkRegime, TxAttributeVariable2TxExpressionVariableRegime, TxBindingRegime, TxClassVariable2TxAttributeVariableRegime, TxClassVariable2TxClassVariableRegime, TxContextSheetLinkRegime, TxDomain2TxTypedModelRegime, TxMapping2TxDomainRegime, TxReferenceRegime, TxRuleSheetLinkRegime, TxTransformation2TxTransformationRegime, TxTransformation2TxTypedModelRegime, TxTypedModel2TxTypedModelRegime, TxTypedModel2TxUsedPackageRegime, TxUsedDomain2TxVariableRegime, UAttributeVariable2UExpressionVariableRegime, UBindingRegime, UClassVariable2UAttributeVariableRegime, UClassVariable2UClassVariableRegime, UContextSheetLinkRegime, UDomain2UTypedModelRegime, UDomain2UVariableRegime, UMapping2UDomainRegime, URelationshipRegime, URuleSheetLinkRegime, UTransformation2UTransformationRegime, UTransformation2UTypedModelRegime, UTypedModel2EPackageRegime, UTypedModel2UTypedModelRegime

public interface ILinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM,TM extends org.eclipse.emf.ecore.EObject,P>
extends IRegimeCo0<LM,P>, ILinkRegimeEnums


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gmt.umlx.editor.regime.ILinkRegimeEnums
ILinkRegimeEnums.IsCreate, ILinkRegimeEnums.IsReconnect, ILinkRegimeEnums.IsReCreate
 
Method Summary
 void addConnection(int sourceIndex, ILinkEnd source, LM link, ILinkEnd target, int targetIndex)
           
 boolean canBeReversed()
          Return true if the link may be drawn backwards.
 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 cannotConnectTo(java.lang.Object target, ILinkRegimeEnums.IsCreate isCreate)
          Return a reason why a connection cannot finish at target or null if it can.
 IModelStateCommand createCreateCommand(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object context, ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 LinkFigure createFigure(ILinkViewElement view)
          Create the figure object to be drawn in the sheet editor.
 LM createModelObject(ILinkEnd sourceLinkEnd, ILinkEnd targetLinkEnd)
           
 ReconnectCommand createReconnectCommand(java.lang.Object newSource, java.lang.Object link, java.lang.Object newTarget)
           
 LM getActualConnection(SM source, TM target)
          Return a connection between source and target if present in the model.
 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.util.List<org.eclipse.draw2d.Bendpoint> getBendpoints(java.lang.Object model)
           
 java.util.List<?> getCoCoModelsFor(java.lang.Object coSource, java.lang.Object coTarget)
           
 ILinkRegimeCo0<?,?,?,?> getCoRegime()
          Return the co-regime if it has one.
 LM getPotentialCoConnection(SM source, TM target)
          Return the co-model of a connection between source and target that could be present in the model.
 LM getPotentialConnection(SM source, TM 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.
 SM getSource(java.lang.Object model)
          Return the source node of model if it is a link.
 SM getSource0(LM model)
           
 java.util.List<? super LM> getSourceConnections(java.lang.Object source)
          Deprecated. 
 ILinkEnd getSourceLinkEnd(java.lang.Object model)
           
 java.lang.Class<SM> getSourceModelClass()
          Return the class of source nodes if appropriate
 org.eclipse.emf.ecore.EObject getSourceNode(java.lang.Object model)
          Return the node at the source of this link.
 TM getTarget(java.lang.Object model)
          Return the target node of model if it is a link.
 TM getTarget0(LM model)
           
 java.util.List<? super LM> getTargetConnections(java.lang.Object target)
          Deprecated. 
 ILinkEnd getTargetLinkEnd(java.lang.Object model)
           
 java.lang.Class<TM> getTargetModelClass()
          Return the class of target nodes if appropriate
 org.eclipse.emf.ecore.EObject getTargetNode(java.lang.Object model)
          Return the node at the target of this link.
 boolean isContainment()
          Return true if the source contains the target.
 ILinkRegimeCo1<SM,LM,TM,P,?,?> isRegimeCo1()
          Return this non-null regime if it is suitable for use with one or more levels of co-model.
 ILinkRegimeCo2<SM,LM,TM,P,?,?> isRegimeCo2()
          Return this non-null regime if it is suitable for use with two or more levels of co-model.
 java.lang.Integer[] removeConnection(SM source, LM link, TM target)
           
 ILinkRegimeCo0<?,?,?,?> resolveRegime(java.lang.Object source, java.lang.Object target)
          Return a regime appropriate to source and 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 interface org.eclipse.gmt.umlx.editor.regime.IRegimeCo0
canCopy, canDelete, computeProblemMessage, createDeleteCommand, createModelObject, createOutline, createPropertySource, createView, getFacets, getModelClass, getParentModelClass, isLink, isNode, isRegimeCo0, refreshProblemMessage, setCoModel
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, createLinkEnd, getBackElement, getCoModel, getCoModelClass, getCoModelParentClass, getIcon, getLabel, getNewNamePrefix, getSheetClass
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 

Method Detail

addConnection

void addConnection(int sourceIndex,
                   ILinkEnd source,
                   LM link,
                   ILinkEnd target,
                   int targetIndex)

canBeReversed

boolean canBeReversed()
Return true if the link may be drawn backwards.

Returns:
true if reversable

cannotConnectBetween

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.

Parameters:
source - source of required connection
target - target of required connection
isCreate - IS_CREATE if check for creation rather than use
candidates - list to receive candidate connections
Returns:
non-null reason for connection failure

cannotConnectFrom

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

Parameters:
source - source of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

cannotConnectTo

IErrorMessage cannotConnectTo(java.lang.Object target,
                              ILinkRegimeEnums.IsCreate isCreate)
Return a reason why a connection cannot finish at target or null if it can.

Parameters:
target - target of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

createCreateCommand

IModelStateCommand createCreateCommand(IActiveEditDomain editDomain,
                                       java.lang.Object coModel,
                                       java.lang.Object context,
                                       ILinkEnd sourceLinkEnd,
                                       ILinkEnd targetLinkEnd)

createFigure

LinkFigure createFigure(ILinkViewElement view)
Create the figure object to be drawn in the sheet editor.

Returns:
a figure

createModelObject

LM createModelObject(ILinkEnd sourceLinkEnd,
                     ILinkEnd targetLinkEnd)

createReconnectCommand

ReconnectCommand createReconnectCommand(java.lang.Object newSource,
                                        java.lang.Object link,
                                        java.lang.Object newTarget)

getBendpoints

java.util.List<org.eclipse.draw2d.Bendpoint> getBendpoints(java.lang.Object model)

getCoCoModelsFor

java.util.List<?> getCoCoModelsFor(java.lang.Object coSource,
                                   java.lang.Object coTarget)

getCoRegime

ILinkRegimeCo0<?,?,?,?> getCoRegime()
Description copied from interface: IRegime
Return the co-regime if it has one.

Specified by:
getCoRegime in interface IRegime
Specified by:
getCoRegime in interface IRegimeCo0<LM,P>
Returns:
co-regime class or null

getActualConnection

LM getActualConnection(SM source,
                       TM target)
Return a connection between source and target if present in the model. Any required transient link is created. In the case of duplicates an arbitrary choice is made.

Parameters:
source - source of required connection
target - target of required connection
Returns:
the connection or null.

getActualConnectionsBetween

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.

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.

getPotentialCoConnection

LM getPotentialCoConnection(SM source,
                            TM target)
Return the co-model of a 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.

Parameters:
source - source of required connection
target - target of required connection
Returns:
the connection or null.

getPotentialConnection

LM getPotentialConnection(SM source,
                          TM target)
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.

Parameters:
source - source of required connection
target - target of required connection
Returns:
the connection or null.

getPotentialConnectionsBetween

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. If connections already exist they alone are returned. Potential connections are only returned when no current connections exist.

Parameters:
sourceLinkEnd - source of required connection
targetLinkEnd - target of required connection
candidates - list to which current and possible connections are added

getSource

SM getSource(java.lang.Object model)
Description copied from interface: IRegime
Return the source node of model if it is a link.

Specified by:
getSource in interface IRegime
Parameters:
model - model
Returns:
this or null

getSource0

SM getSource0(LM model)

getSourceConnections

@Deprecated
java.util.List<? super LM> getSourceConnections(java.lang.Object source)
Deprecated. 


getSourceLinkEnd

ILinkEnd getSourceLinkEnd(java.lang.Object model)

getSourceModelClass

java.lang.Class<SM> getSourceModelClass()
Description copied from interface: IRegime
Return the class of source nodes if appropriate

Specified by:
getSourceModelClass in interface IRegime
Returns:
source node class or null

getSourceNode

org.eclipse.emf.ecore.EObject getSourceNode(java.lang.Object model)
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.

Parameters:
model - to traverse
Returns:
the source node

getTarget

TM getTarget(java.lang.Object model)
Description copied from interface: IRegime
Return the target node of model if it is a link.

Specified by:
getTarget in interface IRegime
Parameters:
model - model
Returns:
this or null

getTarget0

TM getTarget0(LM model)

getTargetConnections

@Deprecated
java.util.List<? super LM> getTargetConnections(java.lang.Object target)
Deprecated. 


getTargetLinkEnd

ILinkEnd getTargetLinkEnd(java.lang.Object model)

getTargetModelClass

java.lang.Class<TM> getTargetModelClass()
Description copied from interface: IRegime
Return the class of target nodes if appropriate

Specified by:
getTargetModelClass in interface IRegime
Returns:
target node class or null

getTargetNode

org.eclipse.emf.ecore.EObject getTargetNode(java.lang.Object model)
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.

Parameters:
model - to traverse
Returns:
the target node

isContainment

boolean isContainment()
Return true if the source contains the target.

Returns:
if a containment relationship.

isRegimeCo1

ILinkRegimeCo1<SM,LM,TM,P,?,?> isRegimeCo1()
Description copied from interface: IRegime
Return this non-null regime if it is suitable for use with one or more levels of co-model.

Specified by:
isRegimeCo1 in interface IRegime
Specified by:
isRegimeCo1 in interface IRegimeCo0<LM,P>
Returns:
this or null

isRegimeCo2

ILinkRegimeCo2<SM,LM,TM,P,?,?> isRegimeCo2()
Description copied from interface: IRegime
Return this non-null regime if it is suitable for use with two or more levels of co-model.

Specified by:
isRegimeCo2 in interface IRegime
Specified by:
isRegimeCo2 in interface IRegimeCo0<LM,P>
Returns:
this or null

removeConnection

java.lang.Integer[] removeConnection(SM source,
                                     LM link,
                                     TM target)

resolveRegime

ILinkRegimeCo0<?,?,?,?> resolveRegime(java.lang.Object source,
                                      java.lang.Object target)
Return a regime appropriate to source and target. This allows a generic smart regime to be invoked initially that redirects in a context-specific fashion.


sourceIsOptional

boolean sourceIsOptional()
Return true if source need not be present in a valid model.

Returns:
true if source need not be present in a valid model.

targetIsOptional

boolean targetIsOptional()
Return true if target need not be present in a valid model.

Returns:
true if target need not be present in a valid model.