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, stackChanged
changed, computeSize, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
addControlListener, 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, update
addDisposeListener, addListener, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, reskin, setData, setData, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
commandStackChanged, getActionRegistry, getEditDomain, getGraphicalViewer, getSelectionActions, hookGraphicalViewer, setEditDomain, setGraphicalViewer
isAutoScalable
public 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()
GraphicalComposite
initializeGraphicalViewer
in interface IDiagramContainerUI
#createGraphicalViewer(Composite)
public void configureGraphicalViewer()
GraphicalComposite
configureGraphicalViewer
in interface IDiagramContainerUI
public void refreshTitle()
IDiagramContainer
refreshTitle
in interface IDiagramContainer
public void refreshTitleToolTip()
IDiagramContainer
refreshTitleToolTip
in interface IDiagramContainer
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
IWorkbenchPart
that is displaying the diagram.public void close()
IDiagramContainer
close
in interface IDiagramContainer
public 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 IAdaptable
getAdapter
in class GraphicalComposite
IAdaptable.getAdapter(java.lang.Class)
public void dispose()
dispose
in class GraphicalComposite
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 dirtyisDirty
in interface IDiagramContainer
isDirty
in class GraphicalComposite
true
, if container is dirty, false
otherwiseISaveablePart.isDirty()
public PictogramElement[] getSelectedPictogramElements()
IDiagramContainer
getSelectedPictogramElements
in interface IDiagramContainer
public void selectPictogramElements(PictogramElement[] pictogramElements)
IDiagramContainer
selectPictogramElements
in interface IDiagramContainer
pictogramElements
- The pictogram elements to selectpublic void setPictogramElementForSelection(PictogramElement pictogramElement)
IDiagramContainer
setPictogramElementForSelection
in interface IDiagramContainer
pictogramElement
- The pictogram element to selectpublic void setPictogramElementsForSelection(PictogramElement[] pictogramElements)
IDiagramContainer
setPictogramElementsForSelection
in interface IDiagramContainer
pictogramElements
- The pictogram elements to selectpublic IDiagramTypeProvider getDiagramTypeProvider()
IDiagramContainer
getDiagramTypeProvider
in interface IDiagramContainer
public org.eclipse.gef.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 java.lang.String getTitle()
IDiagramContainer
getTitle
in interface IDiagramContainer
String
public java.lang.String getTitleToolTip()
IDiagramContainer
getTitleToolTip
in interface IDiagramContainer
String
public void doSave(IProgressMonitor monitor)
IDiagramContainer
doSave
in interface IDiagramContainer
public DiagramBehavior getDiagramBehavior()
IDiagramContainerUI
DiagramBehavior
instance associated with this
container.getDiagramBehavior
in interface IDiagramContainer
getDiagramBehavior
in interface IDiagramContainerUI
DiagramBehavior
instance