public final class ResourceUtil extends Object
This class provides all its functionality via static methods. It is not intended to be instantiated or subclassed.
Modifier and Type | Method and Description |
---|---|
static IEditorPart |
findEditor(IWorkbenchPage page,
IFile file)
Returns the editor in the given page whose input represents the given file,
or
null if there is no such editor. |
static Object |
getAdapter(Object element,
Class adapterType,
boolean forceLoad)
Returns the specified adapter for the given element, or
null
if no such adapter was found. |
static IFile |
getFile(IEditorInput editorInput)
Returns the file corresponding to the given editor input, or
null
if there is no applicable file. |
static IFile |
getFile(Object element)
Returns the file corresponding to the given model element, or
null
if there is no applicable file. |
static IResource |
getResource(IEditorInput editorInput)
Returns the resource corresponding to the given editor input, or
null
if there is no applicable resource. |
static IResource |
getResource(Object element)
Returns the resource corresponding to the given model element, or
null
if there is no applicable resource. |
static ResourceMapping |
getResourceMapping(Object element)
Returns the resource mapping corresponding to the given model element, or
null
if there is no applicable resource mapping. |
public static IFile getFile(IEditorInput editorInput)
null
if there is no applicable file.
Returns null
if the given editor input is null
.editorInput
- the editor input, or null
null
public static IResource getResource(IEditorInput editorInput)
null
if there is no applicable resource.
Returns null
if the given editor input is null
.editorInput
- the editor inputnull
public static IEditorPart findEditor(IWorkbenchPage page, IFile file)
null
if there is no such editor.page
- the workbench pagefile
- the filenull
public static IResource getResource(Object element)
null
if there is no applicable resource.element
- the model element, or null
null
public static IFile getFile(Object element)
null
if there is no applicable file.element
- the model element, or null
null
public static ResourceMapping getResourceMapping(Object element)
null
if there is no applicable resource mapping.element
- the model element, or null
null
public static Object getAdapter(Object element, Class adapterType, boolean forceLoad)
null
if no such adapter was found.element
- the model elementadapterType
- the type of adapter to look upforceLoad
- true
to force loading of the plug-in providing the adapter,
false
otherwise
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.