Package com.nomagic.magicdraw.plugins
Class Plugin
- java.lang.Object
-
- com.nomagic.magicdraw.plugins.Plugin
-
- Direct Known Subclasses:
BaseEmfUml2XmiPlugin
,MofPlugin
@OpenApiAll public abstract class Plugin extends java.lang.Object
The base abstract class for any MagicDraw plugin. Plugin must be extended from this class. Every plugin has it own descriptor.
MagicDraw calls method init() for plugin on startup.
MagicDraw will not exit if at least one plugin close() method returns false.
-
-
Field Summary
Fields Modifier and Type Field Description private PluginDescriptor
mDescriptor
This plugin descriptor.
-
Constructor Summary
Constructors Constructor Description Plugin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
close()
MagicDraw calls this method before exiting the application.PluginDescriptor
getDescriptor()
Returns plugin descriptor.abstract void
init()
Plugin initialization method.abstract boolean
isSupported()
MagicDraw calls this method to identify if this plugin is supported.(package private) void
setDescriptor(PluginDescriptor descriptor)
Sets plugin descriptor.
-
-
-
Field Detail
-
mDescriptor
private PluginDescriptor mDescriptor
This plugin descriptor. Descriptor is set during plugin loading by MagicDraw application and can not be changed on runtime.
-
-
Method Detail
-
getDescriptor
public PluginDescriptor getDescriptor()
Returns plugin descriptor.- Returns:
- plugin descriptor.
-
setDescriptor
void setDescriptor(PluginDescriptor descriptor)
Sets plugin descriptor.- Parameters:
descriptor
- the plugin descriptor.
-
init
public abstract void init()
Plugin initialization method. Every plugin must override this method and do any action related to plugin initialization. For example registers actions configurators to MagicDraw application. This method is called by MagicDraw application during MagicDraw startup.
-
close
public abstract boolean close()
MagicDraw calls this method before exiting the application. If at least one plugin returns 'false', MagicDraw application will not exit. Override this method and do any exit specific action(your plugin state saving and etc).- Returns:
- true, if plugin can be closed normally; false, if plugin cannot be closed and MagicDraw application can not exit.
-
isSupported
public abstract boolean isSupported()
MagicDraw calls this method to identify if this plugin is supported. Plugin is initialized and started only if this method returnstrue
. Override this method to check specific conditions for the plugin supportability.- Returns:
- true, if plugin is supported; false, if plugin is not supported.
-
-