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 booleancanCreate(PaletteEntry selected)This method is called by thePaletteCustomizerDialogto determine whether to enable or disable this action on the toolbar and the context menu.protected PaletteEntrycreateNewEntry(Shell shell)Create the PaletteEntryPaletteEntrycreateNewEntry(Shell shell, PaletteEntry selected)This method is called when a new palette entry of the type supported by thisPaletteEntryFactoryis to be created.protected java.lang.ObjectdetermineTypeForNewEntry(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:PaletteEntryFactoryThis method is called by thePaletteCustomizerDialogto 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
PaletteContainers with the following user permission:PERMISSION_FULL_MODIFICATION- Overrides:
canCreatein classPaletteEntryFactory- Parameters:
selected- The selectedPaletteEntry(Will never benull)- Returns:
trueif, given the current selection, thisPaletteEntryFactorycan create a newPaletteEntry- See Also:
PaletteEntryFactory.canCreate(org.eclipse.gef.palette.PaletteEntry)
-
createNewEntry
protected PaletteEntry createNewEntry(Shell shell)
Description copied from class:PaletteEntryFactoryCreate the PaletteEntry- Specified by:
createNewEntryin classPaletteEntryFactory- Parameters:
shell- TheShellof 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:PaletteEntryFactoryThis method is called when a new palette entry of the type supported by thisPaletteEntryFactoryis to be created.- Overrides:
createNewEntryin classPaletteEntryFactory- Parameters:
shell- TheShellof thePaletteCustomizerDialogselected- ThePaletteEntrythat 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:PaletteEntryFactoryGiven the current selection, this method determines the type of the new entry to be created.Sub-classes may override this method.
- Overrides:
determineTypeForNewEntryin 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)
-
-