Class DialogButton

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

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

      • DialogButton

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

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

        public DialogButton​(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
      • DialogButton

        public DialogButton​(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
      • DialogButton

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

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

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

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

      • 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: ui-my-icon)
      • isEnabled

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

        public void setEnabled​(boolean enabled)
        Sets the enable state of the button
        Parameters:
        enabled - true or false
      • setEnabled

        public void setEnabled​(boolean enabled,
                               org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Sets the enable state of the button
        Parameters:
        enabled - true or false
        handler - the IPartialPageRequestHandler
      • setVisible

        public void setVisible​(boolean visible,
                               org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Sets the visible state of the button
        Parameters:
        visible - true or false
        handler - the IPartialPageRequestHandler
      • isIndicating

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

        public String getMarkupId()
        Gets the markupId of the specified button.
        This can be used to enable/disable the button
        Returns:
        the markupId
      • getCallbackScript

        protected CharSequence getCallbackScript​(ButtonAjaxBehavior behavior)
        Gets the javascript statement that will generate an ajax GET request to the behavior for this assigned button
        Parameters:
        behavior - the ButtonAjaxBehavior
        Returns:
        the javascript statement
      • hashCode

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

        public boolean equals​(Object object)
        Indicates whether this DialogButton is equal to another DialogButton.
        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 DialogButton to compare to
        Returns:
        true if considered as equal
      • match

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