|
EGF Engine Release 0.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.egf.common.ui.helper.WorkbenchHelper
public class WorkbenchHelper
Provides services to easily deal with workbench stuffs (e.g open an editor).
Most of the services need to be called within the UI Thread.
Constructor Summary | |
---|---|
WorkbenchHelper()
|
Method Summary | |
---|---|
static void |
addPartListener(IPartListener listener_p)
Add a part listener in the active workbench page. |
static boolean |
closeEditor(IEditorPart editor_p,
boolean save_p)
Close the given editor. |
static boolean |
closeFileEditors(String fileRelativePath_p)
Close file based editors for given file relative path. |
static void |
closeView(String viewId_p)
Close a view for specified id in the current workbench page. |
static IWorkbenchPage |
getActiveWorkbenchPage()
Returns the currently active page for the active workbench window. |
static IEditorReference[] |
getAllOpenEditors(String editorId_p)
Get all open editors in the active workbench page for given editor id. |
static PackageExplorerPart |
getPackageExplorerView()
Get the Package Explorer view. |
static boolean |
isViewOpen(String viewId_p)
Return whether or not the view for specified id is open. |
static IEditorPart |
openDefaultFileEditor(String fileRelativePath_p,
Shell shell_p)
Open file based editor for given file relative path with registered editor as default one. |
static IEditorPart |
openEditor(IEditorInput editorInput_p,
String editorId_p,
Shell shell_p)
Open an editor on the given input. |
static IEditorPart |
openFileEditor(String fileRelativePath_p,
String editorId_p,
boolean editable_p)
Open file based editor for given file relative path. |
static void |
openView(String viewId_p)
Open a view for specified id in the current workbench page. |
static void |
saveEditor(IEditorPart editor_p)
Save given editor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkbenchHelper()
Method Detail |
---|
public static IWorkbenchPage getActiveWorkbenchPage()
null
if there is no active workbench page.null
if called from a non-UI thread.
null
if there is no active workbench page or if called from a non-UI threadpublic static IEditorPart openFileEditor(String fileRelativePath_p, String editorId_p, boolean editable_p)
fileRelativePath_p
- A path relative to workspace, starting with the project name.editorId_p
-
public static IEditorPart openEditor(IEditorInput editorInput_p, String editorId_p, Shell shell_p)
editorInput_p
- editorId_p
-
public static IEditorPart openDefaultFileEditor(String fileRelativePath_p, Shell shell_p)
fileRelativePath_p
- A path relative to workspace, starting with the project name.
public static void saveEditor(IEditorPart editor_p)
editor_p
- public static boolean closeFileEditors(String fileRelativePath_p)
fileRelativePath_p
-
public static boolean closeEditor(IEditorPart editor_p, boolean save_p)
If the editor has unsaved content and save_p
is true
,
the user will be given the opportunity to save it.
editor_p
- the edit or to close.save_p
- true
to save the editor contents if required (recommended),false
to discard any unsaved changes.
true
if the editor was successfully closed, and false
if the editor is still open.public static void closeView(String viewId_p)
viewId_p
- public static void openView(String viewId_p)
viewId_p
- public static boolean isViewOpen(String viewId_p)
viewId_p
-
true
means open.public static void addPartListener(IPartListener listener_p)
listener_p
- public static IEditorReference[] getAllOpenEditors(String editorId_p)
editorId_p
- the editor id, the one use to open the related editor.
public static PackageExplorerPart getPackageExplorerView()
null
if there is no active workbench page.null
if called from a non-UI thread.null
if package explorer is not open.
null
if there is no active workbench page or if called from a non-UI thread or if package explorer is
not open.
|
EGF Engine Release 0.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) Thales Corporate Services S.A.S, 2009.
This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.