Class PaletteContainerFactory
- java.lang.Object
-
- org.eclipse.gef.ui.palette.customize.PaletteEntryFactory
-
- org.eclipse.gef.ui.palette.customize.PaletteContainerFactory
-
- Direct Known Subclasses:
PaletteDrawerFactory
,PaletteGroupFactory
public abstract class PaletteContainerFactory extends PaletteEntryFactory
Abstract factory forPaletteContainer
sThis class does not create
PaletteContainer
s within other PaletteContainers. The necessary methods may be overridden should such functionality be desired.
-
-
Constructor Summary
Constructors Constructor Description PaletteContainerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canCreate(PaletteEntry selected)
You can always create a new container.protected PaletteContainer
determineContainerForNewEntry(PaletteEntry selected)
Given the current selection, this method determines the parent for the new entry to be created.protected int
determineIndexForNewEntry(PaletteContainer parent, PaletteEntry selected)
Calculates the index at which the new entry is to be created, given the current selection.-
Methods inherited from class org.eclipse.gef.ui.palette.customize.PaletteEntryFactory
createNewEntry, createNewEntry, determineTypeForNewEntry, getImageDescriptor, getLabel, setImageDescriptor, setLabel
-
-
-
-
Method Detail
-
determineContainerForNewEntry
protected PaletteContainer determineContainerForNewEntry(PaletteEntry selected)
Description copied from class:PaletteEntryFactory
Given the current selection, this method determines the parent for the new entry to be created.Sub-classes may override this method.
- Overrides:
determineContainerForNewEntry
in classPaletteEntryFactory
- Parameters:
selected
- The selected entry- Returns:
- The parent of the new entry to be created
- See Also:
PaletteEntryFactory.determineContainerForNewEntry(PaletteEntry)
-
determineIndexForNewEntry
protected int determineIndexForNewEntry(PaletteContainer parent, PaletteEntry selected)
Description copied from class:PaletteEntryFactory
Calculates the index at which the new entry is to be created, given the current selection.Sub-classes may override this method.
- Overrides:
determineIndexForNewEntry
in classPaletteEntryFactory
- Parameters:
parent
- The parent containerselected
- The selected entry- Returns:
- the index at which the new entry should be added in the given container (-1 indicates add at the end)
- See Also:
PaletteEntryFactory.determineIndexForNewEntry(PaletteContainer, PaletteEntry)
-
canCreate
public boolean canCreate(PaletteEntry selected)
You can always create a new container. So, this method always returns true.- 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(PaletteEntry)
-
-