|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.edu.agh.cast.backward.editor.EditorUtilBackward
public final class EditorUtilBackward
Utility methods for editors.
| Constructor Summary | |
|---|---|
EditorUtilBackward()
|
|
| Method Summary | |
|---|---|
static List<DiagramEditorInput> |
closeProjectEditors(org.eclipse.core.resources.IProject project,
boolean saveEditors)
Close opened editors of given project. |
static org.eclipse.core.resources.IFile |
findFile(String fileName,
org.eclipse.core.resources.IContainer container)
Find reference to a file in given container. |
static IDiagram |
getActiveDiagram()
Returns the active diagram - the diagram from active editor, if it has one. |
static org.eclipse.gef.commands.CommandStack |
getActiveEditorCommandStack()
Returns CommandStack for active editor. |
static org.eclipse.ui.IEditorDescriptor[] |
getAllEditors()
|
static org.eclipse.ui.IEditorDescriptor |
getDefaultEditor()
|
static org.eclipse.ui.IEditorPart |
openEditorForSavedDiagram(IDiagram diagram,
org.eclipse.ui.IEditorDescriptor desc,
org.eclipse.core.resources.IFile file)
Opens editor from a saved diagram. |
static org.eclipse.ui.IEditorPart |
openEmptyEditor(org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorDescriptor)
Opens a new empty editor of given type. |
static org.eclipse.ui.IEditorPart |
openNewEditor(IDataSet dataSet,
org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorType)
Opens a new editor for single data set. |
static org.eclipse.ui.IEditorPart |
openNewEditor(IModel model,
org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorType)
Opens a new editor for the whole model. |
static void |
runWithProgressMonitor(org.eclipse.jface.operation.IRunnableWithProgress runnable,
IExceptionHandler exceptionHandler)
Runs given runnable. |
static void |
runWithProgressMonitorInUIThread(org.eclipse.jface.operation.IRunnableWithProgress runnable,
IExceptionHandler exceptionHandler)
Runs given runnable in UI thread (see Display.asyncExec(Runnable)). |
static boolean |
saveModifiedEditors(org.eclipse.core.resources.IProject project)
Saves all modified files which belongs to specified project asking user file by file if he/she wants to save them. |
static void |
switchToDiagramPerspective()
Method is switching to default workbench perspective. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EditorUtilBackward()
| Method Detail |
|---|
public static void switchToDiagramPerspective()
public static org.eclipse.ui.IEditorPart openNewEditor(IDataSet dataSet,
org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorType)
throws org.eclipse.ui.PartInitException
dataSet - input data setproject - containing projecteditorType - ID of the editor to create
org.eclipse.ui.PartInitException
public static org.eclipse.ui.IEditorPart openNewEditor(IModel model,
org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorType)
throws org.eclipse.ui.PartInitException
model - input modelproject - containing projecteditorType - ID of the editor to create
org.eclipse.ui.PartInitException
public static org.eclipse.ui.IEditorPart openEmptyEditor(org.eclipse.core.resources.IProject project,
org.eclipse.ui.IEditorDescriptor editorDescriptor)
throws org.eclipse.ui.PartInitException
project - containing projecteditorDescriptor - descriptor of the editor to open
org.eclipse.ui.PartInitException
public static org.eclipse.ui.IEditorPart openEditorForSavedDiagram(IDiagram diagram,
org.eclipse.ui.IEditorDescriptor desc,
org.eclipse.core.resources.IFile file)
throws org.eclipse.ui.PartInitException
diagram - input diagram to opendesc - editor descriptorfile - input file
org.eclipse.ui.PartInitException - on workbench initialization exception
public static List<DiagramEditorInput> closeProjectEditors(org.eclipse.core.resources.IProject project,
boolean saveEditors)
throws org.eclipse.core.runtime.CoreException
project - the project to close editors forsaveEditors - whether editors should be saved
org.eclipse.core.runtime.CoreException - on exception
public static org.eclipse.core.resources.IFile findFile(String fileName,
org.eclipse.core.resources.IContainer container)
throws org.eclipse.core.runtime.CoreException,
FileNotFoundException
fileName - file namecontainer - container to look in
IFile
org.eclipse.core.runtime.CoreException
FileNotFoundException - when file could not be locatedpublic static boolean saveModifiedEditors(org.eclipse.core.resources.IProject project)
project - project to save modifications for
public static org.eclipse.gef.commands.CommandStack getActiveEditorCommandStack()
CommandStack for active editor. If cannot reach active workbench/page/editor then returns
null.
CommandStack for active editor or nullpublic static org.eclipse.ui.IEditorDescriptor getDefaultEditor()
public static org.eclipse.ui.IEditorDescriptor[] getAllEditors()
public static IDiagram getActiveDiagram()
public static void runWithProgressMonitor(org.eclipse.jface.operation.IRunnableWithProgress runnable,
IExceptionHandler exceptionHandler)
runnable. If possible displays it's progress.
runnable - runnable to runexceptionHandler - instance of IExceptionHandler for handling InvocationTargetException
and InterruptedException as may be thrown by
IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor)
public static void runWithProgressMonitorInUIThread(org.eclipse.jface.operation.IRunnableWithProgress runnable,
IExceptionHandler exceptionHandler)
runnable in UI thread (see Display.asyncExec(Runnable)).
If possible displays it's progress.
This is useful when the runnable performs some GUI actions, like drawing nodes.
runnable - runnable to runexceptionHandler - instance of IExceptionHandler for handling InvocationTargetException
and InterruptedException as may be thrown by
IRunnableWithProgress.run(org.eclipse.core.runtime.IProgressMonitor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||