Package org.eclipse.ui.ide
Class ResourceUtil
java.lang.Object
org.eclipse.ui.ide.ResourceUtil
Utility class for manipulating resources and determining correspondences
 between resources and workbench objects.
 
This class provides all its functionality via static methods. It is not intended to be instantiated or subclassed.
- Since:
- 3.1
- 
Method SummaryModifier and TypeMethodDescriptionstatic IEditorPartfindEditor(IWorkbenchPage page, IFile file) Returns the editor in the given page whose input represents the given file, ornullif there is no such editor.static <T> TgetAdapter(Object element, Class<T> adapterType, boolean forceLoad) Deprecated.static IFileReturns the file corresponding to the given model element, ornullif there is no applicable file.static IFilegetFile(IEditorInput editorInput) Returns the file corresponding to the given editor input, ornullif there is no applicable file.static IResourcegetResource(Object element) Returns the resource corresponding to the given model element, ornullif there is no applicable resource.static IResourcegetResource(IEditorInput editorInput) Returns the resource corresponding to the given editor input, ornullif there is no applicable resource.static ResourceMappinggetResourceMapping(Object element) Returns the resource mapping corresponding to the given model element, ornullif there is no applicable resource mapping.
- 
Method Details- 
getFileReturns the file corresponding to the given editor input, ornullif there is no applicable file. Returnsnullif the given editor input isnull.- Parameters:
- editorInput- the editor input, or- null
- Returns:
- the file corresponding to the editor input, or null
 
- 
getResourceReturns the resource corresponding to the given editor input, ornullif there is no applicable resource. Returnsnullif the given editor input isnull.- Parameters:
- editorInput- the editor input
- Returns:
- the file corresponding to the editor input, or null
 
- 
findEditorReturns the editor in the given page whose input represents the given file, ornullif there is no such editor.- Parameters:
- page- the workbench page
- file- the file
- Returns:
- the matching editor, or null
 
- 
getResourceReturns the resource corresponding to the given model element, ornullif there is no applicable resource.- Parameters:
- element- the model element, or- null
- Returns:
- the resource corresponding to the model element, or null
- Since:
- 3.2
 
- 
getFileReturns the file corresponding to the given model element, ornullif there is no applicable file.- Parameters:
- element- the model element, or- null
- Returns:
- the resource corresponding to the model element, or null
- Since:
- 3.2
 
- 
getResourceMappingReturns the resource mapping corresponding to the given model element, ornullif there is no applicable resource mapping.- Parameters:
- element- the model element, or- null
- Returns:
- the resource mapping corresponding to the model element, or null
- Since:
- 3.2
 
- 
getAdapterDeprecated.UseAdapters.adapt(Object, Class, boolean)instead.See Javadoc ofAdapters.adapt(Object, Class, boolean).- Since:
- 3.2
 
 
- 
Adapters.adapt(Object, Class, boolean)instead.