Package com.nomagic.magicdraw.emfuml2xmi
Class BaseEmfUml2XmiPlugin
- java.lang.Object
-
- com.nomagic.magicdraw.plugins.Plugin
-
- com.nomagic.magicdraw.emfuml2xmi.BaseEmfUml2XmiPlugin
-
- Direct Known Subclasses:
EmfUml2XmiPlugin
,EmfUml2XmiPlugin
,EmfUml2XmiPlugin
,EmfUml2XmiPlugin
@OpenApi public abstract class BaseEmfUml2XmiPlugin extends Plugin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
com.nomagic.magicdraw.emfuml2xmi.BaseEmfUml2XmiPlugin.EclipseUml2XmiFileLoader
private class
com.nomagic.magicdraw.emfuml2xmi.BaseEmfUml2XmiPlugin.ImportRunnable
private static class
com.nomagic.magicdraw.emfuml2xmi.BaseEmfUml2XmiPlugin.MenuConfigurator
Menu configurator, increases priority according the version.
-
Field Summary
Fields Modifier and Type Field Description private static java.util.List<java.lang.String>
ALL_KNOWN_UML_URIS
private java.lang.String
mExtension
private java.lang.String
mExternalToolExportXmiActionId
private java.lang.String
mFormat
private java.lang.String
mOptionsDir
private java.lang.String
mOptionsGroupId
private java.lang.String
mResourceJarRelativePath
private java.lang.String
mResourcesJarPath
private java.util.List<com.nomagic.xml.Namespace>
mSupportedUmlNamespaces
private java.util.Set<java.lang.String>
mSupportedUmlUris
private int
mVersion
Plugin version used to sort menu actions according plugin versionprivate static java.lang.String
OPTIONS_DIR_PATH
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseEmfUml2XmiPlugin(int version, java.lang.String format, java.lang.String optionsGroupId, java.lang.String extension, java.util.List<com.nomagic.xml.Namespace> supportedUmlNamespaces, java.lang.String resourceJarRelativePath, java.lang.String externalToolExportXmiActionId)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
addMainMenuConfigurator(java.lang.String categoryId, java.lang.String eclipseUml2CategoryId, MDAction action)
boolean
close()
MagicDraw calls this method before exiting the application.protected abstract com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2Cleaner
createCleaner()
protected abstract com.nomagic.magicdraw.emfuml2xmi.export.commandline.BaseEclipseUml2CommandLineExporterAction
createCommandLineExporterAction()
private com.nomagic.magicdraw.emfuml2xmi.export.ExportEmfUml2XmiAction
createExportAction()
private com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2Exporter
createExporter()
protected abstract com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2Exporter
createExporter(java.lang.String format, java.lang.String optionsGroupID)
private MDAction
createImportAction()
protected abstract com.nomagic.magicdraw.emfuml2xmi.imp0rt.BaseEmfUml2Importer
createImporter(java.lang.String format, java.lang.String optionsGroupID)
protected abstract BaseEmfOptionsGroup
createOptionsGroup(java.lang.String id, java.lang.String format)
private static Project
createProject(java.lang.String projectName, boolean newThread)
private static Project
createUniqueProject(java.lang.String absolutePath, java.lang.String extension, boolean newThread)
void
disposeModel(java.util.Collection elements)
Disposes given elements.java.util.Map
exportModel(Project project)
Exports given project to Eclipse UML2 Modelvoid
exportXMI(Project project, java.lang.String destinationDir)
Exports given project to Eclipse UML2 XMIvoid
exportXMI(Project project, java.lang.String destinationDir, ProgressStatus progressStatus)
Exports given project to Eclipse UML2 XMIprivate void
exportXMI(Project project, java.lang.String destinationDir, ProgressStatus progress, com.nomagic.magicdraw.emfuml2xmi.export.OverwriteChecker overwriteChecker)
private static ProgressStatus
getEmptyProgress()
java.lang.String
getFileExtension()
private static java.io.File
getFileFromSource(java.io.File pluginDirectory, java.lang.String resourceJarRelativePath)
java.lang.String
getFormat()
Returns Eclipse UML2 XMI format supported by plugin.java.lang.String
getOptionsDir()
java.lang.String
getOptionsGroupID()
Returns plugin'e environment options group id.private static java.io.File
getResourceJar(java.io.File pluginDirectory, java.lang.String resourceJarName)
Get resource jar.java.lang.String
getResourcesJarPath()
private static com.nomagic.magicdraw.emfuml2xmi.export.OverwriteChecker
getSilentOverwrite()
java.util.Set<java.lang.String>
getSupportedUmlUris()
private Project
imp0rt(Project project, java.io.File file, ProgressStatus progress)
private Project
imp0rt(java.io.File file)
void
imp0rt(java.lang.String file)
Imports (opens) given Eclipse UML2 XMIvoid
init()
Plugin initialization method.private static boolean
isImportSupported()
boolean
isSupported()
MagicDraw calls this method to identify if this plugin is supported.-
Methods inherited from class com.nomagic.magicdraw.plugins.Plugin
getDescriptor
-
-
-
-
Field Detail
-
OPTIONS_DIR_PATH
private static final java.lang.String OPTIONS_DIR_PATH
- See Also:
- Constant Field Values
-
ALL_KNOWN_UML_URIS
private static final java.util.List<java.lang.String> ALL_KNOWN_UML_URIS
-
mVersion
private final int mVersion
Plugin version used to sort menu actions according plugin version
-
mFormat
private final java.lang.String mFormat
-
mOptionsGroupId
private final java.lang.String mOptionsGroupId
-
mExtension
private final java.lang.String mExtension
-
mSupportedUmlNamespaces
private final java.util.List<com.nomagic.xml.Namespace> mSupportedUmlNamespaces
-
mSupportedUmlUris
private final java.util.Set<java.lang.String> mSupportedUmlUris
-
mResourceJarRelativePath
private final java.lang.String mResourceJarRelativePath
-
mExternalToolExportXmiActionId
private final java.lang.String mExternalToolExportXmiActionId
-
mOptionsDir
private java.lang.String mOptionsDir
-
mResourcesJarPath
private java.lang.String mResourcesJarPath
-
-
Constructor Detail
-
BaseEmfUml2XmiPlugin
protected BaseEmfUml2XmiPlugin(int version, java.lang.String format, java.lang.String optionsGroupId, java.lang.String extension, java.util.List<com.nomagic.xml.Namespace> supportedUmlNamespaces, java.lang.String resourceJarRelativePath, java.lang.String externalToolExportXmiActionId)
-
-
Method Detail
-
init
public void init()
Description copied from class:Plugin
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.
-
getFormat
public final java.lang.String getFormat()
Returns Eclipse UML2 XMI format supported by plugin.- Returns:
- Eclipse UML2 XMI format.
-
getFileExtension
public final java.lang.String getFileExtension()
-
getOptionsGroupID
public final java.lang.String getOptionsGroupID()
Returns plugin'e environment options group id.- Returns:
- options group id.
-
createExporter
protected abstract com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2Exporter createExporter(java.lang.String format, java.lang.String optionsGroupID)
-
createImporter
protected abstract com.nomagic.magicdraw.emfuml2xmi.imp0rt.BaseEmfUml2Importer createImporter(java.lang.String format, java.lang.String optionsGroupID)
-
createCleaner
protected abstract com.nomagic.magicdraw.emfuml2xmi.helpers.BaseEmfUml2Cleaner createCleaner()
-
createOptionsGroup
protected abstract BaseEmfOptionsGroup createOptionsGroup(java.lang.String id, java.lang.String format)
-
createCommandLineExporterAction
protected abstract com.nomagic.magicdraw.emfuml2xmi.export.commandline.BaseEclipseUml2CommandLineExporterAction createCommandLineExporterAction()
-
exportXMI
@OpenApi public void exportXMI(Project project, java.lang.String destinationDir) throws java.lang.Exception
Exports given project to Eclipse UML2 XMI- Parameters:
project
- project to exportdestinationDir
- destination directory- Throws:
java.lang.Exception
-
exportXMI
@OpenApi public void exportXMI(Project project, java.lang.String destinationDir, ProgressStatus progressStatus) throws java.lang.Exception
Exports given project to Eclipse UML2 XMI- Parameters:
project
- project to exportdestinationDir
- destination directoryprogressStatus
- export progress status- Throws:
java.lang.Exception
-
exportModel
@OpenApi public java.util.Map exportModel(Project project) throws java.lang.Exception
Exports given project to Eclipse UML2 Model- Parameters:
project
- project to export- Returns:
- map of exported model (MagicDraw model (or profile) -> Eclipse UML2 model (or profile))
- Throws:
java.lang.Exception
-
disposeModel
@OpenApi public void disposeModel(java.util.Collection elements)
Disposes given elements.- Parameters:
elements
- collection of Eclipse UML2 element.
-
exportXMI
private void exportXMI(Project project, java.lang.String destinationDir, ProgressStatus progress, com.nomagic.magicdraw.emfuml2xmi.export.OverwriteChecker overwriteChecker) throws java.lang.Exception
- Throws:
java.lang.Exception
-
imp0rt
@OpenApi public void imp0rt(java.lang.String file)
Imports (opens) given Eclipse UML2 XMI- Parameters:
file
- Eclipse UML2 XMI file path
-
addMainMenuConfigurator
private void addMainMenuConfigurator(java.lang.String categoryId, java.lang.String eclipseUml2CategoryId, MDAction action)
-
getResourceJar
private static java.io.File getResourceJar(java.io.File pluginDirectory, java.lang.String resourceJarName)
Get resource jar.- Parameters:
pluginDirectory
- plugin directory.resourceJarName
- resource jar name.- Returns:
- resource jar file.
-
getFileFromSource
private static java.io.File getFileFromSource(java.io.File pluginDirectory, java.lang.String resourceJarRelativePath)
-
getEmptyProgress
private static ProgressStatus getEmptyProgress()
-
getSilentOverwrite
private static com.nomagic.magicdraw.emfuml2xmi.export.OverwriteChecker getSilentOverwrite()
-
imp0rt
private Project imp0rt(Project project, java.io.File file, ProgressStatus progress)
-
createExportAction
private com.nomagic.magicdraw.emfuml2xmi.export.ExportEmfUml2XmiAction createExportAction()
-
createImportAction
private MDAction createImportAction()
-
close
public boolean close()
Description copied from class:Plugin
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).
-
isSupported
public boolean isSupported()
Description copied from class:Plugin
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.- Specified by:
isSupported
in classPlugin
- Returns:
- true, if plugin is supported; false, if plugin is not supported.
-
createUniqueProject
private static Project createUniqueProject(java.lang.String absolutePath, java.lang.String extension, boolean newThread)
-
createProject
private static Project createProject(java.lang.String projectName, boolean newThread)
-
isImportSupported
private static boolean isImportSupported()
-
getResourcesJarPath
public final java.lang.String getResourcesJarPath()
-
getOptionsDir
public final java.lang.String getOptionsDir()
-
getSupportedUmlUris
public final java.util.Set<java.lang.String> getSupportedUmlUris()
-
createExporter
private com.nomagic.magicdraw.emfuml2xmi.export.BaseEmfUml2Exporter createExporter()
-
imp0rt
@CheckForNull private Project imp0rt(java.io.File file)
-
-