org.displaytag.sample.decorators
public class: Wrapper [javadoc |
source]
java.lang.Object
org.displaytag.decorator.Decorator
org.displaytag.decorator.TableDecorator
org.displaytag.sample.decorators.Wrapper
This class is a decorator of the TestObjects that we keep in our List. This class provides a number of methods for
formatting data, creating dynamic links, and exercising some aspects of the display:table API functionality.
- author:
epesh -
- author:
Fabrizio - Giustina
- version:
$ - Revision$ ($Author$)
| Methods from org.displaytag.decorator.TableDecorator: |
|---|
|
addRowClass, addRowId, displayGroupedValue, endOfGroup, evaluate, finish, finishRow, getCurrentRowObject, getListIndex, getViewIndex, initRow, isLastRow, startOfGroup, startRow |
| Method from org.displaytag.sample.decorators.Wrapper Detail: |
public String getDate() {
return this.dateFormat.format(((ListObject) this.getCurrentRowObject()).getDate());
}
Returns the date as a String in MM/dd/yy format. |
public String getLink1() {
ListObject object = (ListObject) getCurrentRowObject();
int index = getListIndex();
return "< a href=\"details.jsp?index=" //$NON-NLS-1$
+ index
+ "\" >" //$NON-NLS-1$
+ object.getId()
+ "< /a >"; //$NON-NLS-1$
}
Returns the TestObject's ID as a hyperlink that the person can click on and "drill down" for more details. |
public String getLink2() {
ListObject object = (ListObject) getCurrentRowObject();
int id = object.getId();
return "< a href=\"details.jsp?id=" //$NON-NLS-1$
+ id
+ "&action=view\" >View< /a > | " //$NON-NLS-1$
+ "< a href=\"details.jsp?id=" //$NON-NLS-1$
+ id
+ "&action=edit\" >Edit< /a > | " //$NON-NLS-1$
+ "< a href=\"details.jsp?id=" //$NON-NLS-1$
+ id
+ "&action=delete\" >Delete< /a >"; //$NON-NLS-1$
}
Returns an "action bar" of sorts that allow the user to perform various actions on the TestObject based on it's
id. |
public String getMoney() {
return this.moneyFormat.format(((ListObject) this.getCurrentRowObject()).getMoney());
}
Returns the money as a String in $ #,###,###.00 format. |
public String getNullValue() {
return null;
}
Test method which always returns a null value. |