Class MofPlugin


  • @OpenApi
    public class MofPlugin
    extends Plugin
    Plugin provides MOF (EMOF and CMOF) export/import functionality.
    • Constructor Summary

      Constructors 
      Constructor Description
      MofPlugin()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addExportActions​(NMAction parent)
      Configures export actions.
      boolean close()
      MagicDraw calls this method before exiting the application.
      static void exportMof​(Project project, java.util.Set<Package> packages, MofType mof, java.io.File mofFile, boolean runValidation, boolean silent, ProgressStatus progressStatus)
      Exports given project to MOF XMI.
      static void exportMof​(Project project, java.util.Set<Package> packages, MofType mof, java.io.File mofFile, boolean runValidation, ProgressStatus progressStatus)
      Exports given project to MOF XMI.
      private static java.lang.String getMofXmiFileString()  
      static void importMof​(java.io.File mofFile, MofDescriptor mof, java.io.File umlFile, ProgressStatus progressStatus, boolean removeTemp)
      Imports given MOF to new project.
      void init()
      Init MagicDraw export/import actions
      boolean isSupported()
      MagicDraw calls this method to identify if this plugin is supported.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mInstance

        private static MofPlugin mInstance
      • mExportWholeAction

        private com.nomagic.magicdraw.mof.export.MofExportAction mExportWholeAction
      • mExportSelectedAction

        private com.nomagic.magicdraw.mof.export.MofExportAction mExportSelectedAction
    • Constructor Detail

      • MofPlugin

        public MofPlugin()
    • Method Detail

      • init

        public void init()
        Init MagicDraw export/import actions
        Specified by:
        init in class Plugin
      • addExportActions

        private void addExportActions​(NMAction parent)
        Configures export actions.
      • 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).
        Specified by:
        close in class Plugin
        Returns:
        true, if plugin can be closed normally; false, if plugin cannot be closed and MagicDraw application can not exit.
      • 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 returns true. Override this method to check specific conditions for the plugin supportability.
        Specified by:
        isSupported in class Plugin
        Returns:
        true, if plugin is supported; false, if plugin is not supported.
      • exportMof

        @OpenApi
        public static void exportMof​(Project project,
                                     java.util.Set<Package> packages,
                                     MofType mof,
                                     java.io.File mofFile,
                                     boolean runValidation,
                                     boolean silent,
                                     ProgressStatus progressStatus)
                              throws java.lang.Exception
        Exports given project to MOF XMI.
        Parameters:
        project - project to export.
        packages - project packages to export.
        mof - mof type.
        mofFile - output file.
        runValidation - run model validation when exporting.
        silent - silent (wihtout user interruption) export
        progressStatus - progress status.
        Throws:
        java.lang.Exception
      • exportMof

        @OpenApi
        public static void exportMof​(Project project,
                                     java.util.Set<Package> packages,
                                     MofType mof,
                                     java.io.File mofFile,
                                     boolean runValidation,
                                     ProgressStatus progressStatus)
                              throws java.lang.Exception
        Exports given project to MOF XMI.
        Parameters:
        project - project to export.
        packages - project packages to export.
        mof - mof type.
        mofFile - output file.
        runValidation - run model validation when exporting.
        progressStatus - progress status.
        Throws:
        java.lang.Exception
      • importMof

        @OpenApi
        public static void importMof​(java.io.File mofFile,
                                     MofDescriptor mof,
                                     java.io.File umlFile,
                                     ProgressStatus progressStatus,
                                     boolean removeTemp)
                              throws java.lang.Exception
        Imports given MOF to new project.
        Parameters:
        mofFile - MOF file to import.
        mof - MOF type.
        umlFile - Transformed file.
        progressStatus - progress status.
        Throws:
        java.lang.Exception
      • getMofXmiFileString

        private static java.lang.String getMofXmiFileString()