Project

General

Profile

« Previous | Next » 

Revision 4fceb02d

Added by Patrick Plitzner about 3 years ago

ref #6774 Implement isPageComplete()

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/out/owl/OwlTermExportWizardPage.java
23 23

  
24 24
import eu.etaxonomy.cdm.api.service.IFeatureTreeService;
25 25
import eu.etaxonomy.cdm.api.service.IVocabularyService;
26
import eu.etaxonomy.cdm.common.CdmUtils;
26 27
import eu.etaxonomy.cdm.model.term.FeatureTree;
27 28
import eu.etaxonomy.cdm.model.term.TermType;
28 29
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
......
55 56
        termTypes.add(TermType.Character);
56 57
        List<TermVocabularyDto> areaVocabularies = CdmStore.getService(IVocabularyService.class).findVocabularyDtoByTermTypes(termTypes);
57 58
        composite.getSelectVocabularyComposite().getViewer().setInput(areaVocabularies);
59
        composite.getSelectVocabularyComposite().getViewer().addCheckStateListener(e->updateButtons());
58 60

  
59 61
        List<FeatureTree> trees = CdmStore.getService(IFeatureTreeService.class).list(FeatureTree.class, null, null, null, null);
60 62
        composite.getSelectFeatureTreeComposite().getViewer().setInput(trees);
63
        composite.getSelectFeatureTreeComposite().getViewer().addCheckStateListener(e->updateButtons());
61 64

  
62 65

  
63 66
        composite.getBtnSelectDirectory().addSelectionListener(new SelectionAdapter() {
......
77 80
                String fileString = dialog.open();
78 81
                if(fileString!=null){
79 82
                    composite.getTxtExportDirectory().setText(fileString);
83
                    updateButtons();
80 84
                }
81 85
            }
82 86
        });
83 87
        setControl(composite);
84 88
    }
85 89

  
90
    private void updateButtons(){
91
        this.getWizard().getContainer().updateButtons();
92
    }
93

  
86 94
    String getExportDirectory(){
87 95
        return composite.getExportDirectory();
88 96
    }
......
109 117
        return vocs;
110 118
    }
111 119

  
120
    @Override
121
    public boolean isPageComplete() {
122
        return !getSelectedVocabularies().isEmpty()
123
                || !getSelectedTrees().isEmpty()
124
                || CdmUtils.isNotBlank(getExportDirectory());
125
    }
126

  
112 127
}

Also available in: Unified diff