org.eclipse.gmt.umlx.tx.editor.regimes
Class TxReferenceRegime
java.lang.Object
org.eclipse.gmt.umlx.utils.ClassExtension<M>
org.eclipse.gmt.umlx.editor.regime.AbstractRegime<LM,P>
org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo0<SM,LM,TM,P>
org.eclipse.gmt.umlx.editor.regime.AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
org.eclipse.gmt.umlx.tx.editor.regimes.TxReferenceRegime
- All Implemented Interfaces:
- ILinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>, ILinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>, ILinkRegimeEnums, IRegime, IRegimeCo0<TxReference,TxRuleSheet>, IRegimeCo1<TxReference,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>, IClassExtension
public class TxReferenceRegime
- extends AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
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. |
TxReference |
createModelObject()
Create a new and uninitialised EMF object of the type managed by this regime. |
AbstractPropertySource |
createPropertySource(TxReference model)
|
AssociationView |
createView(SheetViewer viewer,
TxReference model)
|
org.eclipse.emf.ecore.EReference |
getCoModel(java.lang.Object model)
Return the co-model of model if it has one. |
java.lang.Object |
getCoModelFor(java.lang.Object coModel)
Return the co-Model to be instantiated when coModel is being instantited. |
EReferenceRegime |
getCoRegime()
Return the co-regime if it has one. |
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 |
org.eclipse.emf.ecore.EClass |
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.Class<? extends TxRuleSheet> |
getSheetClass()
Return the class of the sheet that this regime supports |
TxClassVariable |
getSource0(TxReference model)
|
TxClassVariable |
getTarget0(TxReference model)
|
void |
setCoModel(TxReference 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, getSourceConnections, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, 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, createOutline, getBackElement, getBasicClass, getFacets, getModelClass, getNewNamePrefix, getParentModelClass, initialise, isRegimeCo0, load, refreshProblemMessage, toString |
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.ILinkRegimeCo0 |
addConnection, canBeReversed, cannotConnectBetween, cannotConnectFrom, cannotConnectTo, createCreateCommand, createFigure, createModelObject, createReconnectCommand, getActualConnection, getActualConnectionsBetween, getBendpoints, getCoCoModelsFor, getPotentialCoConnection, getPotentialConnection, getPotentialConnectionsBetween, getSource, getSourceConnections, getSourceLinkEnd, getSourceModelClass, getSourceNode, getTarget, getTargetConnections, getTargetLinkEnd, getTargetModelClass, getTargetNode, isContainment, removeConnection, resolveRegime, sourceIsOptional, targetIsOptional |
INSTANCE
public static final TxReferenceRegime INSTANCE
canCoChange
public IRegimeCo1<?,?,?,?> canCoChange(IActiveEditDomain editDomain,
java.lang.Object coModel,
java.lang.Object context)
- Specified by:
canCoChange
in interface IRegimeCo1<TxReference,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Overrides:
canCoChange
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
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<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Overrides:
cannotCoCreate
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Parameters:
editDomain
- domain in which to createcoModel
- coModel to instantiatecontext
- context of instantiation
- Returns:
- non-null reason for creation failure
createModelObject
public TxReference createModelObject()
- Description copied from interface:
IRegime
- Create a new and uninitialised EMF object of the type managed by this regime.
- Specified by:
createModelObject
in interface IRegime
- Specified by:
createModelObject
in interface IRegimeCo0<TxReference,TxRuleSheet>
- Overrides:
createModelObject
in class AbstractRegime<TxReference,TxRuleSheet>
createPropertySource
public AbstractPropertySource createPropertySource(TxReference model)
- Specified by:
createPropertySource
in interface IRegimeCo0<TxReference,TxRuleSheet>
- Overrides:
createPropertySource
in class AbstractRegime<TxReference,TxRuleSheet>
createView
public AssociationView createView(SheetViewer viewer,
TxReference model)
- Specified by:
createView
in interface IRegimeCo0<TxReference,TxRuleSheet>
- Overrides:
createView
in class AbstractRegime<TxReference,TxRuleSheet>
getCoModel
public org.eclipse.emf.ecore.EReference 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<TxReference,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Specified by:
getCoModel
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Parameters:
model
- model
- Returns:
- co-model 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<TxReference,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Overrides:
getCoModelFor
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Parameters:
coModel
- required co-model
- Returns:
- actual co-model
getCoRegime
public EReferenceRegime getCoRegime()
- Description copied from interface:
IRegime
- Return the co-regime if it has one.
- Specified by:
getCoRegime
in interface ILinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>
- Specified by:
getCoRegime
in interface ILinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Specified by:
getCoRegime
in interface IRegime
- Specified by:
getCoRegime
in interface IRegimeCo0<TxReference,TxRuleSheet>
- Specified by:
getCoRegime
in interface IRegimeCo1<TxReference,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Specified by:
getCoRegime
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Returns:
- co-regime class or null
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 org.eclipse.emf.ecore.EClass 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<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Specified by:
getParentCoModel
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>
- Parameters:
editDomain
- domain in which to createsource
- connection sourceparent
- parent of instantiationtarget
- connection target
- Returns:
- the parent co-model
getSheetClass
public java.lang.Class<? extends TxRuleSheet> getSheetClass()
- Description copied from interface:
IRegime
- Return the class of the sheet that this regime supports
- Specified by:
getSheetClass
in interface IRegime
- Overrides:
getSheetClass
in class AbstractRegime<TxReference,TxRuleSheet>
- Returns:
- sheet class or null.
getSource0
public TxClassVariable getSource0(TxReference model)
- Specified by:
getSource0
in interface ILinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>
- Specified by:
getSource0
in class AbstractLinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>
getTarget0
public TxClassVariable getTarget0(TxReference model)
- Specified by:
getTarget0
in interface ILinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>
- Specified by:
getTarget0
in class AbstractLinkRegimeCo0<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet>
setCoModel
public void setCoModel(TxReference model,
java.lang.Object coModel)
- Specified by:
setCoModel
in interface IRegimeCo0<TxReference,TxRuleSheet>
- Specified by:
setCoModel
in class AbstractLinkRegimeCo1<TxClassVariable,TxReference,TxClassVariable,TxRuleSheet,org.eclipse.emf.ecore.EReference,org.eclipse.emf.ecore.EClass>