Project

General

Profile

« Previous | Next » 

Revision 7add6872

Added by Alexander Oppermann over 7 years ago

Fixed Bug #4531

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditor.java
493 493
    @SuppressWarnings({ "unchecked", "rawtypes" })
494 494
	public void reload(){
495 495
    	//create new Items for Dropdown menue
496
    	Table table = viewer.getTable();
497
    	table.setRedraw(false);
496 498
    	SortedSet<DefinedTermBase> oldTerms = terms;
497 499
    	ChecklistLabelProvider labelProvider = new ChecklistLabelProvider();
498 500
    	terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(), CdmStore.getDefaultLanguage());
......
501 503
    	hideDistributionColumns(oldTerms);
502 504
    	createToolbarItems();
503 505
    	toolItem.addSelectionListener(dropListener);
504
        newTerms.removeAll(oldTerms);
505
        if(newTerms.size() > 0){
506
        	for(DefinedTermBase term:newTerms){
507
        		int count = viewer.getTable().getColumnCount();
508
        		addTableViewerColumn(term.getTitleCache(), 200, count);
509
        		acitivateNewColumnInDropDownMenu(term);
510
        	}
511
        }
506
    	for(DefinedTermBase term:newTerms){
507
    		int count = viewer.getTable().getColumnCount();
508
    		addTableViewerColumn(term.getTitleCache(), 200, count);
509
    		acitivateNewColumnInDropDownMenu(term);
510
    	}
512 511
        viewer.setLabelProvider(new ChecklistLabelProvider(viewer));
513 512
        getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes), Job.LONG);
513
        table.setRedraw(true);
514 514
    	viewer.refresh();
515 515
    }
516 516

  
......
526 526
	}
527 527

  
528 528
	private void hideDistributionColumns(SortedSet<DefinedTermBase> oldTerms) {
529
		//FIXME: THERE IS A BUG WITH THE getColumns() functin.
530 529
		TableColumn[] columns = viewer.getTable().getColumns();
531 530
    	for(int i=4; i<columns.length; i++){
532
    		columns[i].setWidth(0);
531
    		//remove all columns
532
    		columns[i].dispose();
533 533
    		Menu menu = dropListener.getMenu();
534 534
    		int itemCount = menu.getItemCount();
535 535
    		MenuItem item = menu.getItem(i-3);

Also available in: Unified diff