- Timestamp:
- 2003-05-27T15:57:37+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/HeaderRenderer.java
r4293 r4366 47 47 */ 48 48 public class HeaderRenderer 49 50 51 52 53 54 55 56 57 58 59 49 extends JToggleButton 50 implements TableCellRenderer { 51 /** The constructor sets up a margin around the button, and adds the filter icons. 52 * @see org.greenstone.gatherer.util.Utility 53 */ 54 public HeaderRenderer() { 55 setMargin(new Insets(0,0,0,0)); 56 setIcon(Utility.getImage("filter.gif")); 57 setSelectedIcon(Utility.getImage("filter-on.gif")); 58 } 59 /** Called to create the component to be used as the 'rubber-stamp' for the table cell given the follwing arguments. 60 60 * @param table The <strong>JTable</strong> that is asking the renderer to draw; can be <i>null</i>. 61 61 * @param value The value of the cell to be rendered as an <strong>Object</strong>. It is up to the specific renderer to interpret and draw the value. For example, if value is the string "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid value. … … 66 66 * @see org.greenstone.gatherer.gui.metaaudit.MetaAuditTable 67 67 */ 68 69 70 71 72 73 74 75 68 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 69 setText(value.toString()); 70 MetaAuditTable temp = (MetaAuditTable) table; 71 if(temp != null) { // And it may if this is called during table init. 72 setSelected(temp.isFiltered(column)); 73 } 74 return this; 75 } 76 76 }
Note:
See TracChangeset
for help on using the changeset viewer.