|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpl.edu.agh.cast.editor.EditorUtil
public final class EditorUtil
Utility methods for editors.
Constructor Summary | |
---|---|
EditorUtil()
|
Method Summary | |
---|---|
static java.util.List<DiagramEditorInput> |
closeProjectEditors(org.eclipse.core.resources.IProject project,
boolean saveEditors)
Close opened editors of given project. |
static org.eclipse.core.resources.IFile |
findFile(java.lang.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(pl.edu.agh.cast.model.base.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(pl.edu.agh.cast.model.base.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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EditorUtil()
Method Detail |
---|
public static org.eclipse.ui.IEditorPart openNewEditor(pl.edu.agh.cast.model.base.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(pl.edu.agh.cast.model.base.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
public static java.util.List<DiagramEditorInput> closeProjectEditors(org.eclipse.core.resources.IProject project, boolean saveEditors) throws org.eclipse.core.runtime.CoreException
project
- saveEditors
- TODO
org.eclipse.core.runtime.CoreException
public static org.eclipse.core.resources.IFile findFile(java.lang.String fileName, org.eclipse.core.resources.IContainer container) throws org.eclipse.core.runtime.CoreException, java.io.FileNotFoundException
fileName
- container
-
org.eclipse.core.runtime.CoreException
java.io.FileNotFoundException
public static boolean saveModifiedEditors(org.eclipse.core.resources.IProject project)
public static org.eclipse.gef.commands.CommandStack getActiveEditorCommandStack()
public 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 |