public class CHESSEditorUtils
extends java.lang.Object
Constructor and Description |
---|
CHESSEditorUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanAllDiagrams()
Utility function to remove orphan views from all the diagrams defined in the notation model
|
static org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor |
getCHESSEditor()
If the active editor's input belongs to a project with the CHESS nature then return the
editor.
|
static org.eclipse.gmf.runtime.notation.Diagram |
getDiagram()
Get the current active diagram from the active editor.
|
static org.eclipse.gmf.runtime.notation.Diagram |
getDiagram(org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor editor)
Get the current active diagram given the editor.
|
static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack |
getDiagramCommandStack()
Return the DiagramEditPart from the active workbench page.
|
static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart |
getDiagramEditPart()
Return the DiagramEditPart from the active editor.
|
static org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer |
getDiagramGraphicalViewer()
Return the graphical viewer from the active editor.
|
static org.polarsys.chess.core.views.DiagramStatus |
getDiagramStatus(org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor editor)
Get the DiagramStatus object of the CHESS Service given the Papyrus editor.
|
static org.polarsys.chess.core.views.DiagramStatus |
getDiagramStatus(org.eclipse.papyrus.infra.core.services.ServicesRegistry registry)
Get the DiagramStatus object of the CHESS Service given the Papyrus service registry.
|
static boolean |
isCHESSProject(org.eclipse.ui.IEditorPart editor)
Check if the editor passed as a parameter is a CHESS editor; that is if
the input of the editor belongs to a project with the CHESS nature
|
static void |
reopenEditor(org.eclipse.ui.IEditorPart editor,
java.lang.Boolean save)
Reopen the Papyrus Editor specified in the parameter.
|
static org.eclipse.jface.dialogs.MessageDialog |
showConfirmDialog(org.eclipse.ui.part.EditorPart editor,
java.lang.String dialogTitle,
java.lang.String dialogMessage)
Utility function to create a confirmation Dialog with "OK", "no" and
"cancel" buttons.
|
public static org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor getCHESSEditor()
public static org.eclipse.gmf.runtime.notation.Diagram getDiagram()
public static org.eclipse.gmf.runtime.notation.Diagram getDiagram(org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor editor)
the
- editor. It should be not null.public static org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack getDiagramCommandStack()
public static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart getDiagramEditPart()
public static org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer getDiagramGraphicalViewer()
public static org.polarsys.chess.core.views.DiagramStatus getDiagramStatus(org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor editor)
the
- editor It should be not null.public static org.polarsys.chess.core.views.DiagramStatus getDiagramStatus(org.eclipse.papyrus.infra.core.services.ServicesRegistry registry)
registry.
- It should be not null.public static boolean isCHESSProject(org.eclipse.ui.IEditorPart editor)
the
- editor. It should be not null.public static void reopenEditor(org.eclipse.ui.IEditorPart editor, java.lang.Boolean save)
editor
- the Editor to reopen. It should be not null.save
- set this parameter to true to save the inputpublic static org.eclipse.jface.dialogs.MessageDialog showConfirmDialog(org.eclipse.ui.part.EditorPart editor, java.lang.String dialogTitle, java.lang.String dialogMessage)
editor
- the editor the dialog belongs to. It should be not null.dialogTitle
- the title of the dialogdialogMessage
- the message to displaypublic static void cleanAllDiagrams()