Object o = ((IStructuredSelection)selection).getFirstElement();
if(o instanceof IScanAlert) {
IScanAlert alert = (IScanAlert) o;
displayAlert(alert);
} else if (o instanceof AlertScanNode) {
final AlertScanNode node = (AlertScanNode) o;
displayScanSummary(node.getScanInstance());
} else if (o instanceof AlertTitleNode) {
final AlertTitleNode node = (AlertTitleNode) o;
if(node.getAlertCount() == 1) {
displayAlert(node.getFirstAlert());
}
}
}
});
stackLayout.topControl = dashboard;
contentPanel.layout();
final IModel model = Activator.getDefault().getModel();
if(model != null) {
setCurrentWorkspace(model.addWorkspaceListener(this));
}
IStructuredSelection selection = (IStructuredSelection) getSite().getPage().getSelection(ScanAlertView.ID);
if(selection != null && selection.getFirstElement() instanceof AlertScanNode) {
AlertScanNode node = (AlertScanNode) selection.getFirstElement();
displayScanSummary(node.getScanInstance());
}
}