|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectGraphicalEditorWithFlyoutPalette
org.eclipse.graphiti.ui.editor.DiagramEditor
public class DiagramEditor
This is the main class for the Graphiti diagram editor. It represents the
editor to Eclipse and therefore implements IEditorPart
. The
implementation is based upon a GEF editor implementation (
GraphicalEditorWithFlyoutPalette
) and enhances it with
Graphiti-specific stuff.
This editor is registered as an Eclipse editor using the extension point
org.eclipse.ui.editors. Therefore the Eclipse standard methods can be used to
open a new diagram editor. The associated IEditorInput
object is a
subclass of DiagramEditorInput
, but using another type of input is
also ok as long as it can be adapted to an IFile that can be reolved within
the workspace of is a URIEditorInput
. These types of input objects
will be converted to a corresponding DiagramEditorInput
when the
editor is initialized (see init(IEditorSite, IEditorInput)
).
Any clients extending this class should also contribute their editor to the
Eclipse editor extension point to gain full advantage of the Eclipse editor
integration of Graphiti.
There are a lot of aspects this class needs to deal with; the larger aspects
are separated into other classes which share the lifecycle with the
DiagramEditor
instance. This means they are instantiated when a new
diagram editor is created and exist until the editor is closed again. There
are default implementations for all of these aspects, see the
Default*Behavior classes in this package. The following aspects are
separated:
DefaultMarkerBehavior
for the default implementation. Override
createMarkerBehavior()
to change the default behavior.DefaultPaletteBehavior
for the default implementation. Override
createPaletteBehaviour()
to change the default behavior.DefaultPersistencyBehavior
for the default
implementation. Override createPersistencyBehavior()
to change the
default behavior.DefaultRefreshBehavior
for the default implementation. Override
createRefreshBehavior()
to change the default behavior.DefaultMarkerBehavior
for the default implementation. Override
createMarkerBehavior()
to change the default behavior.
Field Summary | |
---|---|
private IConfigurationProvider |
configurationProvider
|
private java.lang.String |
contributorId
|
static java.lang.String |
DIAGRAM_EDITOR_ID
The ID of the DiagramEditor as it is registed with the
org.eclipse.ui.editors extension point. |
private DiagramChangeListener |
diagramChangeListener
|
private DiagramScrollingBehavior |
diagramScrollingBehavior
|
private boolean |
directEditingActive
|
private DomainModelChangeListener |
domainModelListener
|
private java.lang.String |
editorInitializationError
|
private CommandStackEventListener |
gefCommandStackListener
|
private KeyHandler |
keyHandler
|
private DefaultMarkerBehavior |
markerBehavior
|
private Point |
mouseLocation
|
private DefaultPaletteBehavior |
paletteBehaviour
|
private DefaultPersistencyBehavior |
persistencyBehavior
|
private PictogramElement[] |
pictogramElementsForSelection
|
private DefaultRefreshBehavior |
refreshBehavior
|
private DefaultUpdateBehavior |
updateBehavior
|
Constructor Summary | |
---|---|
DiagramEditor()
Creates a new diagram editor and cares about the creation of the different behavior extensions by delegating to the various create*Behavior() methods. |
Method Summary | |
---|---|
Point |
calculateRealMouseLocation(Point nativeLocation)
Calculates the mouse location depending on scrollbars and zoom factor. |
protected void |
configureGraphicalViewer()
Called to configure the editor, before it receives its content. |
protected DiagramEditorInput |
convertToDiagramEditorInput(IEditorInput input)
Is called by the init(IEditorSite, IEditorInput) method in case
the IEditorInput instance passed is no DiagramEditorInput
. |
protected ContextMenuProvider |
createContextMenuProvider()
Returns a new ContextMenuProvider . |
private void |
createErrorPartControl(Composite parent)
|
protected void |
createGraphicalViewer(Composite parent)
Creates the GraphicalViewer on the specified Composite and
initializes it. |
protected DefaultMarkerBehavior |
createMarkerBehavior()
Creates the behavior extension that deals with markers. |
protected DefaultPaletteBehavior |
createPaletteBehaviour()
Creates the behavior extension that deals with the palette handling. |
protected PaletteViewerProvider |
createPaletteViewerProvider()
Delegates to the method (or the method in a subclass of) #createPaletteViewerProvider() to create the
PaletteViewerProvider used inside the GEF editor. |
void |
createPartControl(Composite parent)
Creates the UI of the editor by delegating to the super.createPartControl method. |
protected DefaultPersistencyBehavior |
createPersistencyBehavior()
Creates the behavior extension that deals with the persistence handling. |
protected DefaultRefreshBehavior |
createRefreshBehavior()
Creates the behavior extension that deals with the refresh handling. |
protected DefaultUpdateBehavior |
createUpdateBehavior()
Creates the behavior extension that deals with the update handling. |
void |
disableAdapters()
Should be called (e.g. |
void |
dispose()
Disposes this DiagramEditor instance and frees all used resources
and clears all references. |
void |
doSave(IProgressMonitor monitor)
Called to perform the saving of the editor. |
void |
editingDomainInitialized()
Hook that is called by the holder of the TransactionalEditingDomain (DefaultUpdateBehavior or a
subclass of it) after the editing domain has been initialized. |
void |
enableAdapters()
Should be called by the various behavior instances after mass EMF resource operations have been triggered (e.g. |
java.lang.Object |
executeFeature(IFeature feature,
IContext context)
Executes the given IFeature with the given IContext in
the scope of this DiagramEditor , meaning within its
TransactionalEditingDomain and on its
CommandStack . |
java.lang.Object |
getAdapter(java.lang.Class type)
Implements the Eclipse IAdaptable interface. |
protected KeyHandler |
getCommonKeyHandler()
Returns the KeyHandler with common bindings to be used for both the Outline and the Graphical Viewer. |
protected IConfigurationProvider |
getConfigurationProvider()
Returns the IConfigurationProvider instance used with this
editor; the interface provides access to most of the Graphiti editor
description means like IDiagramTypeProvider and
IToolBehaviorProvider . |
EditPart |
getContentEditPart()
Returns the contents EditPart of this Editor. |
java.lang.String |
getContributorId()
Returns the ID for contributions in the tabbed property sheets by delegating to the method IToolBehaviorProvider.getContributorId()
. |
private DiagramScrollingBehavior |
getDiagramScrollingBehavior()
Deprecated. Scroll bar based infinite canvas is a workaround for GEF limitations. |
IDiagramTypeProvider |
getDiagramTypeProvider()
Returns the IDiagramTypeProvider instance associated with this
DiagramEditor . |
DefaultEditDomain |
getEditDomain()
Returns the GEF edit domain as needed for some of the feature functionality in Graphiti; simply a public rewrite of the GEF editor super method. |
TransactionalEditingDomain |
getEditingDomain()
Returns the EMF TransactionalEditingDomain used within this
editor by delegating to the update behavior extension, by default
DefaultUpdateBehavior.getEditingDomain() . |
GraphicalEditPart |
getEditPartForPictogramElement(PictogramElement pe)
Method to retrieve the GEF EditPart for a given
PictogramElement . |
private FigureCanvas |
getFigureCanvas()
|
IFigure |
getFigureForPictogramElement(PictogramElement pe)
Method to retrieve the Draw2D IFigure for a given
PictogramElement . |
private GFFigureCanvas |
getGFFigureCanvas()
|
GraphicalViewer |
getGraphicalViewer()
Returns the GEF GraphicalViewer as it is needed in some Graphiti
feature implementations. |
Point |
getMouseLocation()
Gets the current mouse location as a Point . |
protected FlyoutPreferences |
getPalettePreferences()
Delegates to the method (or the method in a subclass of) DefaultPaletteBehavior.getPalettePreferences() . |
protected PaletteRoot |
getPaletteRoot()
Returns the PaletteRoot to use in the GEF editor by delegating to
DefaultPaletteBehavior.getPaletteRoot() . |
protected PictogramElement[] |
getPictogramElementsForSelection()
Returns the PictogramElement s that are set for later selection. |
DefaultRefreshBehavior |
getRefreshBehavior()
Returns the instance of the refresh behavior that is used with this editor. |
ResourceSet |
getResourceSet()
The EMF ResourceSet used within this DiagramEditor . |
PictogramElement[] |
getSelectedPictogramElements()
Returns the PictogramElement s that are currently selected in the
diagram editor. |
java.lang.String |
getTitleToolTip()
Returns the tooltip that shall be displayed when hovering over the editor title tab. |
private IToolBehaviorProvider |
getToolBehaviorProvider()
|
DefaultUpdateBehavior |
getUpdateBehavior()
Returns the instance of the update behavior that is used with this editor. |
double |
getZoomLevel()
Returns the zoom level currently used in the editor. |
void |
init(IEditorSite site,
IEditorInput input)
Does the initialization of the editor. |
protected void |
initActionRegistry(ZoomManager zoomManager)
Initializes the action registry with the predefined actions (update, remove, delete, copy, paste, zooming, direct editing, alignment and toggling actions for the diagram grip and hiding of the context button pad. |
protected void |
initializeGraphicalViewer()
Called to initialize the editor with its content. |
boolean |
isAlive()
Checks if this editor is alive. |
boolean |
isDirectEditingActive()
Returns if direct editing is currently active for this editor. |
boolean |
isDirty()
Returns if the editor is currently dirty and needs to be saved or not. |
protected void |
migrateDiagramModelIfNecessary()
We provide migration from 0.8.0 to 0.9.0. |
void |
refresh()
Triggers a complete refresh of the editor (content, title, tooltip, palette and decorators) by delegating to DefaultRefreshBehavior.refresh() . |
void |
refreshContent()
Refreshes the content of the editor (what's shown inside the diagram itself). |
void |
refreshPalette()
Refreshes to palette to correctly reflect all available creation tools for the available create features and the currently enabled selection tools |
void |
refreshRenderingDecorators(PictogramElement pe)
Refreshes the rendering decorators (image decorators and the like) by delegating to DefaultRefreshBehavior.refreshRenderingDecorators(PictogramElement)
for the given PictogramElement . |
void |
refreshTitle()
Refreshes the editor title to show the name of the diagram |
void |
refreshTitleToolTip()
Refreshes the tooltip displayed for the editor title tab according to what is returned in getTitleToolTip() . |
protected void |
registerAction(IAction action)
Registers the given action with the Eclipse ActionRegistry . |
protected void |
registerBusinessObjectsListener()
Hook that is called to register listeners for changes of the business objects (domain objects) in the resource set of the editor. |
protected void |
registerDiagramResourceSetListener()
Hook to register listeners for diagram changes. |
void |
selectBufferedPictogramElements()
Triggers the selection for the PictogramElement s that are stored
for later selection. |
void |
selectionChanged(IWorkbenchPart part,
ISelection selection)
Handles a selection changed event that is triggered by any selection source, e.g. |
void |
selectPictogramElements(PictogramElement[] pictogramElements)
Selects the given PictogramElement s in the diagram. |
private void |
setConfigurationProvider(IConfigurationProvider configurationProvider)
|
void |
setDirectEditingActive(boolean directEditingActive)
Sets that direct editing is now active in the editor or not. |
void |
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() . |
protected void |
setInput(IEditorInput input)
Sets the given IEditorInput object as the input for this editor. |
private void |
setMouseLocation(int x,
int y)
|
void |
setPictogramElementForSelection(PictogramElement pictogramElement)
Sets one PictogramElement for later selection. |
void |
setPictogramElementsForSelection(PictogramElement[] pictogramElements)
Sets PictogramElement s for later selection. |
protected boolean |
shouldRegisterContextMenu()
Allows subclasses to prevent that the diagram context menu should be registered for extensions at Eclipse. |
protected void |
unregisterBusinessObjectsListener()
Hook that is called to unregister the listeners for changes of the business objects (domain objects). |
protected void |
unregisterDiagramResourceSetListener()
Hook to unregister the listeners for diagram changes. |
void |
updateDirtyState()
Updates the UI to correctly reflect the dirty state of the editor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DIAGRAM_EDITOR_ID
DiagramEditor
as it is registed with the
org.eclipse.ui.editors extension point.
private final DefaultUpdateBehavior updateBehavior
private final DefaultPaletteBehavior paletteBehaviour
private final DefaultPersistencyBehavior persistencyBehavior
private final DefaultMarkerBehavior markerBehavior
private final DefaultRefreshBehavior refreshBehavior
private CommandStackEventListener gefCommandStackListener
private DiagramChangeListener diagramChangeListener
private DomainModelChangeListener domainModelListener
private DiagramScrollingBehavior diagramScrollingBehavior
private PictogramElement[] pictogramElementsForSelection
private java.lang.String contributorId
private IConfigurationProvider configurationProvider
private KeyHandler keyHandler
private Point mouseLocation
private boolean directEditingActive
private java.lang.String editorInitializationError
Constructor Detail |
---|
public DiagramEditor()
Method Detail |
---|
protected DefaultMarkerBehavior createMarkerBehavior()
DefaultMarkerBehavior
for details and the default implementation.
Override to change the marker behavior.
DefaultMarkerBehavior
protected DefaultUpdateBehavior createUpdateBehavior()
DefaultUpdateBehavior
for details and the default implementation.
Override to change the update behavior.
DefaultUpdateBehavior
public final DefaultUpdateBehavior getUpdateBehavior()
createUpdateBehavior()
.
DefaultUpdateBehavior
.protected DefaultPaletteBehavior createPaletteBehaviour()
DefaultPaletteBehavior
for details and the default
implementation. Override to change the palette behavior.
DefaultPaletteBehavior
protected DefaultPersistencyBehavior createPersistencyBehavior()
DefaultPersistencyBehavior
for details and the default
implementation. Override to change the persistence behavior.
DefaultPersistencyBehavior
protected DefaultRefreshBehavior createRefreshBehavior()
DefaultRefreshBehavior
for details and the default
implementation. Override to change the refresh behavior.
DefaultRefreshBehavior
public final DefaultRefreshBehavior getRefreshBehavior()
createRefreshBehavior()
.
DefaultRefreshBehavior
.public void editingDomainInitialized()
TransactionalEditingDomain
(DefaultUpdateBehavior
or a
subclass of it) after the editing domain has been initialized. Can be
used to e.g. register additional listeners on the domain.
public void disableAdapters()
enableAdapters()
as well.enableAdapters()
after the operation has finished (best in a
finally clause to do that also in case of exceptions), otherwise strange
errors may happen.
public void enableAdapters()
disableAdapters()
as well.disableAdapters()
has been called and the
operation has finshed (best in a finally clause to also enable the
exception case), otherwise strange errors may occur within the editor.
public void init(IEditorSite site, IEditorInput input) throws PartInitException
IEditorInput
to a
DiagramEditorInput
. In case this fails, a
PartInitException
is thrown.DefaultUpdateBehavior.createEditingDomain()
for
detailssuper.init(site, input)
.
site
- the Eclipse IEditorSite
that will host this editorinput
- the editor input that shall be used. Note that this method
will exchange the input instance in case it is no
DiagramEditorInput
.
PartInitException
org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput)
protected DiagramEditorInput convertToDiagramEditorInput(IEditorInput input) throws PartInitException
init(IEditorSite, IEditorInput)
method in case
the IEditorInput
instance passed is no DiagramEditorInput
. This method should try to convert the passed input object to a
DiagramEditorInput
or throw an PartInitException
in case
the conversion can (or should) not be done for any reason. The default
implementation uses the
EditorInputAdapter.adaptToDiagramEditorInput(IEditorInput)
method
to do the conversion. Clients may adapt to do additional conversions or
to prohibit any conversion by simply throwing a PartInitException
.
input
- the original input
DiagramEditorInput
corresponding to the passed input
instance in case a conversion is possible. This method must not
return null
, otherwise the editor initialization
will fail.
PartInitException
- in case the passed input object cannot or should not be
converted to a DiagramEditorInput
instance.protected void setInput(IEditorInput input)
IEditorInput
object as the input for this editor.
It must be of type DiagramEditorInput
otherwise an
IllegalArgumentException
is thrown.Resource
the input points to, sets the ID of the
IDiagramTypeProvider
for the diagram given in the input,
registers listeners (by delegating to
registerDiagramResourceSetListener()
and
registerBusinessObjectsListener()
) and does the refreshing of
the editor UI.
input
- the DiagramEditorInput
instance to use within this
editor.protected void initActionRegistry(ZoomManager zoomManager)
zoomManager
- the GEF zoom manager to usepublic void createPartControl(Composite parent)
super.createPartControl
method. The default implementation
here also registers the command stack listener to correctly reflect the
dirty state of the editor.
private void createErrorPartControl(Composite parent)
protected void createGraphicalViewer(Composite parent)
Composite
and
initializes it.
parent
- the parent compositeprotected void initializeGraphicalViewer()
org.eclipse.gef.ui.parts.GraphicalEditorWithFlyoutPalette#initializeGraphicalViewer()
protected void configureGraphicalViewer()
org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
public void updateDirtyState()
IEditorPart#PROP_DIRTY
property change.
public void doSave(IProgressMonitor monitor)
DefaultPersistencyBehavior.saveDiagram(IProgressMonitor)
.
monitor
- the Eclipse progress monitor to report progress with.public boolean isDirty()
DefaultPersistencyBehavior.isDirty()
.
isDirty
in interface IDiagramEditor
true
in case the editor is dirty, false
otherwise.protected final PaletteViewerProvider createPaletteViewerProvider()
#createPaletteViewerProvider()
to create the
PaletteViewerProvider
used inside the GEF editor.
PaletteViewerProvider
to useprotected final FlyoutPreferences getPalettePreferences()
DefaultPaletteBehavior.getPalettePreferences()
. To change the
palette override the behavior there.
PaletteViewerProvider
preferences to use.protected final PaletteRoot getPaletteRoot()
PaletteRoot
to use in the GEF editor by delegating to
DefaultPaletteBehavior.getPaletteRoot()
.
PaletteRoot
to usepublic final void refreshPalette()
refreshPalette
in interface IDiagramEditor
protected ContextMenuProvider createContextMenuProvider()
ContextMenuProvider
. Clients can return null, if no
context-menu shall be displayed.
ContextMenuProvider
.protected boolean shouldRegisterContextMenu()
true
). By returning false
any extension of the
context menu can be prevented.
For details see Bugzilla 345347 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=345347).
true
in case extensions shall be allowed (default),
false
otherwise.protected void registerDiagramResourceSetListener()
unregisterDiagramResourceSetListener()
.
protected void registerBusinessObjectsListener()
DomainModelChangeListener
.unregisterBusinessObjectsListener()
.
protected void unregisterDiagramResourceSetListener()
registerDiagramResourceSetListener()
protected void unregisterBusinessObjectsListener()
registerBusinessObjectsListener()
public void refreshTitle()
refreshTitle
in interface IDiagramEditor
public void refreshTitleToolTip()
getTitleToolTip()
.
refreshTitleToolTip
in interface IDiagramEditor
public void refresh()
DefaultRefreshBehavior.refresh()
.
refresh
in interface IDiagramEditor
public void refreshContent()
public void refreshRenderingDecorators(PictogramElement pe)
DefaultRefreshBehavior.refreshRenderingDecorators(PictogramElement)
for the given PictogramElement
.
refreshRenderingDecorators
in interface IDiagramEditor
pe
- the PictogramElement
for which the decorators shall be
refreshed.public java.lang.Object getAdapter(java.lang.Class type)
IAdaptable
interface. This implementation
first delegates to the IToolBehaviorProvider.getAdapter(Class)
method and checks if something is returned. In case the return value is
null
it returns adapters for ZoomManager,
IPropertySheetPage, Diagram, KeyHandler, SelectionSynchronizer and
IContextButtonManager. It also delegates to the super implementation in
GraphicalEditorWithFlyoutPalette#getAdapter(Class)
.
type
- the type to which shall be adapted
public void dispose()
DiagramEditor
instance and frees all used resources
and clears all references. Also delegates to all the behavior extensions
to also free their resources (e.g. and most important is the
TransactionalEditingDomain
held by the
DefaultPersistencyBehavior
. Always delegate to
super.dispose()
in case you override this method!
public void setFocus()
DefaultUpdateBehavior.handleActivate()
.
public PictogramElement[] getSelectedPictogramElements()
PictogramElement
s that are currently selected in the
diagram editor.
getSelectedPictogramElements
in interface IDiagramEditor
PictogramElement
s.public void selectionChanged(IWorkbenchPart part, ISelection selection)
MultiPageEditorPart
with an opened diagram editor inside, tries to find any
PictogramElement
for the objects in the selection and selects
them in the diagram.CommonNavigator
as event source, its
editor linking mechanism must be enabled.
part
- the source IWorkbenchPart
that triggered the eventselection
- the new selection (mostly a IStructuredSelection
instance.public void selectPictogramElements(PictogramElement[] pictogramElements)
PictogramElement
s in the diagram.
selectPictogramElements
in interface IDiagramEditor
pictogramElements
- an array of PictogramElement
s to select.protected PictogramElement[] getPictogramElementsForSelection()
PictogramElement
s that are set for later selection.
The methods getPictogramElementsForSelection()
,
setPictogramElementForSelection(PictogramElement)
,
setPictogramElementsForSelection(PictogramElement[])
and
selectBufferedPictogramElements()
offer the possibility to use a
deferred selection mechanism: via the setters, PictogramElement
s
can be stored for a selection operation that is triggered lateron during
a general refresh via the method
selectBufferedPictogramElements()
. This mechanism is used e.g.
in the Graphiti framework in direct editing to restore the previous
selection, but can also be used by clients.
PictogramElement
s stored for later selectionpublic void setPictogramElementForSelection(PictogramElement pictogramElement)
PictogramElement
for later selection.
The methods getPictogramElementsForSelection()
,
setPictogramElementForSelection(PictogramElement)
,
setPictogramElementsForSelection(PictogramElement[])
and
selectBufferedPictogramElements()
offer the possibility to use a
deferred selection mechanism: via the setters, PictogramElement
s
can be stored for a selection operation that is triggered lateron during
a general refresh via the method
selectBufferedPictogramElements()
. This mechanism is used e.g.
in the Graphiti framework in direct editing to restore the previous
selection, but can also be used by clients.
setPictogramElementForSelection
in interface IDiagramEditor
pictogramElement
- the PictogramElement
that shall be stored for later
selectionpublic void setPictogramElementsForSelection(PictogramElement[] pictogramElements)
PictogramElement
s for later selection.
The methods getPictogramElementsForSelection()
,
setPictogramElementForSelection(PictogramElement)
,
setPictogramElementsForSelection(PictogramElement[])
and
selectBufferedPictogramElements()
offer the possibility to use a
deferred selection mechanism: via the setters, PictogramElement
s
can be stored for a selection operation that is triggered lateron during
a general refresh via the method
selectBufferedPictogramElements()
. This mechanism is used e.g.
in the Graphiti framework in direct editing to restore the previous
selection, but can also be used by clients.
setPictogramElementsForSelection
in interface IDiagramEditor
pictogramElements
- the PictogramElement
s that shall be stored for later
selectionpublic void selectBufferedPictogramElements()
PictogramElement
s that are stored
for later selection. Can be called e.g during a general refresh of the
editor or after another operation needing another selection is finished
(an example in the framework is direct editing).
The methods getPictogramElementsForSelection()
,
setPictogramElementForSelection(PictogramElement)
,
setPictogramElementsForSelection(PictogramElement[])
and
selectBufferedPictogramElements()
offer the possibility to use a
deferred selection mechanism: via the setters, PictogramElement
s
can be stored for a selection operation that is triggered lateron during
a general refresh via the method
selectBufferedPictogramElements()
. This mechanism is used e.g.
in the Graphiti framework in direct editing to restore the previous
selection, but can also be used by clients.
public Point getMouseLocation()
Point
.
public Point calculateRealMouseLocation(Point nativeLocation)
nativeLocation
- the native location given as Point
Point
of the real mouse locationprivate void setMouseLocation(int x, int y)
protected KeyHandler getCommonKeyHandler()
protected IConfigurationProvider getConfigurationProvider()
IConfigurationProvider
instance used with this
editor; the interface provides access to most of the Graphiti editor
description means like IDiagramTypeProvider
and
IToolBehaviorProvider
.
Note however that the IConfigurationProvider
interface is not
part of the official API in Graphiti 0.9; so useing this method and the
returned interface will result in compilation warnings. This issue will
be resolved with Graphiti 0.10 where the interface is split into a public
(being part of the API) and an internal part. For details see Bugzilla
383768.
IConfigurationProvider
that is used
within this editor.public EditPart getContentEditPart()
EditPart
of this Editor. This is the topmost
EditPart in the GraphicalViewer
.
EditPart
of this Editor.public java.lang.String getContributorId()
IToolBehaviorProvider.getContributorId()
.
String
@Deprecated private DiagramScrollingBehavior getDiagramScrollingBehavior()
DefaultToolBehaviorProvider.getDiagramScrollingBehavior()
public IDiagramTypeProvider getDiagramTypeProvider()
IDiagramTypeProvider
instance associated with this
DiagramEditor
. There is always a 1:1 relation between the editor
and the provider.
getDiagramTypeProvider
in interface IDiagramEditor
IDiagramTypeProvider
instance.public DefaultEditDomain getEditDomain()
DefaultEditDomain
used in this editorGraphicalEditor#getEditDomain()
public GraphicalEditPart getEditPartForPictogramElement(PictogramElement pe)
EditPart
for a given
PictogramElement
.
pe
- the PictogramElement
to retrieve the GEF
representation for
GraphicalEditPart
that represents the given
PictogramElement
.public IFigure getFigureForPictogramElement(PictogramElement pe)
IFigure
for a given
PictogramElement
.
pe
- the PictogramElement
to retrieve the Draw2D
representation for
IFigure
that represents the given
PictogramElement
.private FigureCanvas getFigureCanvas()
private GFFigureCanvas getGFFigureCanvas()
public GraphicalViewer getGraphicalViewer()
GraphicalViewer
as it is needed in some Graphiti
feature implementations. This is simply a public rewrite of the according
super method.
GraphicalViewer
used within this editor instanceGraphicalEditor#getGraphicalViewer()
public java.lang.String getTitleToolTip()
String
private IToolBehaviorProvider getToolBehaviorProvider()
public double getZoomLevel()
protected void migrateDiagramModelIfNecessary()
public boolean isAlive()
true
, if editor contains a model connector and a
valid Diagram, false
otherwise.protected void registerAction(IAction action)
ActionRegistry
.
action
- the action to registerprivate void setConfigurationProvider(IConfigurationProvider configurationProvider)
public boolean isDirectEditingActive()
true
in case direct editing is currently active
within this editor, false
otherwise.public void setDirectEditingActive(boolean directEditingActive)
true
does not actually start direct editing
it is simply an indication that prevents certain operations from running
(e.g. refresh)
directEditingActive
- true
to set the flag to direct editing currently
active, false
otherwise.public TransactionalEditingDomain getEditingDomain()
TransactionalEditingDomain
used within this
editor by delegating to the update behavior extension, by default
DefaultUpdateBehavior.getEditingDomain()
.
getEditingDomain
in interface IDiagramEditor
TransactionalEditingDomain
instance used in the
editorpublic java.lang.Object executeFeature(IFeature feature, IContext context)
IFeature
with the given IContext
in
the scope of this DiagramEditor
, meaning within its
TransactionalEditingDomain
and on its
CommandStack
.
executeFeature
in interface IDiagramEditor
feature
- the feature to executecontext
- the context to use. In case the passed feature is a
IAddFeature
this context needs to be an instance of
IAddContext
, otherwise an
AssertionFailedException
will be thrown.
IAddFeature
being passed as feature the
newly added PictogramElement
will be returned (in case
the add method returning it), in all other cases
null
public ResourceSet getResourceSet()
ResourceSet
used within this DiagramEditor
. The
resource set is always associated in a 1:1 releation to the
TransactionalEditingDomain
.
getResourceSet
in interface IDiagramEditor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |