public void update(AnActionEvent e) {
setEnabled(!herokuProjectService.isHerokuProject());
}
public void runActionPerformed(AnActionEvent anActionEvent) {
final App app = tableModel.getApplication(selectedRow.get());
if (app == null) return;
final GitRemoteInfo attachedRemote = GitHelper.attachRemote(getProject(), app);
if (attachedRemote != null) {
LOG.info("Attached remote " + attachedRemote.getName() + ":" + attachedRemote.getUrl() + " to project " + getProject().getName());
herokuProjectService.update(app);
updatePanels();
HerokuSetupWindow.this.doUpdate();
} else {
LOG.warn("No attached remote attached to project " + getProject().getName());
}
}
},
new JBBackgroundAction("New App", "Create and Attach Heroku Application", icon("/general/add.png")) {
{
update(null);
}
@Override
public void update(AnActionEvent e) {
setEnabled(!herokuProjectService.isHerokuProject());
}
public void runActionPerformed(AnActionEvent anActionEvent) {
try {
Pair<String,Heroku.Stack> newApplicationInfo = Notifications.showCreateNewAppDialog();
if (newApplicationInfo==null) return;
App newApp = herokuProjectService.getApplicationService().createApplication(newApplicationInfo.first, newApplicationInfo.second);
herokuProjectService.update(newApp);
GitHelper.attachRemote(getProject(), newApp);
updatePanels();
} catch (Exception e) {
LOG.warn("Error creating application: "+e.getMessage(),e);
Messages.showErrorDialog("Error creating application: " + e.getMessage(), "Error Creating Heroku Application");
}
}
},
new JBBackgroundAction("Destroy App", "Destroy Heroku Application", icon("/general/remove.png")) {
{
update(null);
}
@Override
public void update(AnActionEvent e) {
setEnabled(herokuProjectService.isHerokuProject());
}
public void runActionPerformed(AnActionEvent anActionEvent) {
try {
App app = tableModel.getApplication(selectedRow.get());
if (app==null) return;
if (Messages.showYesNoDialog("Really destroy app "+app.getName()+" this is irrecoverable!","Destroy App",Messages.getWarningIcon())!=Messages.YES) return;
herokuProjectService.getApplicationService().destroyApp(app);
Notifications.notifyModalInfo("Destroyed App", "Sucessfully Destroyed App " + app.getName());
HerokuSetupWindow.this.doUpdate();
if (app.getName().equals(herokuProjectService.getApp().getName())) {
herokuProjectService.update(null);
GitHelper.removeRemote(getProject(), app);
updatePanels();
}
} catch (Exception e) {