Class EnvironmentOptions
- java.lang.Object
-
- com.nomagic.magicdraw.core.options.EnvironmentOptions
-
@OpenApi public class EnvironmentOptions extends java.lang.Object
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:
OptionsGroup
,AbstractPropertyOptionsGroup
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
EnvironmentOptions.EnvironmentChangeListener
Receives events when environment options change in the environment options dialog after "Ok" is pressed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEnvironmentChangeListener(EnvironmentOptions.EnvironmentChangeListener listener)
Adds environment change listener to environment options.void
addGroup(OptionsGroup group)
Adds an option group to the environment options.PathVariablesOptionsGroup
getPathVariablesOptions()
Get path variables options.void
removeEnvironmentChangeListener(EnvironmentOptions.EnvironmentChangeListener listener)
Removes environment change listener.
-
-
-
Method Detail
-
addGroup
@OpenApi public void addGroup(OptionsGroup group)
Adds an option group to the environment options.- Parameters:
group
- option group to add.
-
getPathVariablesOptions
@OpenApi public PathVariablesOptionsGroup 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.
-
-