Class PaletteStackFactory
java.lang.Object
org.eclipse.gef.ui.palette.customize.PaletteEntryFactory
org.eclipse.gef.ui.palette.customize.PaletteStackFactory
Factory to create
PaletteStack
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new PaletteStackFactory with label PaletteMessages.MODEL_TYPE_STACK -
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreate
(PaletteEntry selected) This method is called by thePaletteCustomizerDialog
to determine whether to enable or disable this action on the toolbar and the context menu.protected PaletteEntry
createNewEntry
(Shell shell) Create the PaletteEntrycreateNewEntry
(Shell shell, PaletteEntry selected) This method is called when a new palette entry of the type supported by thisPaletteEntryFactory
is to be created.protected Object
determineTypeForNewEntry
(PaletteEntry selected) Given the current selection, this method determines the type of the new entry to be created.Methods inherited from class org.eclipse.gef.ui.palette.customize.PaletteEntryFactory
determineContainerForNewEntry, determineIndexForNewEntry, getImageDescriptor, getLabel, setImageDescriptor, setLabel
-
Constructor Details
-
PaletteStackFactory
public PaletteStackFactory()Creates a new PaletteStackFactory with label PaletteMessages.MODEL_TYPE_STACK
-
-
Method Details
-
canCreate
Description copied from class:PaletteEntryFactory
This method is called by thePaletteCustomizerDialog
to determine whether to enable or disable this action on the toolbar and the context menu.This default implementation allows the creation of a new entry only in
PaletteContainer
s with the following user permission:PERMISSION_FULL_MODIFICATION
- Overrides:
canCreate
in classPaletteEntryFactory
- Parameters:
selected
- The selectedPaletteEntry
(Will never benull
)- Returns:
true
if, given the current selection, thisPaletteEntryFactory
can create a newPaletteEntry
- See Also:
-
createNewEntry
Description copied from class:PaletteEntryFactory
Create the PaletteEntry- Specified by:
createNewEntry
in classPaletteEntryFactory
- Parameters:
shell
- TheShell
of thePaletteCustomizerDialog
; it can be used to create another warning or information dialog.- Returns:
- The newly created entry
- See Also:
-
createNewEntry
Description copied from class:PaletteEntryFactory
This method is called when a new palette entry of the type supported by thisPaletteEntryFactory
is to be created.- Overrides:
createNewEntry
in classPaletteEntryFactory
- Parameters:
shell
- TheShell
of thePaletteCustomizerDialog
selected
- ThePaletteEntry
that was selected in the outline when this action was launched. Will never benull
.- Returns:
- PaletteEntry The newly created
PaletteEntry
- See Also:
-
determineTypeForNewEntry
Description copied from class:PaletteEntryFactory
Given the current selection, this method determines the type of the new entry to be created.Sub-classes may override this method.
- Overrides:
determineTypeForNewEntry
in classPaletteEntryFactory
- Parameters:
selected
- The selected entry- Returns:
- The type of the new entry to be created
- See Also:
-