Project

General

Profile

« Previous | Next » 

Revision 4b321494

Added by Patrick Plitzner over 7 years ago

ref #5458 Fix node retrieval and taxonTree refresh

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/dbstatus/DistributionSettingsConfigWindow.java
31 31
import com.vaadin.ui.HorizontalLayout;
32 32
import com.vaadin.ui.ListSelect;
33 33
import com.vaadin.ui.Notification;
34
import com.vaadin.ui.ProgressBar;
35 34
import com.vaadin.ui.Table.ColumnHeaderMode;
36 35
import com.vaadin.ui.TextField;
37 36
import com.vaadin.ui.Tree.ExpandEvent;
......
66 65
    private ComboBox distAreaBox;
67 66
    private ListSelect namedAreaList;
68 67
    private TreeTable taxonTree;
69
    
68

  
70 69
    /**
71 70
     * The constructor should first build the main layout, set the
72 71
     * composition root and then do any custom initialization.
......
100 99
            classificationBox.setValue(new RowId(parent.getId()));
101 100
            showClassificationTaxa(getUuidAndTitleCacheFromRowId(parent));
102 101
        }
103
        
102

  
104 103
        classificationBox.addValueChangeListener(this);
105 104
        taxonFilter.addValueChangeListener(this);
106 105
        taxonTree.addExpandListener(this);
......
291 290
        // Enable polling and set frequency to 0.5 seconds
292 291
        UI.getCurrent().setPollInterval(500);
293 292
        taxonTree.setEnabled(false);
293
        taxonTree.removeAllItems();
294 294
        Notification.show("Loading taxa...");
295 295

  
296 296
        new TreeUpdater(children).start();
......
298 298

  
299 299
    private UuidAndTitleCache<TaxonNode> getUuidAndTitleCacheFromRowId(Object classificationSelection) {
300 300
        String uuidString = (String) classificationBox.getContainerProperty(classificationSelection, "uuid").getValue();
301
        int id = (int) classificationBox.getContainerProperty(classificationSelection, "id").getValue();
301
        int id = (int) classificationBox.getContainerProperty(classificationSelection, "rootNode_id").getValue();
302 302
        String titleCache = (String) classificationBox.getContainerProperty(classificationSelection, "titleCache").getValue();
303 303
        UUID uuid = UUID.fromString(uuidString);
304 304
        UuidAndTitleCache<TaxonNode> parent = new UuidAndTitleCache<>(uuid, id, titleCache);
305 305
        return parent;
306 306
    }
307
    
307

  
308 308
    private class TreeUpdater extends Thread{
309
    	
309

  
310 310
    	private Collection<UuidAndTitleCache<TaxonNode>> children;
311 311

  
312
    	
312

  
313 313
		public TreeUpdater(Collection<UuidAndTitleCache<TaxonNode>> children) {
314 314
			this.children = children;
315 315
		}

Also available in: Unified diff