Class WindowButton

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.util.io.IClusterable

    public class WindowButton
    extends Object
    implements org.apache.wicket.util.io.IClusterable
    Provides the button object that can be used in MessageWindow
    Author:
    Sebastien Briquet - sebfz1
    See Also:
    Serialized Form
    • Constructor Detail

      • WindowButton

        public WindowButton​(String name,
                            String text)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
      • WindowButton

        public WindowButton​(String name,
                            String text,
                            String icon)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        icon - the button's icon
      • WindowButton

        public WindowButton​(String name,
                            String text,
                            boolean enabled)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        enabled - indicates whether the button is enabled
      • WindowButton

        public WindowButton​(String name,
                            String text,
                            String icon,
                            boolean enabled)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        icon - the button's icon
        enabled - indicates whether the button is enabled
      • WindowButton

        public WindowButton​(String name,
                            org.apache.wicket.model.IModel<String> model)
        Constructor
        Parameters:
        name - the button's name
        model - the button's text
      • WindowButton

        public WindowButton​(String name,
                            org.apache.wicket.model.IModel<String> model,
                            String icon)
        Constructor
        Parameters:
        name - the button's name
        model - the button's text
        icon - the button's icon
      • WindowButton

        public WindowButton​(String name,
                            org.apache.wicket.model.IModel<String> model,
                            boolean enabled)
        Constructor
        Parameters:
        name - the button's name
        model - the button's text
        enabled - indicates whether the button is enabled
      • WindowButton

        public WindowButton​(String name,
                            org.apache.wicket.model.IModel<String> model,
                            String icon,
                            boolean enabled)
        Main constructor
        Parameters:
        name - the button's name
        model - the button's text
        icon - the button's icon
        enabled - indicates whether the button is enabled
    • Method Detail

      • of

        public static WindowButton of​(String name,
                                      org.apache.wicket.model.IModel<String> model,
                                      boolean formProcessing)
        Helper that creates a new WindowButton
        Parameters:
        name - the button's name
        model - the button's text
        formProcessing - whether the form will be validated and updated
        Returns:
        a new WindowButton
      • of

        public static WindowButton of​(String name,
                                      org.apache.wicket.model.IModel<String> model,
                                      String icon,
                                      boolean formProcessing)
        Helper that creates a new WindowButton
        Parameters:
        name - the button's name
        model - the button's text
        icon - the button's icon
        formProcessing - whether the form will be validated and updated
        Returns:
        a new WindowButton
      • getName

        public String getName()
        Gets the button's name
        Returns:
        the button's name
      • getIcon

        public String getIcon()
        Gets the button's icon
        Returns:
        the button's icon
      • setIcon

        public void setIcon​(String icon)
        Sets the button's icon
        Parameters:
        icon - the css class (ie: k-i-icon)
      • isEnabled

        public boolean isEnabled()
        Indicates whether the button is enabled
        Returns:
        true or false
      • isVisible

        public boolean isVisible()
        Indicates whether the button is visible
        Returns:
        true or false
      • isIndicating

        public boolean isIndicating()
        Indicates whether the button has a busy indicator
        Returns:
        getDefaultFormProcessing() by default
      • getDefaultFormProcessing

        public boolean getDefaultFormProcessing()
        Indicates whether the form will be validated and updated.
        Returns:
        true by default
        See Also:
        IFormSubmitter.getDefaultFormProcessing()
      • setDefaultFormProcessing

        public WindowButton setDefaultFormProcessing​(boolean processing)
        Set the default form processing
        Parameters:
        processing - true or false
        Returns:
        this, for chaining
      • equals

        public boolean equals​(Object object)
        Indicates whether this WindowButton is equal to another WindowButton.
        Are considered equals buttons having the same text representation, which is the text supplied to the constructor (if toString() is not overridden).
        Overrides:
        equals in class Object
        Parameters:
        object - the WindowButton to compare to
        Returns:
        true if considered as equal
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • match

        public boolean match​(String name)
        Indicates whether this WindowButton name match the supplied name.
        Parameters:
        name - the name to compare to
        Returns:
        true if equal