use of org.netxms.ui.eclipse.widgets.AnimatedImage in project netxms by netxms.
the class PerformanceTab method objectChanged.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#objectChanged(org.netxms.client.objects.AbstractObject)
*/
@Override
public void objectChanged(final AbstractObject object) {
for (PerfTabGraph chart : charts.values()) chart.dispose();
charts.clear();
if (object == null)
return;
if (waitingImage != null)
waitingImage.dispose();
waitingImage = new AnimatedImage(chartArea, SWT.NONE);
waitingImage.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true, 2, 1));
try {
// $NON-NLS-1$
waitingImage.setImage(new URL("platform:/plugin/org.netxms.webui.core/icons/progress.gif"));
} catch (MalformedURLException e) {
}
updateChartAreaLayout();
final NXCSession session = (NXCSession) ConsoleSharedData.getSession();
Job job = new Job(Messages.get().PerformanceTab_JobName) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
final PerfTabDci[] items = session.getPerfTabItems(object.getObjectId());
final Display display = PerformanceTab.this.getClientArea().getDisplay();
new UIJob(display, Messages.get(display).PerformanceTab_JobName) {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!getClientArea().isDisposed() && (PerformanceTab.this.getObject() != null) && (PerformanceTab.this.getObject().getObjectId() == object.getObjectId())) {
update(items);
}
return Status.OK_STATUS;
}
}.schedule();
} catch (Exception e) {
// $NON-NLS-1$
Activator.logError("Exception in performance tab loading job", e);
}
return Status.OK_STATUS;
}
};
job.setSystem(true);
job.schedule();
}
Aggregations