KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > components > table > renderer > FixedTextCellRenderer


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.webwork.components.table.renderer;
6
7 import com.opensymphony.webwork.components.table.WebTable;
8
9
10 /**
11  * usefull if a column has an embeded ID number needed for a link but you want it to
12  * say something else.
13  */

14 public class FixedTextCellRenderer extends AbstractCellRenderer {
15     //~ Instance fields ////////////////////////////////////////////////////////
16

17     /**
18      * this is the text that will be shown in the column
19      */

20     protected String JavaDoc _text = "";
21
22     //~ Methods ////////////////////////////////////////////////////////////////
23

24     public String JavaDoc getCellValue(WebTable table, Object JavaDoc data, int row, int col) {
25         return _text;
26     }
27
28     public void setText(String JavaDoc text) {
29         _text = text;
30     }
31
32     public String JavaDoc getText() {
33         return _text;
34     }
35 }
36
Popular Tags