Project

General

Profile

« Previous | Next » 

Revision 484f8526

Added by Patrick Plitzner over 5 years ago

ref #5691 Only have on update job at a time for ReferencingObjectsView

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/referencingobjects/ReferencingObjectsView.java
102 102
	List<CdmBase> referencingObjects = null;
103 103
	Set<CdmBase> referencingObjectsSet = null;
104 104
	IProgressMonitor actualMonitor = null;
105
	private Job currentJob = null;
105 106

  
106 107
	public ReferencingObjectsView() {
107 108
	    cdmEntitySession = CdmStore.getCurrentSessionManager().bindNullSession();
......
190 191
	        return ;
191 192
	    }
192 193
	    showEmptyPage();
193
		Job job = new Job("Update Referencing Objects " + entityUUID) {
194
	    if(currentJob!=null){
195
	        boolean success = false;
196
	        //wait for cancel to be done
197
	        while(!success){
198
	            success = currentJob.cancel();
199
	        }
200
	        currentJob = null;
201
	    }
202
		currentJob = new Job("Update Referencing Objects " + entityUUID) {
194 203

  
195 204
			@Override
196 205
			protected IStatus run(IProgressMonitor monitor) {
......
251 260

  
252 261
			}
253 262
		};
254
		job.setUser(true);
263
		currentJob.setUser(true);
255 264

  
256
		job.schedule();
265
		currentJob.schedule();
257 266
		final IJobChangeListener listener;
258 267
		listener =  new JobChangeAdapter() {
259 268
            @Override
......
263 272
            }
264 273

  
265 274
        };
266
        job.addJobChangeListener(listener);
275
        currentJob.addJobChangeListener(listener);
267 276

  
268 277

  
269 278

  

Also available in: Unified diff