Project

General

Profile

Revision 6dfca4b2

ID6dfca4b274efeafce1df3f9e8959b7d6f98ae721
Parent c5066c73
Child b2765124

Added by Patrick Plitzner over 2 years ago

ref #7095 Load description remotely

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/matrix/CharacterMatrix.java
24 24

  
25 25
import org.apache.commons.collections4.map.LinkedMap;
26 26
import org.eclipse.core.runtime.ICoreRunnable;
27
import org.eclipse.core.runtime.IProgressMonitor;
27 28
import org.eclipse.core.runtime.jobs.Job;
28 29
import org.eclipse.jface.layout.GridDataFactory;
29 30
import org.eclipse.jface.viewers.ArrayContentProvider;
......
1008 1009

  
1009 1010
    public void loadDescriptions(WorkingSet workingSet) {
1010 1011
        UUID monitorUuid = CdmStore.getService(IWorkingSetService.class).monitGetRowWrapper(workingSet);
1012
        IProgressMonitorService progressMonitorService = CdmApplicationState.getCurrentAppConfig().getProgressMonitorService();
1011 1013

  
1012
        final IProgressMonitorService progressMonitorService = CdmApplicationState.getCurrentAppConfig().getProgressMonitorService();
1013
        final IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(monitorUuid);
1014 1014

  
1015 1015
        String jobLabel = "Load character data";
1016 1016
        Job job = Job.create(jobLabel, (ICoreRunnable) monitor -> {
1017
            monitor.beginTask(jobLabel, remotingMonitor.getTotalWork());
1018
            while(remotingMonitor.isMonitorThreadRunning()){
1017
            monitor.beginTask(jobLabel, IProgressMonitor.UNKNOWN);
1018
            while(progressMonitorService.isMonitorThreadRunning(monitorUuid)){
1019 1019
                if(monitor.isCanceled()){
1020
                    remotingMonitor.getThread().interrupt();
1020
                    progressMonitorService.interrupt(monitorUuid);
1021 1021
                }
1022 1022
            }
1023

  
1023
            IRemotingProgressMonitor remotingMonitor = progressMonitorService.getRemotingMonitor(monitorUuid);
1024 1024
            Collection<RowWrapperDTO> wrappers = (Collection<RowWrapperDTO>) remotingMonitor.getResult();
1025 1025
            if(wrappers!=null){
1026 1026
                wrappers.forEach(wrapper->CharacterMatrix.this.descriptions.add(wrapper));

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)