public class PaletteStackFactory extends PaletteEntryFactory
PaletteStack
Constructor and Description |
---|
PaletteStackFactory()
Creates a new PaletteStackFactory with label
PaletteMessages.MODEL_TYPE_STACK
|
Modifier and Type | Method and Description |
---|---|
boolean |
canCreate(PaletteEntry selected)
This method is called by the
PaletteCustomizerDialog to
determine whether to enable or disable this action on the toolbar and the
context menu. |
protected PaletteEntry |
createNewEntry(Shell shell)
Create the PaletteEntry
|
PaletteEntry |
createNewEntry(Shell shell,
PaletteEntry selected)
This method is called when a new palette entry of the type supported by
this
PaletteEntryFactory 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.
|
determineContainerForNewEntry, determineIndexForNewEntry, getImageDescriptor, getLabel, setImageDescriptor, setLabel
public PaletteStackFactory()
public boolean canCreate(PaletteEntry selected)
PaletteEntryFactory
PaletteCustomizerDialog
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
canCreate
in class PaletteEntryFactory
selected
- The selected PaletteEntry
(Will never be
null
)true
if, given the current selection, this
PaletteEntryFactory
can create a new
PaletteEntry
PaletteEntryFactory.canCreate(org.eclipse.gef.palette.PaletteEntry)
protected PaletteEntry createNewEntry(Shell shell)
PaletteEntryFactory
createNewEntry
in class PaletteEntryFactory
shell
- The Shell
of the
PaletteCustomizerDialog
; it can be used to create
another warning or information dialog.PaletteEntryFactory.createNewEntry(Shell)
public PaletteEntry createNewEntry(Shell shell, PaletteEntry selected)
PaletteEntryFactory
PaletteEntryFactory
is to be created.createNewEntry
in class PaletteEntryFactory
shell
- The Shell
of the
PaletteCustomizerDialog
selected
- The PaletteEntry
that was selected in the outline
when this action was launched. Will never be null
.PaletteEntry
PaletteEntryFactory.createNewEntry(org.eclipse.swt.widgets.Shell,
org.eclipse.gef.palette.PaletteEntry)
protected java.lang.Object determineTypeForNewEntry(PaletteEntry selected)
PaletteEntryFactory
Sub-classes may override this method.
determineTypeForNewEntry
in class PaletteEntryFactory
selected
- The selected entryPaletteEntryFactory.determineTypeForNewEntry(org.eclipse.gef.palette.PaletteEntry)
Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.