-
Notifications
You must be signed in to change notification settings - Fork 123
Modelio_context_service
Antonin Abhervé edited this page Sep 3, 2020
·
1 revision
Modelio v4.0
The Modelio context service can be used to get information about the Modelio application itself:
– the Modelio context service interface is IModelioContext
.
– the IModelioContext
instance can be obtained from the IModuleContext
of the module.
Available data is:
-
Modelio’s version
-
Modelio’s current language
-
Modelio’s current workspace path
The following code snippet lists the Modelio Application context available data.
1IModule myModule = MyModule.getInstance(); 2IModelioContext mCtx = myModule.getModuleContext().getModelioContext(); 3 4System.out.println("About Modelio:"); 5System.out.println(" version = " + mCtx.getVersion()); 6System.out.println(" language = " + mCtx.getLanguage()); 7System.out.println(" workspace = " + mCtx.getWorkspacePath()); 8
line 1: Get the unique instance of our module
line 2: Get the IModelioContext
instance from the module context
lines 5-7: Use the different accessors to retrieve the information about Modelio