1 | |
|
2 | |
|
3 | |
|
4 | |
package org.homeunix.thecave.buddi.view.swing; |
5 | |
|
6 | |
import java.awt.Component; |
7 | |
|
8 | |
import javax.swing.DefaultListCellRenderer; |
9 | |
import javax.swing.JList; |
10 | |
|
11 | |
import org.homeunix.thecave.buddi.model.ScheduledTransaction; |
12 | |
|
13 | 1845 | public class ScheduledTransactionListCellRenderer extends DefaultListCellRenderer { |
14 | |
public static final long serialVersionUID = 0; |
15 | |
|
16 | |
@Override |
17 | |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { |
18 | 0 | super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); |
19 | |
|
20 | 0 | if (value instanceof ScheduledTransaction) |
21 | 0 | this.setText(((ScheduledTransaction) value).getScheduleName()); |
22 | |
else |
23 | 0 | this.setText(""); |
24 | |
|
25 | 0 | return this; |
26 | |
} |
27 | |
} |