|
||||||||||
| 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. |
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 DiagramBehavior instance associated with this
container. |
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 interface IDiagramContainerUIinitializeGraphicalViewer in class GraphicalComposite#createGraphicalViewer(Composite)protected void createGraphicalViewer()
GraphicalCompositeComposite.
createGraphicalViewer in class GraphicalCompositepublic void configureGraphicalViewer()
GraphicalComposite
configureGraphicalViewer in interface IDiagramContainerUIconfigureGraphicalViewer in class GraphicalCompositepublic void refreshTitle()
IDiagramContainer
refreshTitle in interface IDiagramContainerpublic void refreshTitleToolTip()
IDiagramContainer
refreshTitleToolTip in interface IDiagramContainerpublic void updateDirtyState()
IDiagramContainerIEditorPart#PROP_DIRTY property change.
updateDirtyState in interface IDiagramContainerpublic IWorkbenchPart getWorkbenchPart()
IDiagramContainerUIIWorkbenchPart that displays
this container. E.g. for an editor this will be the editor itself.
getWorkbenchPart in interface IDiagramContainerUIgetWorkbenchPart in class GraphicalCompositeIWorkbenchPart that is displaying the diagram.public void close()
IDiagramContainer
close in interface IDiagramContainerpublic 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 GraphicalCompositeorg.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)public void dispose()
dispose in class GraphicalCompositeorg.eclipse.ui.IWorkbenchPart#dispose()public boolean setFocus()
DefaultUpdateBehavior.handleActivate().
setFocus in class GraphicalCompositepublic final DefaultUpdateBehavior getUpdateBehavior()
public final DefaultRefreshBehavior getRefreshBehavior()
public void editingDomainInitialized()
public void disableAdapters()
public void enableAdapters()
public boolean isDirty()
GraphicalCompositetrue if the command stack is dirty
isDirty in interface IDiagramContainerisDirty in class GraphicalCompositetrue, 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 IDiagramContainerpublic void selectPictogramElements(PictogramElement[] pictogramElements)
IDiagramContainer
selectPictogramElements in interface IDiagramContainerpictogramElements - The pictogram elements to selectpublic void setPictogramElementForSelection(PictogramElement pictogramElement)
IDiagramContainer
setPictogramElementForSelection in interface IDiagramContainerpictogramElement - The pictogram element to selectpublic void setPictogramElementsForSelection(PictogramElement[] pictogramElements)
IDiagramContainer
setPictogramElementsForSelection in interface IDiagramContainerpictogramElements - The pictogram elements to selectpublic IDiagramTypeProvider getDiagramTypeProvider()
IDiagramContainer
getDiagramTypeProvider in interface IDiagramContainerpublic GraphicalEditPart getEditPartForPictogramElement(PictogramElement pe)
public double getZoomLevel()
public boolean isAlive()
public boolean isDirectEditingActive()
public void setDirectEditingActive(boolean directEditingActive)
public IDiagramEditorInput getDiagramEditorInput()
IDiagramContainerUIIDiagramEditorInput 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 IDiagramContainerUIpublic IWorkbenchPartSite getSite()
IDiagramContainerUIIWorkbenchPartSite of the Eclipse
IWorkbenchPart that displays this container. E.g. for an editor
this will be the editor site.
getSite in interface IDiagramContainerUIIWorkbenchPart that is displaying the
diagram.public String getTitle()
IDiagramContainer
getTitle in interface IDiagramContainerStringpublic String getTitleToolTip()
IDiagramContainer
getTitleToolTip in interface IDiagramContainerStringpublic void doSave(IProgressMonitor monitor)
IDiagramContainer
doSave in interface IDiagramContainerpublic DiagramBehavior getDiagramBehavior()
IDiagramContainerUIDiagramBehavior instance associated with this
container.
getDiagramBehavior in interface IDiagramContainergetDiagramBehavior in interface IDiagramContainerUIDiagramBehavior instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||