org.eclipse.gmt.umlx.editor.regime
Class AbstractLinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,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>
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:
AbstractLinkRegimeCo2, GReferenceRegime, GSheetLinkRegimeCo1, TxReferenceRegime, URelationshipRegime

public abstract class AbstractLinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
extends AbstractLinkRegimeCo0<SM,LM,TM,P>
implements ILinkRegimeCo1<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
 IRegimeCo1<?,?,?,?> canCoChange(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object context)
           
 IErrorMessage cannotCoCreate(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object context)
          Return the reason why an instanceof coModel cannot be created, or null if it can.
 boolean coModelIsOptional()
          Returnb true if the coModel is optional (as is the case for a meta-model sheet).
 IAbstractCommand createChangeCoModelCommand(IActiveEditDomain editDomain, LM model, CM coModel)
           
abstract  CM getCoModel(java.lang.Object model)
          Return the co-model of model if it has one.
 java.lang.Class<CM> getCoModelClass()
          Return the co-model class if it has one.
 java.lang.Object getCoModelFor(java.lang.Object coModel)
          Return the co-Model to be instantiated when coModel is being instantited.
 java.lang.Class<CP> getCoModelParentClass()
          Return the co-model parent class if it has one.
abstract  ILinkRegimeCo0<?,CM,?,CP> getCoRegime()
          Return the co-regime if it has one.
abstract  java.lang.Object 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.
 java.lang.Object getParentCoModel(IActiveEditDomain editDomain, java.lang.Object parent)
          Return the object to be coModel of the parent of a model created by this regime in editDomain.
 ILinkRegimeCo1<SM,LM,TM,P,CM,CP> isLink()
           
 INodeRegimeCo1<LM,P,CM,CP> isNode()
           
 ILinkRegimeCo1<SM,LM,TM,P,CM,CP> 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,CM,CP> isRegimeCo2()
          Return this non-null regime if it is suitable for use with two or more levels of co-model.
 boolean loadCoModelClass()
           
abstract  void setCoModel(LM model, java.lang.Object coModel)
           
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo0
addConnection, canBeReversed, cannotConnectBetween, cannotConnectFrom, cannotConnectTo, createCreateCommand, createFacets, createFigure, createLinkEnd, createModelObject, createReconnectCommand, getActualConnection, getActualConnectionsBetween, getBendpoints, getCoCoModelsFor, getPotentialCoConnection, getPotentialCoConnectionsBetween, getPotentialConnection, getPotentialConnectionsBetween, getSource, getSource0, getSourceConnections, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, getTarget0, getTargetConnections, getTargetLinkEnd, getTargetModelClass, getTargetNode, isContainment, removeConnection, resolveRegime, sourceIsOptional, targetIsOptional
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractRegime
canCopy, canDelete, computeProblemMessage, createCreateChildLinkCommand, createCreateCommand, createDeleteCommand, createModelObject, createOutline, createPropertySource, createView, getBackElement, getBasicClass, getFacets, getModelClass, getNewNamePrefix, getParentModelClass, getSheetClass, 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, createPropertySource, createView, getFacets, getModelClass, getParentModelClass, isRegimeCo0, refreshProblemMessage
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, createLinkEnd, getBackElement, getIcon, getLabel, getNewNamePrefix, getSheetClass
 
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, cannotConnectBetween, cannotConnectFrom, cannotConnectTo, createCreateCommand, createFigure, createModelObject, createReconnectCommand, getActualConnection, getActualConnectionsBetween, getBendpoints, getCoCoModelsFor, getPotentialCoConnection, getPotentialConnection, getPotentialConnectionsBetween, getSource, getSource0, getSourceConnections, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, getTarget0, getTargetConnections, getTargetLinkEnd, getTargetModelClass, getTargetNode, isContainment, removeConnection, resolveRegime, sourceIsOptional, targetIsOptional
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegimeCo0
canCopy, canDelete, computeProblemMessage, createDeleteCommand, createModelObject, createOutline, createPropertySource, createView, getFacets, getModelClass, getParentModelClass, isRegimeCo0, refreshProblemMessage
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.IRegime
createCreateChildLinkCommand, createCreateCommand, createLinkEnd, getBackElement, getIcon, getLabel, getNewNamePrefix, getSheetClass
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 

Method Detail

canCoChange

public IRegimeCo1<?,?,?,?> canCoChange(IActiveEditDomain editDomain,
                                       java.lang.Object coModel,
                                       java.lang.Object context)
Specified by:
canCoChange in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>

cannotCoCreate

public IErrorMessage cannotCoCreate(IActiveEditDomain editDomain,
                                    java.lang.Object coModel,
                                    java.lang.Object context)
Description copied from interface: ILinkRegimeCo1
Return the reason why an instanceof coModel cannot be created, or null if it can.

Specified by:
cannotCoCreate in interface ILinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Parameters:
editDomain - domain in which to create
coModel - coModel to instantiate
context - context of instantiation
Returns:
non-null reason for creation failure

coModelIsOptional

public boolean coModelIsOptional()
Description copied from interface: IRegimeCo1
Returnb true if the coModel is optional (as is the case for a meta-model sheet).

Specified by:
coModelIsOptional in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Returns:
if a null co-model is not an error

createChangeCoModelCommand

public IAbstractCommand createChangeCoModelCommand(IActiveEditDomain editDomain,
                                                   LM model,
                                                   CM coModel)
Specified by:
createChangeCoModelCommand in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>

getCoModel

public abstract CM getCoModel(java.lang.Object model)
Description copied from interface: IRegime
Return the co-model of model if it has one.

Specified by:
getCoModel in interface IRegime
Specified by:
getCoModel in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoModel in class AbstractRegime<LM extends org.eclipse.emf.ecore.EModelElement,P>
Parameters:
model - model
Returns:
co-model or null

getCoModelClass

public java.lang.Class<CM> getCoModelClass()
Description copied from interface: IRegime
Return the co-model class if it has one.

Specified by:
getCoModelClass in interface IRegime
Specified by:
getCoModelClass in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoModelClass in class AbstractRegime<LM extends org.eclipse.emf.ecore.EModelElement,P>
Returns:
co-model class or null

getCoModelFor

public java.lang.Object getCoModelFor(java.lang.Object coModel)
Description copied from interface: IRegimeCo1
Return the co-Model to be instantiated when coModel is being instantited. Normally returns coModel, but derivations such as GREgime may map from an EReference to an E2Association.

Specified by:
getCoModelFor in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Parameters:
coModel - required co-model
Returns:
actual co-model

getCoModelParentClass

public java.lang.Class<CP> getCoModelParentClass()
Description copied from interface: IRegime
Return the co-model parent class if it has one.

Specified by:
getCoModelParentClass in interface IRegime
Overrides:
getCoModelParentClass in class AbstractRegime<LM extends org.eclipse.emf.ecore.EModelElement,P>
Returns:
co-model parent class or null

getCoRegime

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

Specified by:
getCoRegime in interface ILinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Specified by:
getCoRegime in interface ILinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
getCoRegime in interface IRegime
Specified by:
getCoRegime in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Specified by:
getCoRegime in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoRegime in class AbstractLinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Returns:
co-regime class or null

getParentCoModel

public abstract java.lang.Object 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 org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Parameters:
editDomain - domain in which to create
source - connection source
parent - parent of instantiation
target - connection target
Returns:
the parent co-model

getParentCoModel

public java.lang.Object getParentCoModel(IActiveEditDomain editDomain,
                                         java.lang.Object parent)
Description copied from interface: IRegimeCo1
Return the object to be coModel of the parent of a model created by this regime in editDomain. 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 IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Parameters:
editDomain - edit domain containing objects
parent - parent of graphical model
Returns:
co-model of parent

isLink

public ILinkRegimeCo1<SM,LM,TM,P,CM,CP> isLink()
Specified by:
isLink in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Specified by:
isLink in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
isLink in class AbstractLinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>

isNode

public INodeRegimeCo1<LM,P,CM,CP> isNode()
Specified by:
isNode in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Specified by:
isNode in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
isNode in class AbstractRegime<LM extends org.eclipse.emf.ecore.EModelElement,P>

isRegimeCo1

public ILinkRegimeCo1<SM,LM,TM,P,CM,CP> 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 ILinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Specified by:
isRegimeCo1 in interface ILinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
isRegimeCo1 in interface IRegime
Specified by:
isRegimeCo1 in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Overrides:
isRegimeCo1 in class AbstractLinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Returns:
this or null

isRegimeCo2

public ILinkRegimeCo2<SM,LM,TM,P,CM,CP> 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 ILinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Specified by:
isRegimeCo2 in interface ILinkRegimeCo1<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
isRegimeCo2 in interface IRegime
Specified by:
isRegimeCo2 in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Overrides:
isRegimeCo2 in class AbstractLinkRegimeCo0<SM extends org.eclipse.emf.ecore.EObject,LM extends org.eclipse.emf.ecore.EModelElement,TM extends org.eclipse.emf.ecore.EObject,P>
Returns:
this or null

loadCoModelClass

public boolean loadCoModelClass()
Specified by:
loadCoModelClass in interface IRegimeCo1<LM extends org.eclipse.emf.ecore.EModelElement,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>

setCoModel

public abstract void setCoModel(LM model,
                                java.lang.Object coModel)
Specified by:
setCoModel in interface IRegimeCo0<LM extends org.eclipse.emf.ecore.EModelElement,P>
Overrides:
setCoModel in class AbstractRegime<LM extends org.eclipse.emf.ecore.EModelElement,P>