linkUrlTable.setAutoCreateRowSorter(true);
linkUrlTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ // adjust row height so radio buttons actually fit
+ // don't do this in the renderer, it causes the awt thread to activate
+ // constantly
+ JRadioButton temp = new JRadioButton();
+ linkUrlTable.setRowHeight(temp.getMinimumSize().height);
+
// Table in scrollpane so that the table is given a scrollbar
JScrollPane linkScrollPane = new JScrollPane(linkUrlTable);
linkScrollPane.setBorder(null);
filterTB.setFont(LABEL_FONT);
filterTB.setText("");
- doReset.setText(MessageManager.getString("action.reset"));
+ doReset.setText(MessageManager.getString("action.showall"));
userOnly.setText(MessageManager.getString("action.customfilter"));
// Panel for filter functionality
// set colours to match rest of table
if (isSelected)
- {
- setBackground(table.getSelectionBackground());
- setForeground(table.getSelectionForeground());
- }
- else
- {
- setBackground(table.getBackground());
- setForeground(table.getForeground());
+ {
+ setBackground(table.getSelectionBackground());
+ setForeground(table.getSelectionForeground());
+ }
+ else
+ {
+ setBackground(table.getBackground());
+ setForeground(table.getForeground());
}
- // adjust row height so radio buttons actually fit
- table.setRowHeight(row, getMinimumSize().height);
-
return this;
}
}
public class RadioButtonEditor extends AbstractCellEditor implements
- TableCellEditor
- {
- private JRadioButton button = new JRadioButton();
-
- public RadioButtonEditor()
+ TableCellEditor
{
- this.button.setHorizontalAlignment(SwingConstants.CENTER);
- this.button.addActionListener(new ActionListener()
+ private JRadioButton button = new JRadioButton();
+
+ public RadioButtonEditor()
{
- @Override
- public void actionPerformed(ActionEvent e)
+ // this.button.setHorizontalAlignment(SwingConstants.CENTER);
+ this.button.addActionListener(new ActionListener()
{
- fireEditingStopped();
- }
- });
- }
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ fireEditingStopped();
+ }
+ });
+ }
- @Override
- public Component getTableCellEditorComponent(JTable table,
- Object value, boolean isSelected, int row, int column)
- {
+ @Override
+ public Component getTableCellEditorComponent(JTable table,
+ Object value, boolean isSelected, int row, int column)
+ {
button.setSelected((boolean) value);
- return button;
- }
+ return button;
+ }
- @Override
- public Object getCellEditorValue()
- {
+ @Override
+ public Object getCellEditorValue()
+ {
return button.isSelected();
- }
+ }
}
}