org.eclipse.gmt.umlx.editor.regime
Class AbstractNodeRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,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<M,P>
          extended by org.eclipse.gmt.umlx.editor.regime.AbstractNodeRegimeCo0<M,P>
              extended by org.eclipse.gmt.umlx.editor.regime.AbstractNodeRegimeCo1<M,P,CM,CP>
All Implemented Interfaces:
INodeRegimeCo0<M,P>, INodeRegimeCo1<M,P,CM,CP>, IRegime, IRegimeCo0<M,P>, IRegimeCo1<M,P,CM,CP>, IClassExtension
Direct Known Subclasses:
AbstractNodeRegimeCo2, GModelElementRegime, GSheetRegime, UDomainRegime, UMappingInstanceRegime, UVariableRegime

public abstract class AbstractNodeRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
extends AbstractNodeRegimeCo0<M,P>
implements INodeRegimeCo1<M,P,CM,CP>


Method Summary
 IRegimeCo1<?,?,?,?> canCoChange(IActiveEditDomain editDomain, java.lang.Object coModel, java.lang.Object model)
           
 boolean coModelIsOptional()
          Returnb true if the coModel is optional (as is the case for a meta-model sheet).
 IAbstractCommand createChangeCoModelCommand(IActiveEditDomain editDomain, M 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.
 CM getCoModelFor(java.lang.Object coCoModel, java.lang.Object parent)
           
 java.lang.Class<CP> getCoModelParentClass()
          Return the co-model parent class if it has one.
abstract  INodeRegimeCo0<CM,CP> getCoRegime()
          Return the co-regime if it has one.
 java.lang.String getLabel()
          Return a descriptive label for the managed object type
abstract  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<?,M,?,P,CM,CP> isLink()
           
 INodeRegimeCo1<M,P,CM,CP> isNode()
           
 INodeRegimeCo1<M,P,CM,CP> isRegimeCo1()
          Return this non-null regime if it is suitable for use with one or more levels of co-model.
 INodeRegimeCo2<M,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(M model, java.lang.Object coModel)
           
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractNodeRegimeCo0
cannotCreate, createFigure
 
Methods inherited from class org.eclipse.gmt.umlx.editor.regime.AbstractRegime
canCopy, canDelete, computeProblemMessage, createCreateChildLinkCommand, createCreateCommand, createDeleteCommand, createFacets, createLinkEnd, createModelObject, createOutline, createPropertySource, createView, getBackElement, getBasicClass, getFacets, getModelClass, getNewNamePrefix, getParentModelClass, getSheetClass, getSource, getSourceModelClass, getTarget, getTargetModelClass, 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, getNewNamePrefix, getSheetClass, getSource, getSourceModelClass, getTarget, getTargetModelClass
 
Methods inherited from interface org.eclipse.gmt.umlx.utils.IClassExtension
getBasicClass, toDebugString, toUserString
 
Methods inherited from interface org.eclipse.gmt.umlx.editor.regime.INodeRegimeCo0
cannotCreate, createFigure
 
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, getNewNamePrefix, getSheetClass, getSource, getSourceModelClass, getTarget, getTargetModelClass
 
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 model)
Specified by:
canCoChange in interface IRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>

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<M extends org.eclipse.emf.common.notify.Notifier,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,
                                                   M model,
                                                   CM coModel)
Specified by:
createChangeCoModelCommand in interface IRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,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<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoModel in class AbstractRegime<M extends org.eclipse.emf.common.notify.Notifier,P>
Parameters:
model - model
Returns:
co-model or null

getCoModelFor

public final CM getCoModelFor(java.lang.Object coCoModel,
                              java.lang.Object parent)

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<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoModelClass in class AbstractRegime<M extends org.eclipse.emf.common.notify.Notifier,P>
Returns:
co-model class or null

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<M extends org.eclipse.emf.common.notify.Notifier,P>
Returns:
co-model parent 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<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Parameters:
coModel - required co-model
Returns:
actual co-model

getCoRegime

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

Specified by:
getCoRegime in interface INodeRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
getCoRegime in interface IRegime
Specified by:
getCoRegime in interface IRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Specified by:
getCoRegime in interface IRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
getCoRegime in class AbstractNodeRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Returns:
co-regime class or null

getLabel

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

Specified by:
getLabel in interface IRegime
Returns:
label

getParentCoModel

public abstract 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<M extends org.eclipse.emf.common.notify.Notifier,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<?,M,?,P,CM,CP> isLink()
Specified by:
isLink in interface IRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Specified by:
isLink in interface IRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Overrides:
isLink in class AbstractRegime<M extends org.eclipse.emf.common.notify.Notifier,P>

isNode

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

isRegimeCo1

public INodeRegimeCo1<M,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 INodeRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Specified by:
isRegimeCo1 in interface INodeRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
isRegimeCo1 in interface IRegime
Specified by:
isRegimeCo1 in interface IRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Overrides:
isRegimeCo1 in class AbstractNodeRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Returns:
this or null

isRegimeCo2

public INodeRegimeCo2<M,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 INodeRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Specified by:
isRegimeCo2 in interface INodeRegimeCo1<M extends org.eclipse.emf.common.notify.Notifier,P,CM extends org.eclipse.emf.common.notify.Notifier,CP>
Specified by:
isRegimeCo2 in interface IRegime
Specified by:
isRegimeCo2 in interface IRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Overrides:
isRegimeCo2 in class AbstractNodeRegimeCo0<M extends org.eclipse.emf.common.notify.Notifier,P>
Returns:
this or null

loadCoModelClass

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

setCoModel

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