Class ButtonFactory

java.lang.Object
org.adempiere.webui.factory.ButtonFactory

public class ButtonFactory extends Object
Factory class to create button with consistent look and feel
Author:
hengsin
  • Constructor Details

    • ButtonFactory

      public ButtonFactory()
  • Method Details

    • isWithText

      public static final boolean isWithText()
      Is button with text label the current default UI preference
      Returns:
      true if button should have text label
    • isWithImage

      public static final boolean isWithImage()
      Is button with image icon the current default UI preference
      Returns:
      true if button should include an image icon
    • createNamedButton

      public static Button createNamedButton(String name)
      Create named button with default style
      Parameters:
      name -
      Returns:
      new button instance
    • createNamedButton

      public static Button createNamedButton(String name, boolean withText, boolean withImage)
      Create named button
      Parameters:
      name - button name.
      Button created with name="btn"+name and include css class of "btn-"+lower(name).
      If withText is true, the name will be used to lookup the button label from ad_message.
      withText - text button
      withImage - image button
      Returns:
      new button instance
    • createButton

      public static Button createButton(String label, String image, String tooltiptext)
      Create button
      Parameters:
      label -
      image -
      tooltiptext -
      Returns:
      new button instance