org.broadleafcommerce.openadmin.web.form.component
Class ListGridAction

java.lang.Object
  extended by 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)
See Also:
ListGrid#addRowAction(ListGridAction)}, ListGrid#addToolbarAction(ListGridAction)}

Field Summary
protected  String actionId
           
protected  String actionUrlOverride
           
static String ADD
           
protected  String buttonClass
           
protected  String displayText
           
protected  Boolean forListGridReadOnly
           
static String GEN_SKUS
           
protected  String iconClass
           
static String REMOVE
           
static String REORDER
           
static String UPDATE
           
protected  String urlPostfix
           
static String VIEW
           
 
Constructor Summary
ListGridAction(String actionId)
           
 
Method Summary
 ListGridAction clone()
           
 String getActionId()
          Returns an Id that controllers can use to manipulate this action.
 String getActionUrlOverride()
          Gets the manual override for the data-actionurl attribute on an action.
 String getButtonClass()
           
 String getDisplayText()
           
 Boolean getForListGridReadOnly()
           
 String getIconClass()
           
 String getUrlPostfix()
           
 void setActionUrlOverride(String actionUrlOverride)
          This is a manual override for the data-actionurl attribute for an listgrid action.
 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.
 void setDisplayText(String displayText)
           
 void setForListGridReadOnly(Boolean forListGridReadOnly)
           
 void setIconClass(String iconClass)
          Icon classes are displayed next to the getDisplayText().
 void setUrlPostfix(String urlPostfix)
          This means different things depending on where this action is on the list grid.
 ListGridAction withActionUrlOverride(String actionUrlOverride)
           
 ListGridAction withButtonClass(String buttonClass)
           
 ListGridAction withDisplayText(String displayText)
           
 ListGridAction withForListGridReadOnly(Boolean forListGridReadOnly)
           
 ListGridAction withIconClass(String iconClass)
           
 ListGridAction withUrlPostfix(String urlPostfix)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADD

public static final String ADD
See Also:
Constant Field Values

GEN_SKUS

public static final String GEN_SKUS
See Also:
Constant Field Values

REORDER

public static final String REORDER
See Also:
Constant Field Values

REMOVE

public static final String REMOVE
See Also:
Constant Field Values

UPDATE

public static final String UPDATE
See Also:
Constant Field Values

VIEW

public static final String VIEW
See Also:
Constant Field Values

buttonClass

protected String buttonClass

urlPostfix

protected String urlPostfix

iconClass

protected String iconClass

displayText

protected String displayText

actionId

protected String actionId

forListGridReadOnly

protected Boolean forListGridReadOnly

actionUrlOverride

protected String actionUrlOverride
Constructor Detail

ListGridAction

public ListGridAction(String actionId)
Method Detail

withButtonClass

public ListGridAction withButtonClass(String buttonClass)
See Also:
#setButtonClass(String)}

withUrlPostfix

public ListGridAction withUrlPostfix(String urlPostfix)
See Also:
#setUrlPostfix(String)}

withIconClass

public ListGridAction withIconClass(String iconClass)
See Also:
#setIconClass(String)}

withDisplayText

public ListGridAction withDisplayText(String displayText)
See Also:
#setDisplayText(String)}

withForListGridReadOnly

public ListGridAction withForListGridReadOnly(Boolean forListGridReadOnly)

withActionUrlOverride

public ListGridAction withActionUrlOverride(String actionUrlOverride)
See Also:
#setActionUrlOverride(String)}

getButtonClass

public String getButtonClass()

getForListGridReadOnly

public Boolean getForListGridReadOnly()

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 -

getUrlPostfix

public String getUrlPostfix()

setUrlPostfix

public void setUrlPostfix(String urlPostfix)
This means different things depending on where this action is on the list grid.

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)

setForListGridReadOnly

public void setForListGridReadOnly(Boolean forListGridReadOnly)

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:

clone

public ListGridAction clone()
Overrides:
clone in class Object


Copyright © 2013. All Rights Reserved.