Package net.infonode.properties.gui.util
Class ButtonProperties
- java.lang.Object
-
- net.infonode.properties.propertymap.PropertyMapContainer
-
- net.infonode.properties.gui.util.ButtonProperties
-
public class ButtonProperties extends PropertyMapContainer
Properties and property values for a button.
-
-
Field Summary
Fields Modifier and Type Field Description static IconPropertyDISABLED_ICONThe disabled button icon.static ButtonFactoryPropertyFACTORYThe button factory.static IconPropertyICONThe button icon.static PropertyMapGroupPROPERTIESProperty group for all button properties.static StringPropertyTOOL_TIP_TEXTThe enabled button tool tip text.
-
Constructor Summary
Constructors Constructor Description ButtonProperties()Creates an empty property object.ButtonProperties(ButtonProperties inheritFrom)Creates a property object that inherit values from another property object.ButtonProperties(PropertyMap map)Creates a property map containing the map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ButtonPropertiesaddSuperObject(ButtonProperties properties)Adds a super object from which property values are inherited.javax.swing.AbstractButtonapplyTo(javax.swing.AbstractButton button)Applies the icon, disabled icon and tool tip to the given buttonjavax.swing.IcongetDisabledIcon()Returns the disabled button icon.ButtonFactorygetFactory()Gets the button factory.javax.swing.IcongetIcon()Returns the button icon.java.lang.StringgetToolTipText()Returns the button tool tip text.ButtonPropertiesremoveSuperObject()Removes the last added super object.ButtonPropertiesremoveSuperObject(ButtonProperties superObject)Removes the given super object.ButtonPropertiessetDisabledIcon(javax.swing.Icon icon)Sets the disabled button icon.ButtonPropertiessetFactory(ButtonFactory factory)Sets the button factory.ButtonPropertiessetIcon(javax.swing.Icon icon)Sets the button icon.ButtonPropertiessetToolTipText(java.lang.String text)Sets the button tool tip text.-
Methods inherited from class net.infonode.properties.propertymap.PropertyMapContainer
getMap
-
-
-
-
Field Detail
-
PROPERTIES
public static final PropertyMapGroup PROPERTIES
Property group for all button properties.
-
ICON
public static final IconProperty ICON
The button icon.
-
DISABLED_ICON
public static final IconProperty DISABLED_ICON
The disabled button icon.
-
TOOL_TIP_TEXT
public static final StringProperty TOOL_TIP_TEXT
The enabled button tool tip text.
-
FACTORY
public static final ButtonFactoryProperty FACTORY
The button factory.
The created button will be assigned the icon from
ICONorDISABLED_ICONand the tool tip fromTOOL_TIP_TEXT. An action listener is also added to the button.
-
-
Constructor Detail
-
ButtonProperties
public ButtonProperties()
Creates an empty property object.
-
ButtonProperties
public ButtonProperties(PropertyMap map)
Creates a property map containing the map.- Parameters:
map- the property map
-
ButtonProperties
public ButtonProperties(ButtonProperties inheritFrom)
Creates a property object that inherit values from another property object.- Parameters:
inheritFrom- the object from which to inherit property values
-
-
Method Detail
-
addSuperObject
public ButtonProperties addSuperObject(ButtonProperties properties)
Adds a super object from which property values are inherited.- Parameters:
properties- the object from which to inherit property values- Returns:
- this
-
removeSuperObject
public ButtonProperties removeSuperObject()
Removes the last added super object.- Returns:
- this
-
removeSuperObject
public ButtonProperties removeSuperObject(ButtonProperties superObject)
Removes the given super object.- Parameters:
superObject- super object to remove- Returns:
- this
-
setIcon
public ButtonProperties setIcon(javax.swing.Icon icon)
Sets the button icon.- Parameters:
icon- the button icon- Returns:
- this
-
getIcon
public javax.swing.Icon getIcon()
Returns the button icon.- Returns:
- the button icon
-
setDisabledIcon
public ButtonProperties setDisabledIcon(javax.swing.Icon icon)
Sets the disabled button icon.- Parameters:
icon- the disabled button icon- Returns:
- this
-
getDisabledIcon
public javax.swing.Icon getDisabledIcon()
Returns the disabled button icon.- Returns:
- the disabled button icon
-
getToolTipText
public java.lang.String getToolTipText()
Returns the button tool tip text.- Returns:
- the button tool tip text
-
setToolTipText
public ButtonProperties setToolTipText(java.lang.String text)
Sets the button tool tip text.- Parameters:
text- the button tool tip text- Returns:
- this
-
getFactory
public ButtonFactory getFactory()
Gets the button factory.
The created button will be assigned the icon from
ICONorDISABLED_ICONand the tool tip fromTOOL_TIP_TEXT. An action listener is also added to the button.- Returns:
- the button factory
-
setFactory
public ButtonProperties setFactory(ButtonFactory factory)
Sets the button factory.
The created button will be assigned the icon from
ICONorDISABLED_ICONand the tool tip fromTOOL_TIP_TEXT. An action listener is also added to the button.- Parameters:
factory- the button factory- Returns:
- this
-
applyTo
public javax.swing.AbstractButton applyTo(javax.swing.AbstractButton button)
Applies the icon, disabled icon and tool tip to the given button- Parameters:
button- botton- Returns:
- the button
-
-