01: /*
02: * Criado em 26/11/2004
03: */
04: package br.com.gfp.windows.componentes;
05:
06: import java.awt.Component;
07:
08: import javax.swing.JTable;
09:
10: import br.com.gfp.internationalization.TableHeaderMessages;
11: import br.com.gfpshare.beans.table.SortableTabelHeaderRenderer;
12:
13: /**
14: * Este é um Table header capaz de renderizar os nomes das colunas do JTable usando-os
15: * como tag's para realizar a internacionalização desses nomes.
16: *
17: * @author Igor Regis da Silva Simoes
18: * @see br.com.gfpshare.beans.table.SortableTabelHeaderRenderer
19: */
20: public class GFPHeaderRenderer extends SortableTabelHeaderRenderer {
21:
22: /**
23: * @see br.com.gfpshare.beans.table.SortableTabelHeaderRenderer#getTableCellRendererComponent(javax.swing.JTable, java.lang.Object, boolean, boolean, int, int)
24: */
25: @Override
26: public Component getTableCellRendererComponent(JTable table,
27: Object value, boolean isSelected, boolean hasFocus,
28: int row, int column) {
29: super .getTableCellRendererComponent(table, value, isSelected,
30: hasFocus, row, column);
31:
32: setValue(" "
33: + TableHeaderMessages.getMessages().getString(
34: value.toString()));
35: setToolTipText(TableHeaderMessages.getMessages().getString(
36: value.toString()));
37:
38: return this;
39: }
40: }
|