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
Constructors -
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.booleanReturns true if the text and/or the icon is centered on the button.booleanvoidSets the button text font.voidSets the icon to use.voidSets the text for this button definition.voidsetUpdateToPopupSelection(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.nullfor 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.nullfor 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. Ifnullis 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
-