Class SecuredToolbarButton

  • All Implemented Interfaces:
    com.googlecode.wicket.jquery.core.IJsonFactory, Serializable, org.apache.wicket.util.io.IClusterable

    public class SecuredToolbarButton
    extends ToolbarButton
    Provides a secured command button object that can be used in DataTable column
    Author:
    Sebastien Briquet - sebfz1
    See Also:
    Serialized Form
    • Constructor Detail

      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    String[] roles)
        Constructor for built-in commands (no property supplied)
        Parameters:
        name - the button's name
        roles - list of roles allowed to enable the button
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    String[] roles,
                                    com.googlecode.wicket.jquery.core.IJQuerySecurityProvider provider)
        Constructor for built-in commands (no property supplied)
        Parameters:
        name - the button's name
        roles - list of roles allowed to enable the button
        provider - the IJQuerySecurityProvider
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    String property,
                                    String[] roles)
        Constructor
        Parameters:
        name - the button's name
        property - the property used to retrieve the row's object value
        roles - list of roles allowed to enable the button
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    String property,
                                    String[] roles,
                                    com.googlecode.wicket.jquery.core.IJQuerySecurityProvider provider)
        Constructor
        Parameters:
        name - the button's name
        property - the property used to retrieve the row's object value
        roles - list of roles allowed to enable the button
        provider - the IJQuerySecurityProvider
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    org.apache.wicket.model.IModel<String> text,
                                    String[] roles)
        Constructor for built-in commands (no property supplied)
        Parameters:
        name - the button's name
        text - the button's text
        roles - list of roles allowed to enable the button
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    org.apache.wicket.model.IModel<String> text,
                                    String[] roles,
                                    com.googlecode.wicket.jquery.core.IJQuerySecurityProvider provider)
        Constructor for built-in commands (no property supplied)
        Parameters:
        name - the button's name
        text - the button's text
        roles - list of roles allowed to enable the button
        provider - the IJQuerySecurityProvider
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    org.apache.wicket.model.IModel<String> text,
                                    String property,
                                    String[] roles)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        property - the property used to retrieve the row's object value
        roles - list of roles allowed to enable the button
      • SecuredToolbarButton

        public SecuredToolbarButton​(String name,
                                    org.apache.wicket.model.IModel<String> text,
                                    String property,
                                    String[] roles,
                                    com.googlecode.wicket.jquery.core.IJQuerySecurityProvider provider)
        Constructor
        Parameters:
        name - the button's name
        text - the button's text
        property - the property used to retrieve the row's object value
        roles - list of roles allowed to enable the button
        provider - the IJQuerySecurityProvider
    • Method Detail

      • getRoles

        public String[] getRoles()
        Gets the roles
        Caution: to be overridden with care!
        Returns:
        the roles
      • isLocked

        public final boolean isLocked()
        Indicates whether the button is locked.
        Returns:
        the result of IJQuerySecurityProvider.hasRole(String...)
      • isEnabled

        public boolean isEnabled()
        Description copied from class: AbstractButton
        Indicates whether this button is enabled
        Overrides:
        isEnabled in class AbstractButton
        Returns:
        true by default