Package org.eclipse.gef.palette
Class PaletteEntry
java.lang.Object
org.eclipse.gef.palette.PaletteEntry
- Direct Known Subclasses:
- PaletteContainer,- PaletteSeparator,- PaletteTemplateEntry,- ToolEntry
Root class (statically) for the palette model.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected PropertyChangeSupportPropertyChangeSupportstatic final StringType unknownstatic final intAll modifications allowed.static final intEntries with this permission level can only be hidden/shown.static final intAny property of entries with this level of permission can be changed; however, they cannot be deleted from the palette.static final intNo changes can be made to a PaletteEntry with this permission level.static final StringProperty name for the entry's default stausstatic final StringProperty name for the entry's descriptionstatic final StringProperty name for the entry's label (name)static final StringProperty name for the entry's large iconstatic final StringProperty name for the entry's parentstatic final StringProperty name for the entry's small iconstatic final StringProperty name for the entry's typestatic final StringProperty name for the entry's hidden status
- 
Constructor SummaryConstructorsConstructorDescriptionPaletteEntry(String label, String shortDescription) ConstructorPaletteEntry(String label, String shortDescription, Object type) ConstructorPaletteEntry(String label, String shortDescription, ImageDescriptor iconSmall, ImageDescriptor iconLarge) ConstructorPaletteEntry(String label, String shortDescription, ImageDescriptor iconSmall, ImageDescriptor iconLarge, Object type) ConstructorPaletteEntry(String label, String shortDescription, ImageDescriptor smallIcon, ImageDescriptor largeIcon, Object type, String id) Constructor
- 
Method SummaryModifier and TypeMethodDescriptionvoidA listener can only be added once.getId()Returns the id.getLabel()getType()intReturned values are from amongst the following: PERMISSION_NO_MODIFICATION PERMISSION_HIDE_ONLY PERMISSION_LIMITED_MODIFICATION PERMISSION_FULL_MODIFICATIONbooleanvoidvoidMutator method for descriptionvoidSets the id.voidMutator method for labelvoidsetLargeIcon(ImageDescriptor icon) Mutator method for large iconvoidsetParent(PaletteContainer newParent) Sets the parent of this entryvoidsetSmallIcon(ImageDescriptor icon) Mutator method for small iconvoidMutator method for typevoidsetUserModificationPermission(int permission) Permissions are not checked before making modifications.voidsetVisible(boolean newVal) Makes this entry visible or invisible.toString()
- 
Field Details- 
PROPERTY_SMALL_ICONProperty name for the entry's small icon- See Also:
 
- 
PROPERTY_TYPEProperty name for the entry's type- See Also:
 
- 
PROPERTY_LARGE_ICONProperty name for the entry's large icon- See Also:
 
- 
PROPERTY_LABELProperty name for the entry's label (name)- See Also:
 
- 
PROPERTY_DESCRIPTIONProperty name for the entry's description- See Also:
 
- 
PROPERTY_VISIBLEProperty name for the entry's hidden status- See Also:
 
- 
PROPERTY_DEFAULTProperty name for the entry's default staus- See Also:
 
- 
PROPERTY_PARENTProperty name for the entry's parent- See Also:
 
- 
PALETTE_TYPE_UNKNOWNType unknown- See Also:
 
- 
PERMISSION_NO_MODIFICATIONpublic static final int PERMISSION_NO_MODIFICATIONNo changes can be made to a PaletteEntry with this permission level.- See Also:
 
- 
PERMISSION_HIDE_ONLYpublic static final int PERMISSION_HIDE_ONLYEntries with this permission level can only be hidden/shown.- See Also:
 
- 
PERMISSION_LIMITED_MODIFICATIONpublic static final int PERMISSION_LIMITED_MODIFICATIONAny property of entries with this level of permission can be changed; however, they cannot be deleted from the palette. The children PaletteContainers with this permission level can be reordered within that container (however, cross-container moving is not allowed).- See Also:
 
- 
PERMISSION_FULL_MODIFICATIONpublic static final int PERMISSION_FULL_MODIFICATIONAll modifications allowed.- See Also:
 
- 
listenersPropertyChangeSupport
 
- 
- 
Constructor Details- 
PaletteEntryConstructorAny parameter can be null- Parameters:
- label- The entry's name
- shortDescription- The entry's description
 
- 
PaletteEntryConstructorAny parameter can be null- Parameters:
- label- The entry's name
- shortDescription- The entry's description
- type- The entry's type
 
- 
PaletteEntrypublic PaletteEntry(String label, String shortDescription, ImageDescriptor iconSmall, ImageDescriptor iconLarge) ConstructorAny parameter can be null- Parameters:
- label- The entry's name
- shortDescription- The entry's description
- iconSmall- The small icon to represent this entry
- iconLarge- The large icon to represent this entry
 
- 
PaletteEntrypublic PaletteEntry(String label, String shortDescription, ImageDescriptor iconSmall, ImageDescriptor iconLarge, Object type) ConstructorAny parameter can be null- Parameters:
- label- The entry's name
- shortDescription- The entry's description
- iconSmall- The small icon to represent this entry
- iconLarge- The large icon to represent this entry
- type- The entry's type
 
- 
PaletteEntrypublic PaletteEntry(String label, String shortDescription, ImageDescriptor smallIcon, ImageDescriptor largeIcon, Object type, String id) ConstructorAny parameter can be null- Parameters:
- label- The entry's name
- shortDescription- The entry's description
- smallIcon- The small icon to represent this entry
- largeIcon- The large icon to represent this entry
- type- The entry's type
- id- The entry's id (preferrably unique)
 
 
- 
- 
Method Details- 
addPropertyChangeListenerA listener can only be added once. Adding it more than once will do nothing.- Parameters:
- listener- the PropertyChangeListener that is to be notified of changes
- See Also:
 
- 
getDescription- Returns:
- a short desecription describing this entry.
 
- 
getIdReturns the id. If no ID has been set (or it isnull), an empty String will be returned.- Returns:
- String id
 
- 
getLabel- Returns:
- the label for this entry.
 
- 
getLargeIcon- Returns:
- a large icon representing this entry.
 
- 
getParent- Returns:
- the parent container of this entry
 
- 
getSmallIcon- Returns:
- a small icon representing the entry.
 
- 
getType- Returns:
- the type of this entry. Useful for different interpretations of the palette model.
 
- 
getUserModificationPermissionpublic int getUserModificationPermission()Returned values are from amongst the following:- PERMISSION_NO_MODIFICATION
- PERMISSION_HIDE_ONLY
- PERMISSION_LIMITED_MODIFICATION
- PERMISSION_FULL_MODIFICATION
 - Returns:
- the permission level for this entry.
- See Also:
 
- 
isVisiblepublic boolean isVisible()- Returns:
- whether or not this entry is visible. An entry that is not visible is not shown on the palette.
 
- 
removePropertyChangeListener- Parameters:
- listener- the PropertyChangeListener that is not to be notified anymore
- See Also:
 
- 
setDescriptionMutator method for description- Parameters:
- s- The new description
 
- 
setIdSets the id. Can benull.- Parameters:
- id- The new id to be set
 
- 
setLabelMutator method for label- Parameters:
- s- The new name
 
- 
setLargeIconMutator method for large icon- Parameters:
- icon- The large icon to represent this entry
 
- 
setParentSets the parent of this entry- Parameters:
- newParent- The parent PaletteContainer
 
- 
setSmallIconMutator method for small icon- Parameters:
- icon- The new small icon to represent this entry
 
- 
setTypeMutator method for type- Parameters:
- newType- The new type
 
- 
setUserModificationPermissionpublic void setUserModificationPermission(int permission) Permissions are not checked before making modifications. Clients should check the permission before invoking a modification. Sub-classes may extend the set of permissions. Current set has:- PERMISSION_NO_MODIFICATION
- PERMISSION_HIDE_ONLY
- PERMISSION_LIMITED_MODIFICATION
- PERMISSION_FULL_MODIFICATION
 PERMISSION_FULL_MODIFICATION- Parameters:
- permission- One of the above-specified permission levels
 
- 
setVisiblepublic void setVisible(boolean newVal) Makes this entry visible or invisible. An invisible entry does not show up on the palette.- Parameters:
- newVal- The new boolean indicating whether the entry is visible or not
 
- 
toString
 
-