buttons = new HashMap<MetadataEntry, JButton>();
final MetadataTableModel model = (MetadataTableModel) table.getModel();
for (int row=0; row<model.getRowCount(); row++) {
final MetadataEntry entry = model.getEntryAt(row);
if (entry.hasDefaultValue()) {
JButton button = new CoolButton();
button.setIcon(icon);
button.setToolTipText(LOCALE.get("DefaultButtonToolTip"));
buttons.put(entry, button);
button.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
entry.setDefaultValue(meta);
model.commit();
table.repaint();
}
}
);
add(button);
button.setEnabled(! ApplicationMode.isBasicMode());
ApplicationMode.maybeSetToolTip(button);
}
}
}