private AbstractAction createDeinstallAction(final AddOnTableModel tableModel) {
return new AbstractAction() {
public void actionPerformed(ActionEvent e) {
final int row = Integer.parseInt(e.getActionCommand());
final AddOnProperties addOn = tableModel.getAddOnAt(row);
if (!addOn.supportsOperation(AddOnProperties.OP_DEINSTALL)) {
UITools.errorMessage(getText("cannot.deinstall", addOn.getTranslatedName()));
}
else {
int result = JOptionPane.showConfirmDialog(ManageAddOnsPanel.this,
getText("really.deinstall", TextUtils.getText(addOn.getNameKey())), getText("deinstall"),
JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
deinstall(tableModel, addOn);
repaint();
UITools.informationMessage(getText("deinstallation.success", addOn.getTranslatedName()));
}
}
}
private void deinstall(final AddOnTableModel tableModel, final AddOnProperties addOn) {