if (selections.size() == 1) {
Job job = new Job("Calculating Metrics ..") {
@Override
protected IStatus run(IProgressMonitor monitor) {
IJavaElement javaElement = (IJavaElement) selections.get(0);
AbstractMetricElement metricElement = FullMetricCaculator
.calculate(javaElement, monitor);
Activator.getDefault().getMetricsView().setSelection(
metricElement);
monitor.done();
return Status.OK_STATUS;
}
};
job.schedule();
} else {
Job job = new Job("Calculating Metrics ...") {
@Override
protected IStatus run(IProgressMonitor monitor) {
AbstractMetricElement parent = new FakeMetric();
parent = FullMetricCaculator.calculate(selections, parent,
monitor);
Activator.getDefault().getMetricsView()
.setSelection(parent);
monitor.done();