Class AbstractButton

  • All Implemented Interfaces:
    com.googlecode.wicket.jquery.core.IJsonFactory, Serializable, org.apache.wicket.util.io.IClusterable
    Direct Known Subclasses:
    CommandButton, ToolbarButton

    public abstract class AbstractButton
    extends Object
    implements com.googlecode.wicket.jquery.core.IJsonFactory, org.apache.wicket.util.io.IClusterable
    Provides a base button object that can be used in DataTable
    The css content for CSS_ICON_ONLY is not supplied.
    It might be implemented like this:
    
     .k-button.w-icon-only {
                    padding: .2em;  
                    min-width: 0px !important;
     }
     
     .k-button.w-icon-only > .k-icon {
                    margin: auto 2px;
     }
     
    Author:
    Sebastien Briquet - sebfz1
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractButton

        public AbstractButton​(String name)
        Constructor with default property to null)
        Parameters:
        name - the button's name
      • AbstractButton

        public AbstractButton​(String name,
                              org.apache.wicket.model.IModel<String> text)
        Constructor with default property to null)
        Parameters:
        name - the button's name
        text - the button's text
      • AbstractButton

        public AbstractButton​(String name,
                              String property)
        Constructor
        Parameters:
        name - the button's name
        property - the property used to retrieve the row's object value
      • AbstractButton

        public AbstractButton​(String name,
                              org.apache.wicket.model.IModel<String> text,
                              String property)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        property - the property used to retrieve the row's object value
    • Method Detail

      • getName

        public String getName()
        Gets the button name
        Returns:
        the button name
      • getTextModel

        public org.apache.wicket.model.IModel<String> getTextModel()
        Gets the button text
        Returns:
        the button text
      • getProperty

        public String getProperty()
        Gets the button property
        Returns:
        the button property
      • isEnabled

        public boolean isEnabled()
        Indicates whether this button is enabled
        Returns:
        true by default
      • isVisible

        public boolean isVisible()
        Indicates whether the button should be visible
        Returns:
        true by default
      • getCSSClass

        public String getCSSClass()
        Gets the CSS class to be applied on the button
        Caution: super.getCSSClass() should be called when overridden
        Returns:
        the CSS class
      • getIconClass

        public String getIconClass()
        Gets the CSS class for the icon
        Returns:
        the CSS class for the icon
        See Also:
        getIcon()
      • hashCode

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

        public abstract boolean isBuiltIn()
        Indicates whether the button acts as a built-in one (like create, edit, update, destroy)
        Returns:
        true if the button is a built-in one
      • equals

        public boolean equals​(Object object)
        Indicates whether this AbstractButton is equal to another AbstractButton. Are considered equals buttons having the same name.
        Overrides:
        equals in class Object
        Parameters:
        object - a AbstractButton to compare to
        Returns:
        true if considered as equal
      • match

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