136715153
MD2024x
3
Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
To edit some com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element, a session with the com.nomagic.magicdraw.openapi.uml.SessionManagermust be created.
All changes in the UML model will be registered and, on the session closing, will be added into the command history.
Code Block | ||
---|---|---|
| ||
Project project = ...; SessionManager.getInstance().createSession(project, "Edit class A"); if (classA.isEditable()) { classA.setName(newName); } SessionManager.getInstance().closeSession(project); |
It is the programmer responsibility to ensure that the modified element is not read-only by checking element editing permissions.