org.jupe.editors.classdiagram
Class EditorUtil

java.lang.Object
  extended by org.jupe.editors.classdiagram.EditorUtil

public final class EditorUtil
extends java.lang.Object

Author:
Roman Wolf

Method Summary
static org.eclipse.ui.IEditorPart getOpenEditor(org.eclipse.core.resources.IFile file, java.lang.Class kind, boolean activePerspectiveOnly, java.lang.String perspectiveId)
          Method returns currently opened editor which contains specfied resource or null if no such editor is opened.
static org.eclipse.ui.IWorkbenchPage getPage(java.lang.String perspectiveId)
          Method returns workbench page which contains all open editors in the current active perspective.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getOpenEditor

public static org.eclipse.ui.IEditorPart getOpenEditor(org.eclipse.core.resources.IFile file,
                                                       java.lang.Class kind,
                                                       boolean activePerspectiveOnly,
                                                       java.lang.String perspectiveId)
Method returns currently opened editor which contains specfied resource or null if no such editor is opened.

Parameters:
file - resource which might be opened by an editor
kind - If not null, only editors of "kind" or adaptable to kind are returned (instanceof "kind" preferred)
activePerspectiveOnly - check only editors in currently active perspective
perspectiveId - the id of the perspective
Returns:
opened editor or null if no such editor was found

getPage

public static org.eclipse.ui.IWorkbenchPage getPage(java.lang.String perspectiveId)
Method returns workbench page which contains all open editors in the current active perspective.

Parameters:
perspectiveId - the id of the perspective
Returns:
workbench page or null if page is not active yet