Last change
on this file since 346 was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
File size:
884 bytes
|
Line | |
---|
1 | package genius.gui.renderer;
|
---|
2 |
|
---|
3 | import java.awt.Component;
|
---|
4 |
|
---|
5 | import javax.swing.JLabel;
|
---|
6 | import javax.swing.JTable;
|
---|
7 | import javax.swing.table.DefaultTableCellRenderer;
|
---|
8 |
|
---|
9 | import genius.core.repository.PartyRepItem;
|
---|
10 | import genius.core.repository.RepItem;
|
---|
11 |
|
---|
12 | /**
|
---|
13 | * Renders RepItems, using {@link PartyRepItem#getName()} if possible, or
|
---|
14 | * toString otherwise. Identical to {@link RepItemListCellRenderer} except that
|
---|
15 | * this is for tables.
|
---|
16 | */
|
---|
17 |
|
---|
18 | @SuppressWarnings("serial")
|
---|
19 | public class RepItemTableCellRenderer extends DefaultTableCellRenderer {
|
---|
20 |
|
---|
21 | @Override
|
---|
22 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
|
---|
23 | int row, int column) {
|
---|
24 | JLabel comp = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
|
---|
25 | comp.setText(RepItemListCellRenderer.getText((RepItem) value));
|
---|
26 | return comp;
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.