org.eclipse.gmt.umlx.editor.facets
Class ModelState<M>
java.lang.Object
org.eclipse.gmt.umlx.editor.facets.ModelState<M>
- All Implemented Interfaces:
- IModelState
public class ModelState<M>
- extends java.lang.Object
- implements IModelState
Constructor Summary |
ModelState(IRegimeCo0<M,?> regime,
IActiveEditDomain editDomain,
M model)
|
ModelState(IRegimeCo0<M,?> regime,
IActiveEditDomain editDomain,
M oldModel,
M newModel,
java.lang.Object newParent)
|
ModelState(IRegimeCo0<M,?> regime,
M oldModel,
M newModel,
java.lang.Object newParent)
Construct a new command state for use in association with a regime to change
oldModel to newModel below newParent. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ModelState
public ModelState(IRegimeCo0<M,?> regime,
M oldModel,
M newModel,
java.lang.Object newParent)
- Construct a new command state for use in association with a regime to change
oldModel to newModel below newParent.
If oldModel is null, newModel and newParent define a creation context.
If newModel is null, oldModel define a deletion context.
If neither newModel or oldModel are null, they define a change/reconnection context.
When creating, additional neww context arguments may be applied to each
facet using the getFacet method to acquire the relevant state.
When executing, prepare() must be invoked once to complete the creation
context, typically acquiring missing new state from the newModel, or defaults.
Do is then performed by change(true), and Undo by change(false).
- Parameters:
regime
- oldModel
- newModel
- newParent
-
ModelState
public ModelState(IRegimeCo0<M,?> regime,
IActiveEditDomain editDomain,
M model)
ModelState
public ModelState(IRegimeCo0<M,?> regime,
IActiveEditDomain editDomain,
M oldModel,
M newModel,
java.lang.Object newParent)
addSelectedObjects
public void addSelectedObjects(java.util.Collection<java.lang.Object> selectedObjects,
boolean isDone)
- Specified by:
addSelectedObjects
in interface IModelState
change
public void change(boolean isForward)
- Specified by:
change
in interface IModelState
getEditDomain
public IActiveEditDomain getEditDomain()
- Specified by:
getEditDomain
in interface IModelState
getFacet
public <T extends IFacet<?>> T getFacet(java.lang.Class<? extends T> facetClass)
- Specified by:
getFacet
in interface IModelState
getNew
public java.lang.Object getNew(java.lang.String facetId)
- Specified by:
getNew
in interface IModelState
getNew
public <T> T getNew(java.lang.String facetId,
java.lang.Class<T> valueClass)
- Specified by:
getNew
in interface IModelState
getNewModel
public M getNewModel()
- Specified by:
getNewModel
in interface IModelState
getNewParent
public java.lang.Object getNewParent()
- Specified by:
getNewParent
in interface IModelState
getOld
public java.lang.Object getOld(java.lang.String facetId)
- Specified by:
getOld
in interface IModelState
getOld
public <T> T getOld(java.lang.String facetId,
java.lang.Class<T> valueClass)
- Specified by:
getOld
in interface IModelState
getOldModel
public M getOldModel()
getOldParent
public java.lang.Object getOldParent()
- Specified by:
getOldParent
in interface IModelState
getRegime
public IRegimeCo0<M,?> getRegime()
- Specified by:
getRegime
in interface IModelState
isPrepared
public boolean isPrepared()
- Specified by:
isPrepared
in interface IModelState
prepare
public void prepare()
- Specified by:
prepare
in interface IModelState
requestModifications
public void requestModifications(IAbstractCommand rootCommand)
- Specified by:
requestModifications
in interface IModelState
setNew
public void setNew(java.lang.String facetId,
java.lang.Object value)
- Specified by:
setNew
in interface IModelState
setOld
public void setOld(java.lang.String facetId,
java.lang.Object value)
- Specified by:
setOld
in interface IModelState
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object