public VerifierContentProvider() { // TODO remove job from JobPool when it has finished. // for now, we just use unique names. String jobName = BASE_JOBNAME + " " + StringTool.unique(BASE_JOBNAME); // $NON-NLS-1$ job = new DataLoader(jobName); globalJob = job; if (JobPool.getJobPool().getJob(job.getJobname()) == null) { JobPool.getJobPool().addJob(job); } job.addListener(this); }
@SuppressWarnings("unchecked") public Object[] getElements(Object parent) { Object result = job.getData(); if (result == null) { JobPool.getJobPool().activate(job.getJobname(), Job.LONG); return new String[] {Messages.ExterneDokumente_loading}; } else { if (result instanceof List) { return ((List) result).toArray(); } else if (result instanceof String) { return new Object[] {result}; } else { return null; } } }