public final class WorkbenchResourceUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
createFile(IFile file,
java.lang.String content) |
static IFile |
findFileRecursively(IContainer container,
java.lang.String name) |
static java.lang.String |
getAbsolutePath(IResource resource) |
static IWorkbenchPart |
getActivePart()
Must be called from SWT UI thread only
|
static Shell |
getActiveShell()
Must be called from SWT UI thread only
|
static IContainer |
getContainerFromSelection(IStructuredSelection selection) |
static IFile |
getEditorFile(IWorkbenchPart part) |
static java.io.File |
getFile(java.lang.String path) |
static IFile |
getFileForLocation(java.lang.String path) |
static ISelection |
getNamedFileOrTaskSelection(java.lang.String fileName,
java.lang.Class<? extends ITask> taskClass)
This method tests the current workbench state and returns one of the
following:
1.
|
static IProject |
getProject(java.lang.String name) |
static IResource |
getResource(IProject project,
java.lang.String filePath) |
static IProject |
getSelectedProject() |
static void |
openInEditor(IFile file,
java.lang.String editorID) |
static void |
showConsoleView() |
static void |
showErrorDialog(java.lang.String title,
java.lang.String message,
IStatus status) |
static void |
updateFile(IFile file,
java.lang.String content) |
public static Shell getActiveShell()
Shellpublic static IWorkbenchPart getActivePart()
IWorkbenchPartpublic static void openInEditor(IFile file,
java.lang.String editorID)
throws PartInitException
PartInitExceptionpublic static void createFile(IFile file,
java.lang.String content)
throws CoreException
CoreExceptionpublic static void updateFile(IFile file,
java.lang.String content)
throws CoreException
CoreExceptionpublic static IProject getSelectedProject()
public static IProject getProject(java.lang.String name)
public static IResource getResource(IProject project,
java.lang.String filePath)
public static IContainer getContainerFromSelection(IStructuredSelection selection)
public static java.lang.String getAbsolutePath(IResource resource)
public static void showConsoleView()
throws PartInitException
PartInitExceptionpublic static IFile findFileRecursively(IContainer container,
java.lang.String name)
throws CoreException
CoreExceptionpublic static java.io.File getFile(java.lang.String path)
public static IFile getFileForLocation(java.lang.String path)
public static void showErrorDialog(java.lang.String title,
java.lang.String message,
IStatus status)
public static IFile getEditorFile(IWorkbenchPart part)
public static ISelection getNamedFileOrTaskSelection(java.lang.String fileName,
java.lang.Class<? extends ITask> taskClass)
fileName - The file name to test forCopyright (c) IBM Corp. and others 2000, 2016. All Rights Reserved.