com.aptana.ide.core.ui
Class WorkbenchHelper

java.lang.Object
  extended by com.aptana.ide.core.ui.WorkbenchHelper

public final class WorkbenchHelper
extends java.lang.Object

Utility classes for accessing parts of the workbench.

Author:
Ingo Muschenetz

Method Summary
static org.eclipse.ui.IViewPart findView(java.lang.String viewId, org.eclipse.ui.IWorkbenchWindow window)
          Find a specific view
static void launchBrowser(java.lang.String url)
          Open a url in a browser
static void launchBrowser(java.lang.String url, java.lang.String browserId)
          Open a url in a browser
static org.eclipse.ui.IEditorPart openFile(java.io.File file, org.eclipse.ui.IWorkbenchWindow window)
          Open a file in the workbench
static org.eclipse.ui.IEditorPart openFile(org.eclipse.core.resources.IFile file, org.eclipse.ui.IWorkbenchWindow window)
          Open a file in the workbench
static org.eclipse.ui.IEditorPart openFile(java.lang.String editorID, java.io.File file, org.eclipse.ui.IWorkbenchWindow window)
          Open a file in the workbench
static org.eclipse.ui.IEditorPart openFile(java.lang.String editorID, org.eclipse.core.resources.IFile file, org.eclipse.ui.IWorkbenchWindow window)
          Open a file in the workbench
static org.eclipse.ui.IViewPart showView(java.lang.String viewId, org.eclipse.ui.IWorkbenchWindow window)
          Show a specific view
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

showView

public static org.eclipse.ui.IViewPart showView(java.lang.String viewId,
                                                org.eclipse.ui.IWorkbenchWindow window)
                                         throws org.eclipse.ui.PartInitException
Show a specific view

Parameters:
viewId - The ID of the view to show
window - The active window
Returns:
The IViewPart of the activated view.
Throws:
org.eclipse.ui.PartInitException

findView

public static org.eclipse.ui.IViewPart findView(java.lang.String viewId,
                                                org.eclipse.ui.IWorkbenchWindow window)
                                         throws org.eclipse.ui.PartInitException
Find a specific view

Parameters:
viewId - The ID of the view to show
window - The active window
Returns:
The IViewPart of the activated view.
Throws:
org.eclipse.ui.PartInitException

openFile

public static org.eclipse.ui.IEditorPart openFile(java.io.File file,
                                                  org.eclipse.ui.IWorkbenchWindow window)
Open a file in the workbench

Parameters:
file - The file to open
window - The active window
Returns:
The IEditorPart of the opened file

openFile

public static org.eclipse.ui.IEditorPart openFile(java.lang.String editorID,
                                                  java.io.File file,
                                                  org.eclipse.ui.IWorkbenchWindow window)
Open a file in the workbench

Parameters:
editorID - The editor to use in opening the file
file - The file to open
window - The active window
Returns:
The IEditorPart of the opened file

openFile

public static org.eclipse.ui.IEditorPart openFile(org.eclipse.core.resources.IFile file,
                                                  org.eclipse.ui.IWorkbenchWindow window)
Open a file in the workbench

Parameters:
file - The file to open
window - The active window
Returns:
The IEditorPart of the opened file

openFile

public static org.eclipse.ui.IEditorPart openFile(java.lang.String editorID,
                                                  org.eclipse.core.resources.IFile file,
                                                  org.eclipse.ui.IWorkbenchWindow window)
Open a file in the workbench

Parameters:
editorID - The editor to use in opening the file
file - The file to open
window - The active window
Returns:
The IEditorPart of the opened file

launchBrowser

public static void launchBrowser(java.lang.String url)
Open a url in a browser

Parameters:
url - The URL to open

launchBrowser

public static void launchBrowser(java.lang.String url,
                                 java.lang.String browserId)
Open a url in a browser

Parameters:
url - The URL to open