Class PaletteStackFactory
- java.lang.Object
-
- org.eclipse.gef.ui.palette.customize.PaletteEntryFactory
-
- org.eclipse.gef.ui.palette.customize.PaletteStackFactory
-
public class PaletteStackFactory extends PaletteEntryFactory
Factory to createPaletteStack
- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description PaletteStackFactory()
Creates a new PaletteStackFactory with label PaletteMessages.MODEL_TYPE_STACK
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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 PaletteEntryPaletteEntry
createNewEntry(Shell shell, PaletteEntry selected)
This method is called when a new palette entry of the type supported by thisPaletteEntryFactory
is to be created.protected java.lang.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
-
-
-
-
Method Detail
-
canCreate
public boolean canCreate(PaletteEntry selected)
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:
PaletteEntryFactory.canCreate(org.eclipse.gef.palette.PaletteEntry)
-
createNewEntry
protected PaletteEntry createNewEntry(Shell shell)
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:
PaletteEntryFactory.createNewEntry(Shell)
-
createNewEntry
public PaletteEntry createNewEntry(Shell shell, PaletteEntry selected)
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:
PaletteEntryFactory.createNewEntry(org.eclipse.swt.widgets.Shell, org.eclipse.gef.palette.PaletteEntry)
-
determineTypeForNewEntry
protected java.lang.Object determineTypeForNewEntry(PaletteEntry selected)
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:
PaletteEntryFactory.determineTypeForNewEntry(org.eclipse.gef.palette.PaletteEntry)
-
-