org.eclipse.gmt.umlx.editor.regimes
Class AbstractAutoGLinkRegime<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet,CM extends org.eclipse.emf.ecore.EModelElement,CP>

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<SM,LM,TM,P>
              extended by org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo1<SM,LM,TM,P,CM,CP>
                  extended by org.eclipse.gmt.umlx.editor.regimes.GSheetLinkRegimeCo1<SM,LM,TM,P,CM,CP>
                      extended by org.eclipse.gmt.umlx.editor.regimes.AbstractAutoGLinkRegime<SM,LM,TM,P,CM,CP>
All Implemented Interfaces:
ILinkRegimeCo0<SM,LM,TM,P>, ILinkRegimeCo1<SM,LM,TM,P,CM,CP>, ILinkRegimeEnums, IRegime, IRegimeCo0<LM,P>, IRegimeCo1<LM,P,CM,CP>, IClassExtension
Direct Known Subclasses:
MmSheetLinkRegime, TxContextSheetLinkRegime, TxRuleSheetLinkRegime

public abstract class AbstractAutoGLinkRegime<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet,CM extends org.eclipse.emf.ecore.EModelElement,CP>
extends GSheetLinkRegimeCo1<SM,LM,TM,P,CM,CP>


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.gmt.umlx.editor.regime.ILinkRegimeEnums
ILinkRegimeEnums.IsCreate, ILinkRegimeEnums.IsReconnect, ILinkRegimeEnums.IsReCreate
 
Method Summary
 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.
 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
 URelation getParentCoModel(IActiveEditDomain editDomain, GModelElement source, java.lang.Object parent, GModelElement target)
          Return the object to be coModel of the parent of a model created by this regime in editDomain between coSource and coTarget.
 ILinkRegimeCo0<?,?,?,?> resolveRegime(java.lang.Object source, java.lang.Object target)
          Return a regime appropriate to source and target.
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regimes.GSheetLinkRegimeCo1
cannotCoCreate, createFacets, createPropertySource, getBendpoints, getCoModel, getSheetClass, getSource0, getSourceConnections, getTarget0, getTargetConnections, removeConnection, setCoModel
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo1
canCoChange, coModelIsOptional, createChangeCoModelCommand, getCoModelClass, getCoModelFor, getCoModelParentClass, getCoRegime, getParentCoModel, isLink, isNode, isRegimeCo1, isRegimeCo2, loadCoModelClass
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo0
addConnection, canBeReversed, createCreateCommand, createFigure, createLinkEnd, createModelObject, createReconnectCommand, getActualConnection, getActualConnectionsBetween, getCoCoModelsFor, getPotentialCoConnection, getPotentialCoConnectionsBetween, getPotentialConnection, getPotentialConnectionsBetween, getSource, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, getTargetLinkEnd, getTargetModelClass, getTargetNode, isContainment, sourceIsOptional, targetIsOptional
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractRegime
canCopy, canDelete, computeProblemMessage, createCreateChildLinkCommand, createCreateCommand, createDeleteCommand, createModelObject, createOutline, createView, getBackElement, getBasicClass, getFacets, getModelClass, getNewNamePrefix, getParentModelClass, initialise, isRegimeCo0, load, refreshProblemMessage, 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, createDeleteCommand, createModelObject, createOutline, createView, getFacets, getModelClass, getParentModelClass, isRegimeCo0, refreshProblemMessage
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, createLinkEnd, getBackElement, getNewNamePrefix
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.ILinkRegimeCo0
addConnection, canBeReversed, createCreateCommand, createFigure, createModelObject, createReconnectCommand, getActualConnection, getActualConnectionsBetween, getCoCoModelsFor, getPotentialCoConnection, getPotentialConnection, getPotentialConnectionsBetween, getSource, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, getTargetLinkEnd, getTargetModelClass, getTargetNode, isContainment, sourceIsOptional, targetIsOptional
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegimeCo0
canCopy, canDelete, computeProblemMessage, createDeleteCommand, createModelObject, createOutline, createView, getFacets, getModelClass, getParentModelClass, isRegimeCo0, refreshProblemMessage
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, createLinkEnd, getBackElement, getNewNamePrefix
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 

Method Detail

cannotConnectBetween

public 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<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Overrides:
cannotConnectBetween in class AbstractLinkRegimeCo0<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
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<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Overrides:
cannotConnectFrom in class AbstractLinkRegimeCo0<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Parameters:
source - source of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

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<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Overrides:
cannotConnectTo in class AbstractLinkRegimeCo0<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Parameters:
target - target of required connection
isCreate - true if check for creation rather than use
Returns:
non-null reason for connection failure

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

getParentCoModel

public URelation getParentCoModel(IActiveEditDomain editDomain,
                                  GModelElement source,
                                  java.lang.Object parent,
                                  GModelElement target)
Description copied from interface: ILinkRegimeCo1
Return the object to be coModel of the parent of a model created by this regime in editDomain between coSource and coTarget. The return is nominally just parent.coModel() after type validation, but derived implementations may add policies to provide defaults parents for orphans.

Specified by:
getParentCoModel in interface ILinkRegimeCo1<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet,CM extends org.eclipse.emf.ecore.EModelElement,CP>
Specified by:
getParentCoModel in class AbstractLinkRegimeCo1<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet,CM extends org.eclipse.emf.ecore.EModelElement,CP>
Parameters:
editDomain - domain in which to create
source - connection source
parent - parent of instantiation
target - connection target
Returns:
the parent co-model

resolveRegime

public ILinkRegimeCo0<?,?,?,?> resolveRegime(java.lang.Object source,
                                             java.lang.Object target)
Description copied from interface: ILinkRegimeCo0
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.

Specified by:
resolveRegime in interface ILinkRegimeCo0<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>
Overrides:
resolveRegime in class AbstractLinkRegimeCo0<SM extends GSheetNode,LM extends GSheetLink,TM extends GSheetNode,P extends GSheet>