java.lang.Object
org.broadleafcommerce.openadmin.web.form.component.ListGridAction
All Implemented Interfaces:
Cloneable

public class ListGridAction extends Object implements Cloneable
Buttons to display on the frontend for a list grid. These will be displayed at the top of the ListGrid that they are related to.
Author:
Andre Azzolini (aazzolini)
  • Field Details

  • Constructor Details

    • ListGridAction

      public ListGridAction(String actionId)
  • Method Details

    • withButtonClass

      public ListGridAction withButtonClass(String buttonClass)
    • withUrlPostfix

      public ListGridAction withUrlPostfix(String urlPostfix)
    • withIconClass

      public ListGridAction withIconClass(String iconClass)
    • withRequiresNonEmptyGrid

      public ListGridAction withRequiresNonEmptyGrid(Boolean requiresNonEmptyGrid)
    • withDisplayText

      public ListGridAction withDisplayText(String displayText)
    • withForListGridReadOnly

      public ListGridAction withForListGridReadOnly(Boolean forListGridReadOnly)
    • withActionUrlOverride

      public ListGridAction withActionUrlOverride(String actionUrlOverride)
    • withAllCapable

      public ListGridAction withAllCapable(Boolean allCapable)
    • withSingleActionOnly

      public ListGridAction withSingleActionOnly(Boolean singleActionOnly)
    • withActionTargetEntity

      public ListGridAction withActionTargetEntity(String actionTargetEntity)
    • withIsConfirmEnabled

      public ListGridAction withIsConfirmEnabled(Boolean isConfirmEnabled)
    • withConfirmEnabledText

      public ListGridAction withConfirmEnabledText(String confirmEnabledText)
    • getButtonClass

      public String getButtonClass()
    • setButtonClass

      public void setButtonClass(String buttonClass)
      Main intent is for the button class to be used in a JQuery selector for giving this button a click action. You could technically also apply additional styling to this anchor but is not usually recommended.

      An example JQuery selector would look like: $('body').on('click', 'button.some-class', function() { doSomeFunction() });

      Parameters:
      buttonClass -
    • getForListGridReadOnly

      public Boolean getForListGridReadOnly()
    • setForListGridReadOnly

      public void setForListGridReadOnly(Boolean forListGridReadOnly)
    • getUrlPostfix

      public String getUrlPostfix()
    • setUrlPostfix

      public void setUrlPostfix(String urlPostfix)
      This means different things depending on where this action is on the list grid.
      • If this is a toolbar action: this postfix will be appended onto the end of ListGrid.getPath() and presented as a 'data-actionurl' attribute for the button
      • This postfix will also be presented as a 'data-urlpostfix' attribute on the button
      Parameters:
      urlPostfix -
    • getIconClass

      public String getIconClass()
    • setIconClass

      public void setIconClass(String iconClass)
      Icon classes are displayed next to the getDisplayText(). These can technically be whatever you like and you can use css selectors to style them accordingly. That said, Broadleaf uses the FontAwesome set of icons out of the box, and it is intended that iconClass is an icon from the FontAwesome framework. To see the icons that are included, check out http://fortawesome.github.com/Font-Awesome/#icons-new
      Parameters:
      iconClass -
    • getDisplayText

      public String getDisplayText()
    • setDisplayText

      public void setDisplayText(String displayText)
    • getActionUrlOverride

      public String getActionUrlOverride()
      Gets the manual override for the data-actionurl attribute on an action.
      Returns:
    • setActionUrlOverride

      public void setActionUrlOverride(String actionUrlOverride)
      This is a manual override for the data-actionurl attribute for an listgrid action. The data-actionurl attribute on a button is normally automatically computed by appending the postfix URL to the path of the list grid
      Parameters:
      actionUrlOverride -
    • getActionId

      public String getActionId()
      Returns an Id that controllers can use to manipulate this action. For example, if a Controller wanted to not show the "Add" button that the system shows by default, they could remove the action with an id of "ADD".
      Returns:
    • getAllCapable

      public Boolean getAllCapable()
      Returns:
      whether or not the given list grid action is capable of acting on rows even when none are selected
    • setAllCapable

      public void setAllCapable(Boolean allCapable)
      Sets whether or not the given list grid action is capable of acting on rows even when none are selected
      Parameters:
      allCapable -
    • getSingleActionOnly

      public Boolean getSingleActionOnly()
      Returns:
      whether or not this action can be performed only on a single item, regardless of whether the list grid is multi-select capable or not.
    • setSingleActionOnly

      public void setSingleActionOnly(Boolean singleActionOnly)
      Sets where or not this action can only be performed on a single item. This is used to override multi-select list grids for certain actions.
      Parameters:
      singleActionOnly -
    • getActionTargetEntity

      public String getActionTargetEntity()
      Returns a fully qualified ceiling entity that this listgrid action targets
      Returns:
    • setActionTargetEntity

      public void setActionTargetEntity(String actionTargetEntity)
      This is used to specify a target entityType for use in listgrid actions
      Parameters:
      actionTargetEntity -
    • getRequiresNonEmptyGrid

      public Boolean getRequiresNonEmptyGrid()
      If a list grid action should be disabled unless there are one or more rows in the grid, this property should be true
      Returns:
    • setRequiresNonEmptyGrid

      public void setRequiresNonEmptyGrid(Boolean requiresNonEmptyGrid)
    • getIsConfirmEnabled

      public Boolean getIsConfirmEnabled()
    • setIsConfirmEnabled

      public void setIsConfirmEnabled(Boolean confirmEnabled)
    • getConfirmEnabledText

      public String getConfirmEnabledText()
    • setConfirmEnabledText

      public void setConfirmEnabledText(String confirmEnabledText)
    • clone

      public ListGridAction clone()
      Overrides:
      clone in class Object