@Override
protected List<AnAction> createActions() {
return Arrays.<AnAction>asList(
new AnAction("Add Add-On", "", icon("/general/add.png")) {
public void actionPerformed(AnActionEvent anActionEvent) {
final Addon addon = tableModel.getAddOn(selectedRow.get());
if (addon==null || tableModel.isInstalled(addon)) return;
final Price price = new Price(addon.getPriceCents(), addon.getPriceUnit());
if (Messages.showYesNoDialog("Add the Add-On: "+addon.getName()+" for "+price,"Add Add-On",Messages.getQuestionIcon())!=Messages.YES) return;
// ask confirmation
herokuProjectService.addAddon(addon);
HerokuAddonsWindow.this.doUpdate();
}
},
new AnAction("Remove Add-On", "", icon("/general/remove.png")) {
public void actionPerformed(AnActionEvent anActionEvent) {
final Addon addon = tableModel.getAddOn(selectedRow.get());
if (addon==null || !tableModel.isInstalled(addon)) return;
// ask confirmation
if (Messages.showYesNoDialog("Remove the Add-On:"+addon.getName(),"Remove Add-On",Messages.getQuestionIcon())!=Messages.YES) return;
herokuProjectService.removeAddon(addon);
HerokuAddonsWindow.this.doUpdate();
}
},
new AnAction("Show Documentation", "", icon("/xml/web_preview.png","/actions/preview.png")) {
public void actionPerformed(AnActionEvent anActionEvent) {
final Addon addon = tableModel.getAddOn(selectedRow.get());
if (addon==null) return;
BrowserUtil.launchBrowser(addonUrl(addon));
}
},
new AnAction("Update", "", icon("/actions/sync.png")) {