planetj.html
Class HTMLActionRenderer

java.lang.Object
  extended byplanetj.html.HTMLActionRenderer
Direct Known Subclasses:
HTMLRowDetailsActionRenderer

public class HTMLActionRenderer
extends java.lang.Object

Generates action links/buttons. Subclasses must provide a default constructor

Author:
Justin

Constructor Summary
HTMLActionRenderer()
           
 
Method Summary
 void addAction(AbstractAction action, ExecutingContext ec)
          Adds the specified action to this HTMLActionRenderer.
 java.util.List getActions(java.lang.String location)
          Get a list of actions for generation
static HTMLActionRenderer getInstance(Row row, boolean reset, ExecutingContext ec)
          Gets the HTMLActionRenderer object to use.
static HTMLActionRenderer getInstance(Row row, java.lang.Class subClass, boolean reset, ExecutingContext ec)
          Gets the HTMLActionRenderer object to use.
static HTMLActionRenderer getInstance(Row row, ExecutingContext ec)
          Gets the HTMLActionRenderer object to use.
 Row getRow()
          Gets the row whose details are being generated
 boolean isActionInLocation(java.lang.String loc, ExecutingContext ec)
          Tests if there are any actions for the row in the specified location
 java.lang.String renderActions(java.lang.String location, HttpServletRequest req, HttpServletResponse res)
          Renders the HTML for all actions in the specified location
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLActionRenderer

public HTMLActionRenderer()
Method Detail

getInstance

public static final HTMLActionRenderer getInstance(Row row,
                                                   ExecutingContext ec)
                                            throws CMException
Gets the HTMLActionRenderer object to use. This could be an existing instance stored in the EC, or a newly created instance

Parameters:
row - The row for which actions are being generated. This can also be an operation old instances of HTMLActionRenderer in the EC can cause errors
ec - The current executing context
Throws:
CMException

getInstance

public static final HTMLActionRenderer getInstance(Row row,
                                                   boolean reset,
                                                   ExecutingContext ec)
                                            throws CMException
Gets the HTMLActionRenderer object to use. This could be an existing instance stored in the EC, or a newly created instance

Parameters:
row - The row for which actions are being generated. This can also be an operation
reset - Whether or not the created instance should be stored in the EC so it can be reused. This can help performance, but if details for multiple rows are being generated on the same screen, keeping old instances of HTMLActionRenderer in the EC can cause errors
ec - The current executing context
Throws:
CMException

getInstance

public static final HTMLActionRenderer getInstance(Row row,
                                                   java.lang.Class subClass,
                                                   boolean reset,
                                                   ExecutingContext ec)
                                            throws CMException
Gets the HTMLActionRenderer object to use. This could be an existing instance stored in the EC, or a newly created instance

Parameters:
row - The row for which actions are being generated. This can also be an operation
subClass - The exact class of the returned instance (which must be HTMLActionRenderer, or a subclass)
reset - Whether or not the created instance should be stored in the EC so it can be reused. This can help performance, but if details for multiple rows are being generated on the same screen, keeping old instances of HTMLActionRenderer in the EC can cause errors
ec - The current executing context
Throws:
CMException

addAction

public void addAction(AbstractAction action,
                      ExecutingContext ec)
Adds the specified action to this HTMLActionRenderer.


getActions

public final java.util.List getActions(java.lang.String location)
Get a list of actions for generation

Parameters:
location - where actions are to be generated. Location constants are defined in ActionDescriptor

getRow

public Row getRow()
Gets the row whose details are being generated


renderActions

public java.lang.String renderActions(java.lang.String location,
                                      HttpServletRequest req,
                                      HttpServletResponse res)
                               throws CMException
Renders the HTML for all actions in the specified location

Throws:
CMException

isActionInLocation

public boolean isActionInLocation(java.lang.String loc,
                                  ExecutingContext ec)
Tests if there are any actions for the row in the specified location