Class ButtonDef

java.lang.Object
com.kheops.ui.component.ButtonDef
All Implemented Interfaces:
Cloneable

public class ButtonDef extends Object implements Cloneable
A ButtonDef is use to define options (icon, text, etc) for a Button.
See Also:
  • Constructor Details

    • ButtonDef

      public ButtonDef(String actionName, ImageIcon icon, String buttonText, boolean centerIconText)
      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 centered
      buttonTextFont - the button text font
  • Method Details

    • getActionName

      public String getActionName()
      Gets the action name for this button definition.
      Returns:
      the action name
    • getIcon

      public Icon getIcon()
      Gets the original icon (set by the constructor). Can be null
      Returns:
      the icon
    • setIcon

      public void setIcon(Icon icon)
      Sets the icon to use. null for none
      Parameters:
      icon - an icon
    • getButtonText

      public String getButtonText()
      Gets the text for this button definition. Can be null
      Returns:
      the text
    • setText

      public void setText(String buttonText)
      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

      public Icon getIconDisabled()
      Returns a disabled icon. This icon is generated when the original icon is set.
      Returns:
      a disabled icon
    • getFont

      public Font getFont()
      Returns the button text font. The default value is UIManager.getFont("Label.font")
      Returns:
      button text font
    • setFont

      public void setFont(Font font)
      Sets the button text font. If null 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

      public Object clone()
      Clones this ButtonDef
      Overrides:
      clone in class Object
      Returns:
      a clone