Eclipse Platform
Release 3.1

org.eclipse.ui.ide
Class ResourceUtil

java.lang.Object
  extended byorg.eclipse.ui.ide.ResourceUtil

public final class ResourceUtil
extends Object

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 Summary
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 IFile getFile(IEditorInput editorInput)
          Returns the file corresponding to the given editor input, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFile

public static IFile getFile(IEditorInput editorInput)
Returns the file corresponding to the given editor input, or null if there is no applicable file. Returns null if the given editor input is null.

Parameters:
editorInput - the editor input, or null
Returns:
the file corresponding to the editor input, or null

getResource

public static IResource getResource(IEditorInput editorInput)
Returns the resource corresponding to the given editor input, or null if there is no applicable resource. Returns null if the given editor input is null.

Parameters:
editorInput - the editor input
Returns:
the file corresponding to the editor input, or null

findEditor

public 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.

Parameters:
page - the workbench page
file - the file
Returns:
the matching editor, or null

Eclipse Platform
Release 3.1

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.