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 |
addStatusListener(IStatusChangeListener listener)
Add a status handler.
|
ITransaction |
createTransaction(java.lang.String transactionName)
Create a new transaction in the project.
|
<T extends MObject> |
findByAtt(java.lang.Class<T> metaclass,
java.lang.String att,
java.lang.String value)
Get elements in the model from a metaclass, a meta attribute name and its value.
|
java.util.Collection<? extends MObject> |
findByAtt(MClass metaclass,
java.lang.String att,
java.lang.String value)
Get elements in the model from a metaclass, a meta attribute name and its value.
|
<T extends MObject> |
findByClass(java.lang.Class<T> metaclass)
Get all elements in the model from their metaclass.
|
java.util.Collection<? extends MObject> |
findByClass(MClass metaclass)
Get all elements in the model from their metaclass.
|
MObject |
findByRef(MRef ref)
Get an element in the model from an
MRef . |
<T extends MObject> |
findElementById(java.lang.Class<T> metaclass,
java.lang.String id)
Get an element in the model from its id and metaclass.
|
MObject |
findElementById(MClass metaclass,
java.lang.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.
|
java.lang.String |
getName()
Get the name of this session.
|
void |
getRequirementModel()
Deprecated.
replace with
IModelioServices#getService(IAnalystModel.class) instead to get a proper way to manipulate Requirement model |
void |
removeModelHandler(IModelChangeHandler handler)
Remove a model change handler.
|
void |
removeModelListener(IModelChangeListener listener)
Remove a model change listener.
|
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 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(java.lang.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 ITransaction.commit()
method or rollbacked using the ITransaction.rollback()
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> java.util.Collection<T> findByAtt(java.lang.Class<T> metaclass, java.lang.String att, java.lang.String value)
If Element
is given, every elements in the model will be checked.
metaclass
- the java interface of 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.null
.java.util.Collection<? extends MObject> findByAtt(MClass metaclass, java.lang.String att, java.lang.String value)
If Element
is given, every elements in the model will be checked.
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.null
.<T extends MObject> java.util.Collection<T> findByClass(java.lang.Class<T> metaclass)
metaclass
- the java interface of the metaclass to look for.java.util.Collection<? extends MObject> findByClass(MClass metaclass)
metaclass
- the metaclass to look for.<T extends MObject> T findElementById(java.lang.Class<T> metaclass, java.lang.String id)
metaclass
- the java interface of the metaclass to look for.id
- the id to look for.MObject findElementById(MClass metaclass, java.lang.String id)
metaclass
- the metaclass to look for.id
- the element's id.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 roots using the IUmlModel.getModelRoots()
method
java.lang.String getName()
@Deprecated void getRequirementModel()
IModelioServices#getService(IAnalystModel.class)
instead to get a proper way to manipulate Requirement modelvoid removeModelHandler(IModelChangeHandler handler)
handler
- the model change handler to remove.void removeModelListener(IModelChangeListener listener)
listener
- the model change listener to remove.void removeStatusListener(IStatusChangeListener listener)
listener
- the status change listener to remove.