JButton btnNewDeployment = new JButton("New deployment");
btnNewDeployment.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
HostDeploymentDialog hostDeploymentDialog = new HostDeploymentDialog(getRegistry(),true,null,null,Arrays.asList(getDeployments().keySet().toArray(new String[]{})));
try {
HostDeployment deployDesc = hostDeploymentDialog.execute();
if (deployDesc!=null){
ApplicationDeploymentDescriptionType appType = deployDesc.getApplicationDescription().getType();
if (appType.getApplicationName()==null){
appType.addNewApplicationName();
}
HostDescriptionType hostType = deployDesc.getHostDescription().getType();
appType.getApplicationName().setStringValue(hostType.getHostName()+"_application");
getDeployments().put(hostType.getHostName(), deployDesc);
updateDeploymentTable();
}
} catch (AiravataAPIInvocationException e1) {