Package org.eclipse.gef.palette
Class ToolEntry
java.lang.Object
org.eclipse.gef.palette.PaletteEntry
org.eclipse.gef.palette.ToolEntry
- Direct Known Subclasses:
- CreationToolEntry,- MarqueeToolEntry,- SelectionToolEntry
A factory for returning Tools.
- 
Field SummaryFieldsFields inherited from class org.eclipse.gef.palette.PaletteEntrylisteners, 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 SummaryConstructorsConstructorDescriptionToolEntry(String label, String shortDesc, ImageDescriptor iconSmall, ImageDescriptor iconLarge) Creates a new ToolEntry.ToolEntry(String label, String description, ImageDescriptor iconSmall, ImageDescriptor iconLarge, Class tool) Constructor to create a new ToolEntry.
- 
Method SummaryModifier and TypeMethodDescriptionCreates the tool of the type specified bysetToolClass(Class)for this ToolEntry.protected MapgetToolProperty(Object key) Returns the property value for the specified property key.voidsetToolClass(Class toolClass) Sets the type of tool to be created.voidsetToolProperty(Object key, Object value) Clients can use this method to configure the associated tool without having to sub-class.Methods inherited from class org.eclipse.gef.palette.PaletteEntryaddPropertyChangeListener, getDescription, getId, getLabel, getLargeIcon, getParent, getSmallIcon, getType, getUserModificationPermission, isVisible, removePropertyChangeListener, setDescription, setId, setLabel, setLargeIcon, setParent, setSmallIcon, setType, setUserModificationPermission, setVisible, toString
- 
Field Details- 
PALETTE_TYPE_TOOLType Identifier
 
- 
- 
Constructor Details- 
ToolEntrypublic ToolEntry(String label, String shortDesc, ImageDescriptor iconSmall, ImageDescriptor iconLarge) Creates a new ToolEntry. Any parameter can benull.- Parameters:
- label- the entry's name
- shortDesc- the entry's description
- iconSmall- the entry's small icon
- iconLarge- the entry's large icon
 
- 
ToolEntrypublic ToolEntry(String label, String description, ImageDescriptor iconSmall, ImageDescriptor iconLarge, Class tool) Constructor to create a new ToolEntry. Any parameter can benull.- Parameters:
- label- the entry's name
- description- the entry's description
- iconSmall- the entry's small icon
- iconLarge- the entry's large icon
- tool- the type of tool that this entry uses
- Since:
- 3.1
 
 
- 
- 
Method Details- 
createToolCreates the tool of the type specified bysetToolClass(Class)for this ToolEntry. The tool is also configured with the properties set insetToolProperty(Object, Object). Sub-classes overriding this method should ensure that their tools are also configured with those properties.- Returns:
- the tool for this entry
 
- 
getToolProperties- Returns:
- the properties set in setToolProperty(Object, Object)
- Since:
- 3.1
 
- 
getToolPropertyReturns the property value for the specified property key.- Parameters:
- key- the property key
- Returns:
- the value for the requested property
- Since:
- 3.1
 
- 
setToolClassSets the type of tool to be created. This provides clients with a method of specifying a different type of tool to be created without having to sub-class. The provided class should have a default constructor for this to work successfully.- Parameters:
- toolClass- the type of tool to be created by this entry
- Since:
- 3.1
 
- 
setToolPropertyClients can use this method to configure the associated tool without having to sub-class.- Parameters:
- key- the property name
- value- a value of type associated with the given property
- Since:
- 3.1
- See Also:
 
 
-