Class ExecutableHierarchyImporterNode

  • All Implemented Interfaces:
    IHierarchyImporterNode
    Direct Known Subclasses:
    HierarchyImporterStatusNode

    public class ExecutableHierarchyImporterNode
    extends AbstractHierarchyImporterNode

    Basic implementation of executable import node

    Used for execute IHierarchyImportExecutor from hierarchy importer context. After completing import task of this node will be launched imports child nodes and after completing save tasks of all children nodes will be launched save task of this node.

    Client must be implementation of this class
    • Constructor Detail

      • ExecutableHierarchyImporterNode

        protected ExecutableHierarchyImporterNode​(IHierarchyImporterContext importerContext,
                                                  Path source)
        Parameters:
        importerContext - the importer context info (not null)
        source - the path to importing file (not null)
    • Method Detail

      • executeImport

        public void executeImport​(Collection<org.eclipse.core.runtime.IStatus> statuses)
        Description copied from interface: IHierarchyImporterNode
        Run action of importing data
        Parameters:
        statuses - a collection the result statuses of all the operations will be added into, not null
      • doImport

        public org.eclipse.core.runtime.IStatus doImport()
        Do import work
        Returns:
        the result status of import work
      • createAndSaveResource

        protected void createAndSaveResource​(org.eclipse.emf.ecore.EObject eObject,
                                             org.eclipse.core.runtime.IPath location,
                                             org.eclipse.core.runtime.IPath relative,
                                             String projectName)
                                      throws IOException
        Creates a resource with the model object in the provided location using relative path inside location and saves it.
        Parameters:
        eObject - the model object to save (not null)
        location - the path to file in which will be saved new resource (not null)
        relative - the relative path inside location to use (not null)
        projectName - the project name to use for model object URI creation (not null)
        Throws:
        IOException - if create or save resource failed
      • error

        protected org.eclipse.core.runtime.IStatus error​(Exception e)
        Create error status with the given exception content.
        Parameters:
        e - the exception to report, cannot be null
        Returns:
        an error status with the given exception content, never null