Package org.eclipse.gef.palette
Class PaletteDrawer
- java.lang.Object
-
- org.eclipse.gef.palette.PaletteEntry
-
- org.eclipse.gef.palette.PaletteContainer
-
- org.eclipse.gef.palette.PaletteDrawer
-
public class PaletteDrawer extends PaletteContainer
A PaletteDrawer is a collapsible container that can have other non-container palette entries.
-
-
Field Summary
Fields Modifier and Type Field Description static intINITIAL_STATE_CLOSEDConstants indicating the possible initial states for a drawer: INITIAL_STATE_OPEN - The drawer is expanded when the palette is created. INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created. INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.static intINITIAL_STATE_OPENConstants indicating the possible initial states for a drawer: INITIAL_STATE_OPEN - The drawer is expanded when the palette is created. INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created. INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.static intINITIAL_STATE_PINNED_OPENConstants indicating the possible initial states for a drawer: INITIAL_STATE_OPEN - The drawer is expanded when the palette is created. INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created. INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.static intINITIAL_STATUS_PINNED_OPENDeprecated.static java.lang.ObjectPALETTE_TYPE_DRAWERThe type for this PaletteEntry.static java.lang.StringPROPERTY_INITIAL_STATUSProperty name used when notification about a change in the drawer's initial state is fired.-
Fields inherited from class org.eclipse.gef.palette.PaletteContainer
children, PROPERTY_CHILDREN
-
Fields inherited from class org.eclipse.gef.palette.PaletteEntry
listeners, PALETTE_TYPE_UNKNOWN, PERMISSION_FULL_MODIFICATION, PERMISSION_HIDE_ONLY, PERMISSION_LIMITED_MODIFICATION, PERMISSION_NO_MODIFICATION, PROPERTY_DEFAULT, PROPERTY_DESCRIPTION, PROPERTY_LABEL, PROPERTY_LARGE_ICON, PROPERTY_PARENT, PROPERTY_SMALL_ICON, PROPERTY_TYPE, PROPERTY_VISIBLE
-
-
Constructor Summary
Constructors Constructor Description PaletteDrawer(java.lang.String label)ConstructorPaletteDrawer(java.lang.String label, ImageDescriptor icon)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptsType(java.lang.Object type)Returns true if this type can be a child of this containerjava.lang.ObjectgetDrawerType()intgetInitialState()booleanisInitiallyOpen()booleanisInitiallyPinned()voidsetDrawerType(java.lang.Object obj)DrawerType indicates whether a drawer will contain ToolEntries of PaletteTemplateEntries.voidsetInitialState(int state)Sets the initial state of this drawer (i.e. the state that this drawer should be when the palette is created).voidsetShowDefaultIcon(boolean showDefaultIcon)Should the default icon be shown for this drawer if no icon is set?booleanshowDefaultIcon()Should the default icon be shown for this drawer if no icon is set?-
Methods inherited from class org.eclipse.gef.palette.PaletteContainer
add, add, addAll, appendToSection, getChildren, moveDown, moveUp, remove, setChildren, toString
-
Methods inherited from class org.eclipse.gef.palette.PaletteEntry
addPropertyChangeListener, getDescription, getId, getLabel, getLargeIcon, getParent, getSmallIcon, getType, getUserModificationPermission, isVisible, removePropertyChangeListener, setDescription, setId, setLabel, setLargeIcon, setParent, setSmallIcon, setType, setUserModificationPermission, setVisible
-
-
-
-
Field Detail
-
PALETTE_TYPE_DRAWER
public static final java.lang.Object PALETTE_TYPE_DRAWER
The type for this PaletteEntry.- See Also:
PaletteEntry.getType()
-
PROPERTY_INITIAL_STATUS
public static final java.lang.String PROPERTY_INITIAL_STATUS
Property name used when notification about a change in the drawer's initial state is fired.- See Also:
- Constant Field Values
-
INITIAL_STATE_OPEN
public static final int INITIAL_STATE_OPEN
Constants indicating the possible initial states for a drawer:- INITIAL_STATE_OPEN - The drawer is expanded when the palette is created.
- INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created.
- INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.
- See Also:
- Constant Field Values
-
INITIAL_STATE_CLOSED
public static final int INITIAL_STATE_CLOSED
Constants indicating the possible initial states for a drawer:- INITIAL_STATE_OPEN - The drawer is expanded when the palette is created.
- INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created.
- INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.
- See Also:
- Constant Field Values
-
INITIAL_STATE_PINNED_OPEN
public static final int INITIAL_STATE_PINNED_OPEN
Constants indicating the possible initial states for a drawer:- INITIAL_STATE_OPEN - The drawer is expanded when the palette is created.
- INITIAL_STATE_CLOSED - The drawer is collapsed when the palette is created.
- INITIAL_STATE_PINNED_OPEN - The drawer is pinned open (which would prevent it from being collapsed automatically) when the palette is created.
- See Also:
- Constant Field Values
-
INITIAL_STATUS_PINNED_OPEN
public static final int INITIAL_STATUS_PINNED_OPEN
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PaletteDrawer
public PaletteDrawer(java.lang.String label)
Constructor- Parameters:
label- The name/label for this entry
-
PaletteDrawer
public PaletteDrawer(java.lang.String label, ImageDescriptor icon)Constructor- Parameters:
label- The name/label for this entryicon- An icon for this drawer
-
-
Method Detail
-
acceptsType
public boolean acceptsType(java.lang.Object type)
Returns true if this type can be a child of this container- Overrides:
acceptsTypein classPaletteContainer- Parameters:
type- the type being requested- Returns:
- true if this can be a child of this container
-
getDrawerType
public java.lang.Object getDrawerType()
- Returns:
ToolEntry.PALETTE_TYPE_TOOLorPaletteTemplateEntry.PALETTE_TYPE_TEMPLATEor (if the drawer is empty and a drawerType has not been explicitly set)PALETTE_TYPE_UNKNOWN- See Also:
setDrawerType(Object)
-
getInitialState
public int getInitialState()
- Returns:
- INITIAL_STATE_OPEN or INITIAL_STATE_CLOSED or INITIAL_STATE_PINNED_OPEN
-
isInitiallyOpen
public boolean isInitiallyOpen()
- Returns:
trueif open initially
-
isInitiallyPinned
public boolean isInitiallyPinned()
- Returns:
trueif the drawer is to be pinned open initially.
-
setDrawerType
public void setDrawerType(java.lang.Object obj)
DrawerType indicates whether a drawer will contain ToolEntries of PaletteTemplateEntries. A drawer should not contain entries of both these types. However, there are no checks/restrictions that will prevent you from doing so.- Parameters:
obj-ToolEntry.PALETTE_TYPE_TOOLorPaletteTemplateEntry.PALETTE_TYPE_TEMPLATE
-
setInitialState
public void setInitialState(int state)
Sets the initial state of this drawer (i.e. the state that this drawer should be when the palette is created).- Parameters:
state- INITIAL_STATE_OPEN or INITIAL_STATE_CLOSED or INITIAL_STATE_PINNED_OPEN
-
showDefaultIcon
public boolean showDefaultIcon()
Should the default icon be shown for this drawer if no icon is set?- Returns:
- true if the default icon should be shown if no icon is set; false otherwise
- Since:
- 3.4
-
setShowDefaultIcon
public void setShowDefaultIcon(boolean showDefaultIcon)
Should the default icon be shown for this drawer if no icon is set?- Parameters:
showDefaultIcon- true if the default icon should be shown if no icon is set; false otherwise- Since:
- 3.4
-
-