|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.graphiti.ui.editor.DefaultPaletteBehavior
public class DefaultPaletteBehavior
This class can be subclassed by clients to adapt the palette appearance and
behavior of the Graphiti diagram Editor. The API is very much aligned with
the way GEF handles the palette within its editors, see
GraphicalEditorWithFlyoutPalette
for more information on that. To
exchange the default implementation you have to return an instance of your
subclass in the method DiagramEditor.createPaletteBehaviour()
.
Note that there is always a 1:1 relation with a DiagramEditor
.
Field Summary | |
---|---|
protected static int |
DEFAULT_PALETTE_SIZE
The initial size of the palette. |
protected DiagramEditor |
diagramEditor
The associated DiagramEditor |
private PaletteRoot |
paletteRoot
|
protected static java.lang.String |
PROPERTY_PALETTE_DOCK_LOCATION
Property name for storing the location (east, west) of the palette within the editor in an Eclipse preference store. |
protected static java.lang.String |
PROPERTY_PALETTE_SIZE
Property name for storing the size of the palette within the editor in an Eclipse preference store. |
protected static java.lang.String |
PROPERTY_PALETTE_STATE
Property name for storing the state (collapsed, expanded, hidden) of the palette within the editor in an Eclipse preference store. |
Constructor Summary | |
---|---|
DefaultPaletteBehavior(DiagramEditor diagramEditor)
Creates a new standard palette behaviour for a Graphiti diagram editor. |
Method Summary | |
---|---|
protected PaletteRoot |
createPaletteRoot()
Creates the PaletteRoot of this editor. |
protected PaletteViewerProvider |
createPaletteViewerProvider()
Returns the PaletteViewerProvider, which can be used to create a new PaletteViewer. |
void |
dispose()
Disposes this instance. |
protected DiagramEditor |
getDiagramEditor()
Returns the associated Graphiti diagram editor. |
FlyoutPreferences |
getPalettePreferences()
Returns the Graphiti specific preferences for the palette. |
PaletteRoot |
getPaletteRoot()
Returns the already existing PaletteRoot instance for the
DiagramEditor associated the this palette behavior or creates a
new PaletteRoot instance in case none exists. |
private IPreferenceStore |
getPreferenceStore()
|
void |
initializeViewer()
Initializes the used GEF palette viewer to display the palette as defined. |
void |
refreshPalette()
Refreshes the palette. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String PROPERTY_PALETTE_DOCK_LOCATION
protected static final java.lang.String PROPERTY_PALETTE_SIZE
protected static final java.lang.String PROPERTY_PALETTE_STATE
protected static final int DEFAULT_PALETTE_SIZE
protected final DiagramEditor diagramEditor
DiagramEditor
private PaletteRoot paletteRoot
Constructor Detail |
---|
public DefaultPaletteBehavior(DiagramEditor diagramEditor)
DiagramEditor
is closely linked to this instance (1:1
relation) and both instances will have a common lifecycle.
diagramEditor
- The associated DiagramEditor
.Method Detail |
---|
protected PaletteRoot createPaletteRoot()
PaletteRoot
of this editor. To retrieve the
PaletteRoot
object use getPaletteRoot()
instead which
will return an already existing instance or create a new one by
delegating to this method.
PaletteRoot
instanceorg.eclipse.graphiti.ui.editor.GraphicalEditorIncludingPalette#getPaletteRoot()
public PaletteRoot getPaletteRoot()
PaletteRoot
instance for the
DiagramEditor
associated the this palette behavior or creates a
new PaletteRoot
instance in case none exists.
PaletteRoot
instancepublic void initializeViewer()
DefaultPaletteViewerPreferences
and triggers a refresh of
the palette.
public FlyoutPreferences getPalettePreferences()
GraphicalEditorWithFlyoutPalette
during
initialization.
FlyoutPreferences
.protected PaletteViewerProvider createPaletteViewerProvider()
By default this method returns a new PaletteViewerProvider.
public void refreshPalette()
public void dispose()
paletteRoot
reference.
protected DiagramEditor getDiagramEditor()
DiagramEditor
instanceprivate IPreferenceStore getPreferenceStore()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |