Revision 198c9340
Added by Katja Luther almost 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPerAreaStatusPage.java | ||
---|---|---|
150 | 150 |
} |
151 | 151 |
|
152 | 152 |
}); |
153 |
btnRemove = new Button(toolbar, SWT.NONE); |
|
154 |
btnRemove.addSelectionListener(new SelectionListener(){ |
|
155 |
|
|
156 |
@Override |
|
157 |
public void widgetSelected(SelectionEvent e) { |
|
158 |
|
|
159 |
PrefKey key = newAreaSpecificStatusPreference(); |
|
160 |
actualPref = PreferenceResolver.resolve(perAreaPreferences, key); |
|
161 |
actualPref = CdmPreference.NewInstance(key, null); |
|
162 |
|
|
163 |
perAreaPreferences.add(actualPref); |
|
164 |
status.setText("Preference for area " + actualArea.getLabel() + " removed."); |
|
165 |
status.setVisible(true); |
|
166 |
|
|
167 |
actualArea = null; |
|
168 |
|
|
169 |
areaText.setText(""); |
|
170 |
rememberCheckedValues(getCheckedValuesFromPreferences()); |
|
171 |
|
|
172 |
} |
|
173 |
|
|
174 |
@Override |
|
175 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
176 |
// TODO Auto-generated method stub |
|
177 |
|
|
178 |
} |
|
179 |
|
|
180 |
}); |
|
181 |
btnRemove.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON)); |
|
182 |
btnRemove.setToolTipText(""); |
|
153 |
// btnRemove = new Button(toolbar, SWT.NONE); |
|
154 |
// btnRemove.addSelectionListener(new SelectionListener(){ |
|
155 |
// |
|
156 |
// @Override |
|
157 |
// public void widgetSelected(SelectionEvent e) { |
|
158 |
// |
|
159 |
// PrefKey key = newAreaSpecificStatusPreference(); |
|
160 |
// actualPref = PreferenceResolver.resolve(perAreaPreferences, key); |
|
161 |
// actualPref = CdmPreference.NewInstance(key, null); |
|
162 |
// if (actualPref.getKey().equals(pref.getKey())){ |
|
163 |
// pref = actualPref; |
|
164 |
// } |
|
165 |
// |
|
166 |
// perAreaPreferences.add(actualPref); |
|
167 |
// if (actualArea != null){ |
|
168 |
// status.setText("Preference for area " + actualArea.getLabel() + " removed. Now the status defined for all areas are displayed"); |
|
169 |
// }else{ |
|
170 |
// status.setText("Preference for all areas is removed. Now all status will be displayed"); |
|
171 |
// } |
|
172 |
// status.setVisible(true); |
|
173 |
// |
|
174 |
// actualArea = null; |
|
175 |
// |
|
176 |
// areaText.setText(""); |
|
177 |
// rememberCheckedValues(getCheckedValuesFromPreferences()); |
|
178 |
// |
|
179 |
// } |
|
180 |
// |
|
181 |
// @Override |
|
182 |
// public void widgetDefaultSelected(SelectionEvent e) { |
|
183 |
// // TODO Auto-generated method stub |
|
184 |
// |
|
185 |
// } |
|
186 |
// |
|
187 |
// }); |
|
188 |
// btnRemove.setImage(ImageResources.getImage(ImageResources.ACTIVE_DELETE_ICON)); |
|
189 |
// btnRemove.setToolTipText(""); |
|
183 | 190 |
status = new Label(toolbar, SWT.NONE); |
184 | 191 |
status.setVisible(false); |
185 | 192 |
} |
... | ... | |
271 | 278 |
} |
272 | 279 |
|
273 | 280 |
private PrefKey newAreaSpecificStatusPreference(){ |
274 |
PrefKey prefKey = CdmPreference.NewKey(PreferenceSubject.NewInstance(PreferenceSubject.ROOT+"NamedArea["+actualArea.getUuid().toString()+"]"+PreferenceSubject.SEP), PreferencePredicate.AvailableDistributionStatus); |
|
281 |
PrefKey prefKey; |
|
282 |
if (actualArea != null){ |
|
283 |
prefKey = CdmPreference.NewKey(PreferenceSubject.NewInstance(PreferenceSubject.ROOT+"NamedArea["+actualArea.getUuid().toString()+"]"+PreferenceSubject.SEP), PreferencePredicate.AvailableDistributionStatus); |
|
284 |
}else{ |
|
285 |
prefKey = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AvailableDistributionStatus); |
|
286 |
} |
|
275 | 287 |
return prefKey; |
276 | 288 |
} |
277 | 289 |
|
Also available in: Unified diff
ref #8256: add table of all status preferences in preference page