Class EnvironmentOptions
java.lang.Object
com.nomagic.magicdraw.core.options.EnvironmentOptions
Represents application environment options.
Application-related options are referred to as environment options.
They are saved in the global.opt
file that is located in <USER_HOME_DIR>/.magicdraw/<VERSION_NUMBER>/data
.
You can add custom environment options for MagicDraw.
To add your own environment options
- 1. Extend the AbstractPropertyOptionsGroup class.
- 2. Add the extending class to application environment options.
Example: Adding custom environment options
class MyOptionsGroup extends AbstractPropertyOptionsGroup { ... } Application application = Application.getInstance(); EnvironmentOptions options = application.getEnvironmentOptions(); options.addGroup(new ExampleOptionsGroup());
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Receives events when environment options change in the environment options dialog after "Ok" is pressed. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds environment change listener to environment options.void
addGroup
(OptionsGroup group) Adds an option group to the environment options.Get path variables options.void
Removes environment change listener.
-
Method Details
-
addGroup
Adds an option group to the environment options.- Parameters:
group
- option group to add.
-
getPathVariablesOptions
Get path variables options.- Returns:
- path variables options group.
-
addEnvironmentChangeListener
@OpenApi public void addEnvironmentChangeListener(EnvironmentOptions.EnvironmentChangeListener listener) Adds environment change listener to environment options. Make sure to have a strong reference to the listener in the client code, because listeners are managed through weak references to avoid memory leaks.- Parameters:
listener
- listener to add.
-
removeEnvironmentChangeListener
@OpenApi public void removeEnvironmentChangeListener(EnvironmentOptions.EnvironmentChangeListener listener) Removes environment change listener.- Parameters:
listener
- listener to remove.
-