public interface IModelingSession
The current modeling session can be accessed using the following API:
IModelingSession session = Modelio.getInstance().getModelingSession();
The IModelingSession
interface groups the following features:
Modifier and Type | Method and Description |
---|---|
void |
addModelHandler(IModelChangeHandler handler)
Add a model change listener.
|
void |
addModelListener(IModelChangeListener listener)
Add a model change handler.
|
void |
addStatusHandler(IStatusChangeHandler handler)
Add a status change listener.
|
void |
addStatusListener(IStatusChangeListener listener)
Add a status handler.
|
ITransaction |
createTransaction(String transactionName)
Create a new transaction in the project.
|
<T extends MObject> |
findByAtt(Class<T> metaclass,
String att,
String value)
Get an element in the model from its metaclass, a meta attribute name and
value .
If "element" is given, every model elements will be checked. |
Collection<? extends MObject> |
findByAtt(MClass metaclass,
String att,
String value)
Get an element in the model from its metaclass, a meta attribute name and
value .
If "element" is given, every model elements will be checked. |
<T extends MObject> |
findByClass(Class<T> metaclass)
Get all elements in the model from their metaclass.
|
Collection<? extends MObject> |
findByClass(MClass metaclass)
Get all elements in the model from their metaclass.
|
<T extends MObject> |
findElementById(Class<T> metaclass,
String id)
Get an element in the model from its id and metaclass.
|
MObject |
findElementById(MClass metaclass,
String id)
Get an element in the model from its id and metaclass.
|
IMetamodelExtensions |
getMetamodelExtensions()
Returns the metamodel extension of the project.
|
IUmlModel |
getModel()
Returns the UML Model of the project.
|
String |
getName()
Get the name of this session.
|
IAnalystModel |
getRequirementModel()
Returns the Requirement Model of the project.
|
void |
removeModelHandler(IModelChangeHandler handler)
Remove a model change handler.
|
void |
removeModelListener(IModelChangeListener listener)
Remove a model change listener.
|
void |
removeStatusHandler(IStatusChangeHandler handler)
Remove a status change handler.
|
void |
removeStatusListener(IStatusChangeListener listener)
Remove a status change listener.
|
void addModelHandler(IModelChangeHandler handler)
Handlers can modify the model.
This model listener is used to be notified of the model structural
changes, through the use of the IModelChangeHandler
listener
class.
handler
- the model change listener to add.void addModelListener(IModelChangeListener listener)
Added listeners must not modify the model. If model modifications should be done use addModelHandler() method.
This model listener is used to be notified of the model structural
changes, through the use of the IModelChangeListener
listener
class.
listener
- the model change listener to add.void addStatusHandler(IStatusChangeHandler handler)
Handlers can modify the model.
This model listener is used to be notified of the model status changes
(read/write), through the use of the IStatusChangeHandler
listener class.
handler
- the model change listener to add.void addStatusListener(IStatusChangeListener listener)
Added listeners must not modify the model. If model modifications should be done use addModelHandler() method.
This model listener is used to be notified of all the model status
changes (read/write), through the use of the
IStatusChangeListener
listener class.
listener
- the model change listener to add.ITransaction createTransaction(String transactionName)
All the model updates have to be carried out in the context of a
transaction, which has to be created, through the use of this method, and
Committed via the #commit(ITransaction)
method or rollbacked
using the #rollback(ITransaction)
method.
transactionName
- A transaction name. This name is just a label that might be
displayed in log files, a console or dialog boxes.<T extends MObject> Collection<T> findByAtt(Class<T> metaclass, String att, String value)
metaclass
- the metaclass to look for.att
- the name of the meta attribute to check the value in.value
- the value to look for in the attribute.Collection<? extends MObject> findByAtt(MClass metaclass, String att, String value)
metaclass
- the metaclass to look for.att
- the name of the meta attribute to check the value in.value
- the value to look for in the attribute.<T extends MObject> Collection<T> findByClass(Class<T> metaclass)
metaclass
- the metaclass to look for.Collection<? extends MObject> findByClass(MClass metaclass)
metaclass
- the metaclass to look for.<T extends MObject> T findElementById(Class<T> metaclass, String id)
metaclass
- the metaclass to look for.id
- the id to look for.MObject findElementById(MClass metaclass, String id)
id
- metaclass
- the metaclass to look for.IMetamodelExtensions getMetamodelExtensions()
The metamodel extensions are added by the tool when modules are deployed. It corresponds to the stereotypes, note types and tag types brought by modules.
IUmlModel getModel()
This method is often used to get the root package using the
IUmlModel#getRoot()
method
String getName()
IAnalystModel getRequirementModel()
The requirement model owns three model roots: the requirement container, the dictionary and the requirement administration models.
void removeModelHandler(IModelChangeHandler handler)
handler
- the model change handler to remove.void removeModelListener(IModelChangeListener listener)
listener
- the model change listener to remove.void removeStatusHandler(IStatusChangeHandler handler)
handler
- the status change handler to remove.void removeStatusListener(IStatusChangeListener listener)
listener
- the status change listener to remove.