40 |
40 |
import eu.etaxonomy.cdm.vaadin.util.DistributionEditorUtil;
|
41 |
41 |
|
42 |
42 |
/**
|
43 |
|
*
|
|
43 |
*
|
44 |
44 |
* @author pplitzner
|
45 |
45 |
*
|
46 |
46 |
*/
|
... | ... | |
64 |
64 |
*
|
65 |
65 |
* The constructor will not be automatically regenerated by the
|
66 |
66 |
* visual editor.
|
67 |
|
* @param distributionTableView
|
|
67 |
* @param distributionTableView
|
68 |
68 |
*/
|
69 |
69 |
public DistributionSettingsConfigWindow(DistributionTableView distributionTableView) {
|
70 |
70 |
buildMainLayout();
|
... | ... | |
75 |
75 |
private void init() {
|
76 |
76 |
Container distributionContainer = presenter.getDistributionContainer();
|
77 |
77 |
TermVocabulary<NamedArea> chosenArea = presenter.getChosenArea();
|
78 |
|
|
|
78 |
|
79 |
79 |
classificationBox.setItemCaptionPropertyId(TaxonNodeContainer.LABEL);
|
80 |
80 |
classificationBox.setContainerDataSource(new TaxonNodeContainer(null));
|
81 |
81 |
classificationBox.setImmediate(true);
|
... | ... | |
90 |
90 |
distAreaBox.setContainerDataSource(distributionContainer);
|
91 |
91 |
distAreaBox.setValue(chosenArea);
|
92 |
92 |
distAreaBox.addValueChangeListener(this);
|
93 |
|
|
|
93 |
|
94 |
94 |
if(chosenArea!=null){
|
95 |
95 |
NamedAreaContainer container = new NamedAreaContainer(chosenArea);
|
96 |
96 |
namedAreaList.setContainerDataSource(container);
|
97 |
97 |
}
|
98 |
98 |
Object selectedAreas = VaadinSession.getCurrent().getAttribute(DistributionEditorUtil.SATTR_SELECTED_AREAS);
|
99 |
99 |
namedAreaList.setValue(selectedAreas);
|
100 |
|
|
|
100 |
|
101 |
101 |
okButton.addClickListener(this);
|
102 |
102 |
cancelButton.addClickListener(this);
|
103 |
103 |
}
|
... | ... | |
122 |
122 |
|
123 |
123 |
VerticalLayout leftContainer = new VerticalLayout();
|
124 |
124 |
leftContainer.setImmediate(false);
|
125 |
|
leftContainer.setSizeFull();
|
126 |
125 |
leftContainer.setSpacing(true);
|
127 |
126 |
|
128 |
127 |
VerticalLayout rightContainer = new VerticalLayout();
|
129 |
128 |
rightContainer.setImmediate(false);
|
130 |
|
rightContainer.setSizeFull();
|
131 |
129 |
rightContainer.setSpacing(true);
|
132 |
130 |
|
133 |
131 |
//classification and term
|
... | ... | |
144 |
142 |
namedAreaList = new ListSelect();
|
145 |
143 |
namedAreaList.setCaption("Areas");
|
146 |
144 |
namedAreaList.setWidth("100%");
|
|
145 |
namedAreaList.setSizeFull();
|
147 |
146 |
namedAreaList.setMultiSelect(true);
|
148 |
147 |
|
149 |
148 |
//taxonomy
|
150 |
149 |
taxonTree = new Tree("Taxonomy");
|
151 |
150 |
taxonTree.setImmediate(false);
|
152 |
|
|
|
151 |
|
153 |
152 |
//no classification selected label
|
154 |
153 |
labelNoClassification = new Label(" - Please select a classification - ");
|
155 |
154 |
|
156 |
155 |
leftContainer.addComponent(classificationBox);
|
|
156 |
leftContainer.setExpandRatio(classificationBox, 0.1f);
|
157 |
157 |
leftContainer.addComponent(distAreaBox);
|
|
158 |
leftContainer.setExpandRatio(distAreaBox, 0.1f);
|
158 |
159 |
leftContainer.addComponent(namedAreaList);
|
|
160 |
leftContainer.setExpandRatio(namedAreaList, 0.8f);
|
159 |
161 |
leftContainer.setSizeFull();
|
160 |
|
|
|
162 |
|
161 |
163 |
rightContainer.addComponent(taxonTree);
|
162 |
164 |
rightContainer.setExpandRatio(taxonTree, 1);
|
163 |
165 |
rightContainer.addComponent(labelNoClassification);
|
ref #5458 Layout for settings windows