public class DiagramComposite extends GraphicalComposite implements IDiagramContainerUI
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.DIAGRAM_CONTEXT_ID| Constructor and Description |
|---|
DiagramComposite(Composite parent,
int style) |
DiagramComposite(IWorkbenchPart ownedPart,
Composite parent,
int style) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
disableAdapters() |
void |
dispose() |
void |
doSave(IProgressMonitor monitor)
Triggers that the diagram model is persisted.
|
void |
editingDomainInitialized() |
void |
enableAdapters() |
java.lang.Object |
getAdapter(java.lang.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.
|
org.eclipse.gef.GraphicalEditPart |
getEditPartForPictogramElement(PictogramElement pe) |
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. |
java.lang.String |
getTitle()
Gets the title for the container that is displaying the diagram.
|
java.lang.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(org.eclipse.emf.transaction.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.
|
commandStackChanged, createControl, getActionRegistry, getEditDomain, getGraphicalViewer, getSelectionActions, hookGraphicalViewer, selectionChanged, setEditDomain, setGraphicalViewer, stackChangedchanged, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabListcomputeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBaraddControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, updateaddDisposeListener, addListener, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitcommandStackChanged, getActionRegistry, getEditDomain, getGraphicalViewer, getSelectionActions, hookGraphicalViewer, setEditDomain, setGraphicalViewerisAutoScalablepublic DiagramComposite(IWorkbenchPart ownedPart, Composite parent, int style)
public DiagramComposite(Composite parent, int style)
public void setInput(IDiagramEditorInput input)
public void setInput(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
IDiagramEditorInput input)
public void initializeGraphicalViewer()
GraphicalCompositeinitializeGraphicalViewer in interface IDiagramContainerUI#createGraphicalViewer(Composite)public void configureGraphicalViewer()
GraphicalCompositeconfigureGraphicalViewer in interface IDiagramContainerUIpublic void refreshTitle()
IDiagramContainerrefreshTitle in interface IDiagramContainerpublic void refreshTitleToolTip()
IDiagramContainerrefreshTitleToolTip 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 IDiagramContainerUIIWorkbenchPart that is displaying the diagram.public void close()
IDiagramContainerclose in interface IDiagramContainerpublic java.lang.Object getAdapter(java.lang.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 interface IAdaptablegetAdapter in class GraphicalCompositeIAdaptable.getAdapter(java.lang.Class)public void dispose()
dispose in class GraphicalCompositeIWorkbenchPart.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 dirtyisDirty in interface IDiagramContainerisDirty in class GraphicalCompositetrue, if container is dirty, false
otherwiseISaveablePart.isDirty()public PictogramElement[] getSelectedPictogramElements()
IDiagramContainergetSelectedPictogramElements in interface IDiagramContainerpublic void selectPictogramElements(PictogramElement[] pictogramElements)
IDiagramContainerselectPictogramElements in interface IDiagramContainerpictogramElements - The pictogram elements to selectpublic void setPictogramElementForSelection(PictogramElement pictogramElement)
IDiagramContainersetPictogramElementForSelection in interface IDiagramContainerpictogramElement - The pictogram element to selectpublic void setPictogramElementsForSelection(PictogramElement[] pictogramElements)
IDiagramContainersetPictogramElementsForSelection in interface IDiagramContainerpictogramElements - The pictogram elements to selectpublic IDiagramTypeProvider getDiagramTypeProvider()
IDiagramContainergetDiagramTypeProvider in interface IDiagramContainerpublic org.eclipse.gef.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 java.lang.String getTitle()
IDiagramContainergetTitle in interface IDiagramContainerStringpublic java.lang.String getTitleToolTip()
IDiagramContainergetTitleToolTip in interface IDiagramContainerStringpublic void doSave(IProgressMonitor monitor)
IDiagramContainerdoSave in interface IDiagramContainerpublic DiagramBehavior getDiagramBehavior()
IDiagramContainerUIDiagramBehavior instance associated with this
container.getDiagramBehavior in interface IDiagramContainergetDiagramBehavior in interface IDiagramContainerUIDiagramBehavior instance