|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComposite
org.eclipse.graphiti.ui.editor.GraphicalComposite
org.eclipse.graphiti.ui.editor.DiagramComposite
public class DiagramComposite
An SWT composite that can display a Graphiti diagram. This implementation is
based on a custom GraphicalComposite
class that works much like the
GEF GraphicalEditorWithFlyoutPalette class.
A DiagramComposite can be used anywhere a regular SWT Composite can. A
DiagramComposite can participate in a parent transaction or create one of
it's own. If the DiagramComposites is managing it's own transaction, it is up
to the enclosing workbench part to call the appropriate methods on the
composite.
Field Summary | |
---|---|
private DiagramBehavior |
diagramBehavior
|
private IWorkbenchPart |
ownedPart
|
Fields inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI |
---|
DIAGRAM_CONTEXT_ID |
Constructor Summary | |
---|---|
DiagramComposite(Composite parent,
int style)
|
|
DiagramComposite(IWorkbenchPart ownedPart,
Composite parent,
int style)
|
Method Summary | |
---|---|
void |
close()
Notify the container that it should shut down or clear it's state. |
protected void |
configureGraphicalViewer()
Called to configure the graphical viewer before it receives its contents. |
protected DiagramBehavior |
createDiagramBehavior()
|
protected void |
createGraphicalViewer()
Creates the GraphicalViewer on the specified Composite . |
protected PaletteViewerProvider |
createPaletteViewerProvider()
|
void |
disableAdapters()
|
void |
dispose()
|
void |
doSave(IProgressMonitor monitor)
Triggers that the diagram model is persisted. |
void |
editingDomainInitialized()
|
void |
enableAdapters()
|
Object |
getAdapter(Class type)
Returns the adapter for the specified key. |
DiagramBehavior |
getDiagramBehavior()
Returns the associated diagram behavior instance, that describes and implements the standard diagram behavior. |
IDiagramEditorInput |
getDiagramEditorInput()
Returns the IDiagramEditorInput instance used for this container. |
IDiagramTypeProvider |
getDiagramTypeProvider()
Gets the diagram type provider. |
GraphicalEditPart |
getEditPartForPictogramElement(PictogramElement pe)
|
protected FlyoutPreferences |
getPalettePreferences()
|
protected PaletteRoot |
getPaletteRoot()
|
DefaultRefreshBehavior |
getRefreshBehavior()
|
PictogramElement[] |
getSelectedPictogramElements()
Gets all pictogram elements that are currently selected. |
IWorkbenchPartSite |
getSite()
Returns the IWorkbenchPartSite of the Eclipse
IWorkbenchPart that displays this container. |
String |
getTitle()
Gets the title for the container that is displaying the diagram. |
String |
getTitleToolTip()
Returns the tooltip for the container. |
DefaultUpdateBehavior |
getUpdateBehavior()
|
IWorkbenchPart |
getWorkbenchPart()
Returns the instance of the Eclipse IWorkbenchPart that displays
this container. |
double |
getZoomLevel()
|
void |
initializeGraphicalViewer()
Override to set the contents of the GraphicalViewer after it has been created. |
boolean |
isAlive()
|
boolean |
isDirectEditingActive()
|
boolean |
isDirty()
Returns true if the command stack is dirty |
void |
refreshTitle()
Refreshes the title text of this container. |
void |
refreshTitleToolTip()
Refreshes the title tool tip text of this part. |
void |
selectPictogramElements(PictogramElement[] pictogramElements)
Selects all the given pictogram elements in the container. |
void |
setDirectEditingActive(boolean directEditingActive)
|
boolean |
setFocus()
Sets the focus by delegating to the super class implementation in the GEF editor and additionally triggers a update of the diagram by delegating to DefaultUpdateBehavior.handleActivate() . |
void |
setInput(IDiagramEditorInput input)
|
void |
setInput(TransactionalEditingDomain editingDomain,
IDiagramEditorInput input)
|
void |
setPictogramElementForSelection(PictogramElement pictogramElement)
Sets the pictogram element which should be selected after the container refresh. |
void |
setPictogramElementsForSelection(PictogramElement[] pictogramElements)
Sets the pictogram elements which should be selected after the container refresh. |
void |
updateDirtyState()
Updates the UI of the container to correctly reflect the dirty state. |
Methods inherited from class org.eclipse.graphiti.ui.editor.GraphicalComposite |
---|
commandStackChanged, createActions, createControl, firePropertyChange, getActionRegistry, getCommandStack, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, init, initializeActionRegistry, selectionChanged, setActionRegistry, setEditDomain, setGraphicalViewer, updateActions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.graphiti.ui.editor.IDiagramContainerUI |
---|
commandStackChanged, getActionRegistry, getEditDomain, getGraphicalViewer, getSelectionActions, hookGraphicalViewer, setEditDomain, setGraphicalViewer |
Field Detail |
---|
private DiagramBehavior diagramBehavior
private IWorkbenchPart ownedPart
Constructor Detail |
---|
public DiagramComposite(IWorkbenchPart ownedPart, Composite parent, int style)
public DiagramComposite(Composite parent, int style)
Method Detail |
---|
protected DiagramBehavior createDiagramBehavior()
public void setInput(IDiagramEditorInput input)
public void setInput(TransactionalEditingDomain editingDomain, IDiagramEditorInput input)
public void initializeGraphicalViewer()
GraphicalComposite
initializeGraphicalViewer
in class GraphicalComposite
#createGraphicalViewer(Composite)
protected void createGraphicalViewer()
GraphicalComposite
Composite
.
createGraphicalViewer
in class GraphicalComposite
protected void configureGraphicalViewer()
GraphicalComposite
configureGraphicalViewer
in class GraphicalComposite
public void refreshTitle()
IDiagramContainer
refreshTitle
in interface IDiagramContainer
refreshTitle
in interface IDiagramEditor
public void refreshTitleToolTip()
IDiagramContainer
refreshTitleToolTip
in interface IDiagramContainer
refreshTitleToolTip
in interface IDiagramEditor
public void updateDirtyState()
IDiagramContainer
IEditorPart#PROP_DIRTY
property change.
updateDirtyState
in interface IDiagramContainer
public IWorkbenchPart getWorkbenchPart()
IDiagramContainerUI
IWorkbenchPart
that displays
this container. E.g. for an editor this will be the editor itself.
getWorkbenchPart
in interface IDiagramContainerUI
getWorkbenchPart
in class GraphicalComposite
IWorkbenchPart
that is displaying the diagram.public void close()
IDiagramContainer
close
in interface IDiagramContainer
public Object getAdapter(Class type)
GraphicalComposite
IMPORTANT certain requests, such as the property sheet, may be made before or after
#createPartControl(Composite)
is called. The order is unspecified by the Workbench.
getAdapter
in class GraphicalComposite
org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
public void dispose()
dispose
in class GraphicalComposite
org.eclipse.ui.IWorkbenchPart#dispose()
public boolean setFocus()
DefaultUpdateBehavior.handleActivate()
.
setFocus
in class GraphicalComposite
public final DefaultUpdateBehavior getUpdateBehavior()
public final DefaultRefreshBehavior getRefreshBehavior()
public void editingDomainInitialized()
public void disableAdapters()
public void enableAdapters()
public boolean isDirty()
GraphicalComposite
true
if the command stack is dirty
isDirty
in interface IDiagramContainer
isDirty
in interface IDiagramEditor
isDirty
in class GraphicalComposite
true
, if container is dirty, false
otherwiseorg.eclipse.ui.ISaveablePart#isDirty()
protected final PaletteViewerProvider createPaletteViewerProvider()
protected final FlyoutPreferences getPalettePreferences()
protected final PaletteRoot getPaletteRoot()
public PictogramElement[] getSelectedPictogramElements()
IDiagramContainer
getSelectedPictogramElements
in interface IDiagramContainer
getSelectedPictogramElements
in interface IDiagramEditor
public void selectPictogramElements(PictogramElement[] pictogramElements)
IDiagramContainer
selectPictogramElements
in interface IDiagramContainer
selectPictogramElements
in interface IDiagramEditor
pictogramElements
- The pictogram elements to selectpublic void setPictogramElementForSelection(PictogramElement pictogramElement)
IDiagramContainer
setPictogramElementForSelection
in interface IDiagramContainer
setPictogramElementForSelection
in interface IDiagramEditor
pictogramElement
- The pictogram element to selectpublic void setPictogramElementsForSelection(PictogramElement[] pictogramElements)
IDiagramContainer
setPictogramElementsForSelection
in interface IDiagramContainer
setPictogramElementsForSelection
in interface IDiagramEditor
pictogramElements
- The pictogram elements to selectpublic IDiagramTypeProvider getDiagramTypeProvider()
IDiagramContainer
getDiagramTypeProvider
in interface IDiagramContainer
getDiagramTypeProvider
in interface IDiagramEditor
public GraphicalEditPart getEditPartForPictogramElement(PictogramElement pe)
public double getZoomLevel()
public boolean isAlive()
public boolean isDirectEditingActive()
public void setDirectEditingActive(boolean directEditingActive)
public IDiagramEditorInput getDiagramEditorInput()
IDiagramContainerUI
IDiagramEditorInput
instance used for this container.
Basically it is used as an Eclipse IEditorInput
object only in
case the container is an editor; for other types of containers the input
is simply used as a holder for a URI pointing to a diagram.
getDiagramEditorInput
in interface IDiagramContainerUI
public IWorkbenchPartSite getSite()
IDiagramContainerUI
IWorkbenchPartSite
of the Eclipse
IWorkbenchPart
that displays this container. E.g. for an editor
this will be the editor site.
getSite
in interface IDiagramContainerUI
IWorkbenchPart
that is displaying the
diagram.public String getTitle()
IDiagramContainer
getTitle
in interface IDiagramContainer
String
public String getTitleToolTip()
IDiagramContainer
getTitleToolTip
in interface IDiagramContainer
String
public void doSave(IProgressMonitor monitor)
IDiagramContainer
doSave
in interface IDiagramContainer
public DiagramBehavior getDiagramBehavior()
IDiagramContainer
getDiagramBehavior
in interface IDiagramContainer
getDiagramBehavior
in interface IDiagramContainerUI
IDiagramBehavior
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |