use of com.microsoft.azuretools.azurecommons.deploy.DeploymentEventArgs in project azure-tools-for-java by Microsoft.
the class ActivityLogToolWindowFactory method registerDeploymentListener.
public void registerDeploymentListener() {
AzurePlugin.addDeploymentEventListener(new DeploymentEventListener() {
@Override
public void onDeploymentStep(final DeploymentEventArgs args) {
// unique identifier for deployment
String key = args.getId() + args.getStartTime().getTime();
if (rows.containsKey(key)) {
final DeploymentTableItem item = rows.get(key);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
item.progress = args.getDeployCompleteness();
if (args.getDeployMessage().equalsIgnoreCase(message("runStatus"))) {
String html = String.format("%s%s%s%s", " ", "<html><a href=\"" + args.getDeploymentURL() + "\">", message("runStatusVisible"), "</a></html>");
item.description = message("runStatusVisible");
item.link = args.getDeploymentURL();
if (!ToolWindowManager.getInstance(project).getToolWindow(ActivityLogToolWindowFactory.ACTIVITY_LOG_WINDOW).isVisible()) {
ToolWindowManager.getInstance(project).notifyByBalloon(ACTIVITY_LOG_WINDOW, MessageType.INFO, html, null, new BrowserHyperlinkListener());
}
} else {
item.description = args.getDeployMessage();
}
table.getListTableModel().fireTableDataChanged();
}
});
} else {
final DeploymentTableItem item = new DeploymentTableItem(args.getId(), args.getDeployMessage(), dateFormat.format(args.getStartTime()), args.getDeployCompleteness());
rows.put(key, item);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
table.getListTableModel().addRow(item);
}
});
}
}
});
}
Aggregations