Package com.kheops.ui.component
Class ButtonDef
java.lang.Object
com.kheops.ui.component.ButtonDef
- All Implemented Interfaces:
Cloneable
A ButtonDef is use to define options (icon, text, etc) for a
Button
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones this ButtonDefGets the action name for this button definition.Gets the text for this button definition.getFont()
Returns the button text font.getIcon()
Gets the original icon (set by the constructor).Returns a disabled icon.boolean
Returns true if the text and/or the icon is centered on the button.boolean
void
Sets the button text font.void
Sets the icon to use.void
Sets the text for this button definition.void
setUpdateToPopupSelection
(boolean updateToPopupSelection) If true (default), set this ButtonDef active if the main button has a ButtonGroup.
-
Constructor Details
-
ButtonDef
Constructs a ButtonDef.- Parameters:
actionName
- the action name that will be fired (required)icon
- an icon to display (optional)buttonText
- the text to display (optional)centerIconText
- is the icon and / or the text will be centered
-
ButtonDef
public ButtonDef(String actionName, ImageIcon icon, String buttonText, boolean centerIconText, Font buttonTextFont) Constructs a ButtonDef.- Parameters:
actionName
- the action name that will be fired (required)icon
- an icon to display (optional)buttonText
- the text to display (optional)centerIconText
- is the icon and / or the text will be centeredbuttonTextFont
- the button text font
-
-
Method Details
-
getActionName
Gets the action name for this button definition.- Returns:
- the action name
-
getIcon
Gets the original icon (set by the constructor). Can benull
- Returns:
- the icon
-
setIcon
Sets the icon to use.null
for none- Parameters:
icon
- an icon
-
getButtonText
Gets the text for this button definition. Can benull
- Returns:
- the text
-
setText
Sets the text for this button definition.null
for none- Parameters:
buttonText
- the new text
-
isCenterIconText
public boolean isCenterIconText()Returns true if the text and/or the icon is centered on the button.- Returns:
- text / icon center status
-
getIconDisabled
Returns a disabled icon. This icon is generated when the original icon is set.- Returns:
- a disabled icon
-
getFont
Returns the button text font. The default value isUIManager.getFont("Label.font")
- Returns:
- button text font
-
setFont
Sets the button text font. Ifnull
is passed, the default UI font will be set.- Parameters:
font
-
-
setUpdateToPopupSelection
public void setUpdateToPopupSelection(boolean updateToPopupSelection) If true (default), set this ButtonDef active if the main button has a ButtonGroup.- Parameters:
updateToPopupSelection
-
-
isUpdateToPopupSelection
public boolean isUpdateToPopupSelection() -
clone
Clones this ButtonDef
-