Class DlimFileUtils

java.lang.Object
tools.descartes.dlim.generator.ui.utils.DlimFileUtils

public final class DlimFileUtils extends Object
This class provides resource and path utilities within an Eclipse project.
  • Method Details

    • getEObjectFromSelection

      public static EObject getEObjectFromSelection(ISelection selectedResource)
      Returns the selected EObject.
      Parameters:
      selectedResource - .dlim file must be the first element in the Selection
      Returns:
      EObject of the root (should be of type dlim.Sequence)
    • getResourceFromSelection

      public static IResource getResourceFromSelection(ISelection selectedResource)
      Returns the selected IResource.
      Parameters:
      selectedResource - .dlim file must be first element in selection
      Returns:
      .dlim File as Resource
    • getResourceListFromSelection

      public static List<IResource> getResourceListFromSelection(ISelection selectedResource)
      Get all resources within a Selection set.
      Parameters:
      selectedResource - .dlim file must be first element in selection
      Returns:
      all Resources in selection
    • getSelectionPath

      public static String getSelectionPath(ISelection selectedResource)
      Get the path of the first selected resource.
      Parameters:
      selectedResource - .dlim file must be first element in selection
      Returns:
      path of .dlim file
    • getRootEObject

      public static EObject getRootEObject(ISelection selectedResource)
      Returns the model root of the model contained in the selectedResource's file. When using this for dlim files, the resulting Object should be cast to dlim.Sequence.
      Parameters:
      selectedResource - .dlim file must be first element in selection
      Returns:
      EObject of the root (should be of type dlim.Sequence)
    • getRootEObject

      public static EObject getRootEObject(IResource resource)
      Returns the model root of the model contained in the resource. When using this for dlim files, the resulting Object should be cast to dlim.Sequence.
      Parameters:
      resource - .dlim file as Resource
      Returns:
      EObject of the root (should be of type dlim.Sequence)