Revision e32a3655
Added by Katja Luther 11 months ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataComboElement.java | ||
---|---|---|
36 | 36 |
public class DataComboElement { |
37 | 37 |
|
38 | 38 |
Combo valueCombo; |
39 |
ContentProposalAdapter adapter; |
|
39 |
|
|
40 |
ContentProposalAdapter adapter ; |
|
41 |
|
|
40 | 42 |
/** |
41 | 43 |
* @param parent |
42 | 44 |
* @param style |
... | ... | |
59 | 61 |
System.err.println(e.getMessage()); |
60 | 62 |
} |
61 | 63 |
index++; |
62 |
} |
|
63 |
valueCombo.select(selectedIndex); |
|
64 |
} |
|
65 |
if (selectedIndex != 0) { |
|
66 |
valueCombo.select(selectedIndex); |
|
67 |
}else { |
|
68 |
if (value != null && !value.equals("null")) { |
|
69 |
valueCombo.setText(value); |
|
70 |
} |
|
71 |
} |
|
64 | 72 |
|
65 | 73 |
valueCombo.addSelectionListener(new SelectionAdapter() { |
66 | 74 |
@Override |
... | ... | |
144 | 152 |
|
145 | 153 |
} |
146 | 154 |
}); |
155 |
|
|
156 |
|
|
147 | 157 |
} |
148 | 158 |
|
149 | 159 |
|
... | ... | |
163 | 173 |
matches.add(items[i]); |
164 | 174 |
} |
165 | 175 |
} |
166 |
|
|
176 |
if (matches.size() == 0) { |
|
177 |
for (int i = 0; i < items.length; i++) { |
|
178 |
matches.add(items[i]); |
|
179 |
} |
|
180 |
} |
|
167 | 181 |
Collections.sort(matches); |
168 | 182 |
|
169 | 183 |
// We don't want to autoactivate if the only proposal exactly matches |
... | ... | |
226 | 240 |
public void setValueCombo(Combo valueCombo) { |
227 | 241 |
this.valueCombo = valueCombo; |
228 | 242 |
} |
243 |
|
|
244 |
public void setListVisible(boolean isSet) { |
|
245 |
this.valueCombo.setListVisible(isSet); |
|
246 |
} |
|
229 | 247 |
|
230 | 248 |
|
231 | 249 |
/** |
... | ... | |
234 | 252 |
public ContentProposalAdapter getAdapter() { |
235 | 253 |
return adapter; |
236 | 254 |
} |
237 |
|
|
238 |
|
|
239 |
/** |
|
240 |
* @param adapter the adapter to set |
|
241 |
*/ |
|
242 |
public void setAdapter(ContentProposalAdapter adapter) { |
|
243 |
this.adapter = adapter; |
|
244 |
} |
|
245 |
|
|
255 |
|
|
246 | 256 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/DataDialogComposite.java | ||
---|---|---|
35 | 35 |
public abstract class DataDialogComposite extends Composite { |
36 | 36 |
protected Combo noDataCombo; |
37 | 37 |
protected Composite valuesComposite; |
38 |
protected Composite headComposite; |
|
38 | 39 |
protected CharacterMatrix matrix; |
39 | 40 |
protected DescriptionElementDto editorValue; |
40 | 41 |
|
... | ... | |
94 | 95 |
for(Control c: valuesComposite.getChildren()) { |
95 | 96 |
c.setVisible(false); |
96 | 97 |
} |
98 |
if (headComposite != null) { |
|
99 |
headComposite.setEnabled(false); |
|
100 |
for(Control c: headComposite.getChildren()) { |
|
101 |
c.setVisible(false); |
|
102 |
} |
|
103 |
} |
|
97 | 104 |
// valuesComposite.dispose(); |
98 | 105 |
}else { |
99 | 106 |
valuesComposite.setEnabled(true); |
100 | 107 |
for(Control c: valuesComposite.getChildren()) { |
101 | 108 |
c.setVisible(true); |
102 | 109 |
} |
110 |
if (headComposite != null) { |
|
111 |
headComposite.setEnabled(true); |
|
112 |
for(Control c: headComposite.getChildren()) { |
|
113 |
c.setVisible(true); |
|
114 |
} |
|
115 |
} |
|
103 | 116 |
} |
104 | 117 |
|
105 | 118 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialog.java | ||
---|---|---|
46 | 46 |
this.initialInput = initialInput; |
47 | 47 |
this.matrix = matrix; |
48 | 48 |
|
49 |
|
|
49 | 50 |
} |
50 | 51 |
|
51 | 52 |
private CategoricalDataDto editorValue; |
... | ... | |
68 | 69 |
} |
69 | 70 |
initialDisplay = (sb.length() > 0)? sb.toString() : "-"; |
70 | 71 |
|
71 |
composite = new CategoricalDataDialogComposite(initialDisplay, editorValue, parent, matrix,SWT.NONE);
|
|
72 |
composite = new CategoricalDataDialogComposite(initialDisplay, this.initialInput, editorValue , parent, matrix,SWT.NONE);
|
|
72 | 73 |
return composite; |
73 | 74 |
} |
74 | 75 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/categorical/CategoricalDataDialogComposite.java | ||
---|---|---|
67 | 67 |
//lblNoDataLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); |
68 | 68 |
|
69 | 69 |
createNoDataCombo(this); |
70 |
|
|
71 |
valuesComposite = new Composite(this, SWT.NONE); |
|
72 |
valuesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); |
|
70 |
Composite headComposite = new Composite(this, SWT.NONE); |
|
71 |
headComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); |
|
73 | 72 |
|
74 |
valuesComposite.setLayout(new GridLayout(1, false)); |
|
75 |
Button addNewState = new Button(valuesComposite, SWT.NONE); |
|
73 |
headComposite.setLayout(new GridLayout(2, false)); |
|
74 |
Label lblNewLabel = new Label(headComposite, SWT.NONE); |
|
75 |
if (getModifiers() != null && !getModifiers().isEmpty()) { |
|
76 |
lblNewLabel.setText("Modifier and State"); |
|
77 |
}else { |
|
78 |
lblNewLabel.setText("State"); |
|
79 |
} |
|
80 |
|
|
81 |
Button addNewState = new Button(headComposite, SWT.NONE); |
|
76 | 82 |
addNewState.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, true, true, 1,1)); |
77 | 83 |
|
78 | 84 |
addNewState.setImage(ImageResources.getImage(ImageResources.ADD_ICON)); |
... | ... | |
83 | 89 |
DataComboElement emptyTextField = addState(valuesComposite, |
84 | 90 |
initialString == null ? null : initialString, new StateDataDto()); |
85 | 91 |
emptyTextField.getValueCombo().setFocus(); |
92 |
emptyTextField.setListVisible(true); |
|
86 | 93 |
|
87 | 94 |
refresh(); |
88 | 95 |
|
... | ... | |
92 | 99 |
} |
93 | 100 |
}); |
94 | 101 |
|
102 |
|
|
103 |
valuesComposite = new Composite(this, SWT.NONE); |
|
104 |
valuesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); |
|
105 |
|
|
106 |
valuesComposite.setLayout(new GridLayout(1, false)); |
|
107 |
|
|
95 | 108 |
List<TermDto> selectedTerms = new ArrayList<>(); |
96 | 109 |
if (editorVal != null) { |
97 | 110 |
editorVal.getStates().removeIf(s->s == null); |
... | ... | |
115 | 128 |
} |
116 | 129 |
|
117 | 130 |
emtpyDataElement.getValueCombo().setFocus(); |
131 |
//emtpyDataElement.getValueCombo(). |
|
132 |
//emtpyDataElement.getAdapter().setProposalPopupFocus(); |
|
118 | 133 |
|
119 | 134 |
} |
120 | 135 |
|
... | ... | |
173 | 188 |
gl_composite_3.verticalSpacing = 0; |
174 | 189 |
gl_composite_3.horizontalSpacing = 1; |
175 | 190 |
composite_3.setLayout(gl_composite_3); |
176 |
Label lblNewLabel = new Label(composite_3, SWT.NONE); |
|
177 |
if (getModifiers() != null && !getModifiers().isEmpty()) { |
|
178 |
lblNewLabel.setText("Modifier and Status"); |
|
179 |
}else { |
|
180 |
lblNewLabel.setText("Status"); |
|
181 |
} |
|
191 |
|
|
182 | 192 |
if (getModifiers() != null && !getModifiers().isEmpty()) { |
183 | 193 |
DataComboElement modifierCombo = new DataComboElement(composite_2, initialString, selectedState, getModifiers(), true, getStyle()); |
184 | 194 |
} |
Also available in: Unified diff
ref #10364: increase size and other layout issues