Class DlimFileUtils
java.lang.Object
tools.descartes.dlim.generator.ui.utils.DlimFileUtils
This class provides resource and path utilities within an Eclipse project.
-
Method Summary
Modifier and TypeMethodDescriptionstatic EObjectgetEObjectFromSelection(ISelection selectedResource) Returns the selected EObject.static IResourcegetResourceFromSelection(ISelection selectedResource) Returns the selected IResource.getResourceListFromSelection(ISelection selectedResource) Get all resources within a Selection set.static EObjectgetRootEObject(IResource resource) Returns the model root of the model contained in the resource.static EObjectgetRootEObject(ISelection selectedResource) Returns the model root of the model contained in the selectedResource's file.static StringgetSelectionPath(ISelection selectedResource) Get the path of the first selected resource.
-
Method Details
-
getEObjectFromSelection
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
Returns the selected IResource.- Parameters:
selectedResource- .dlim file must be first element in selection- Returns:
- .dlim File as Resource
-
getResourceListFromSelection
Get all resources within a Selection set.- Parameters:
selectedResource- .dlim file must be first element in selection- Returns:
- all Resources in selection
-
getSelectionPath
Get the path of the first selected resource.- Parameters:
selectedResource- .dlim file must be first element in selection- Returns:
- path of .dlim file
-
getRootEObject
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
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)
-