Revision 08a36bdf
Added by Katja Luther almost 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/DescriptiveDataSetEditor.java | ||
---|---|---|
62 | 62 |
import eu.etaxonomy.cdm.model.description.Feature; |
63 | 63 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
64 | 64 |
import eu.etaxonomy.cdm.model.name.Rank; |
65 |
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode; |
|
66 | 65 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
67 | 66 |
import eu.etaxonomy.cdm.model.term.DefinedTermBase; |
68 | 67 |
import eu.etaxonomy.cdm.model.term.TermTree; |
... | ... | |
252 | 251 |
} |
253 | 252 |
Viewer taxonTreeViewer = getTaxonTreeViewer(); |
254 | 253 |
Object input = taxonTreeViewer.getInput(); |
255 |
Collection<TaxonNode> treeNodes; |
|
254 |
Collection<TaxonNodeDto> treeNodes;
|
|
256 | 255 |
if(input==null){ |
257 | 256 |
treeNodes = new ArrayList<>(); |
258 | 257 |
} |
259 | 258 |
else{ |
260 |
treeNodes = (Collection<TaxonNode>) input; |
|
259 |
treeNodes = (Collection<TaxonNodeDto>) input;
|
|
261 | 260 |
} |
262 |
treeNodes.add(taxonNode); |
|
261 |
treeNodes.add(taxonNodeDto);
|
|
263 | 262 |
taxonTreeViewer.setInput(treeNodes); |
264 | 263 |
dirty.setDirty(true); |
265 | 264 |
} |
266 | 265 |
|
267 | 266 |
public void removeSelectedTaxonNodes(){ |
268 | 267 |
IStructuredSelection selection = (IStructuredSelection) composite.getTaxonNodeTree().getSelection(); |
269 |
if(selection.toList().stream().anyMatch(object->!(object instanceof TaxonNode))){ |
|
268 |
if(selection.toList().stream().anyMatch(object->!(object instanceof TaxonNodeDto))){
|
|
270 | 269 |
MessagingUtils.warningDialog(Messages.DescriptiveDataSetEditor_DELETE_FAIL_TITLE, this.getClass(), Messages.DescriptiveDataSetEditor_DELETE_FAIL_MESSAGE); |
271 | 270 |
return; |
272 | 271 |
} |
273 | 272 |
Iterator<Object> iterator = selection.iterator(); |
274 | 273 |
Viewer taxonTreeViewer = getTaxonTreeViewer(); |
275 |
Collection<TaxonNode> input = (Collection<TaxonNode>) taxonTreeViewer.getInput();
|
|
274 |
Collection<TaxonNodeDto> input = (Collection<TaxonNodeDto>) taxonTreeViewer.getInput();
|
|
276 | 275 |
while(iterator.hasNext()){ |
277 | 276 |
Object next = iterator.next(); |
278 |
TaxonNode taxonNode = (TaxonNode) next;
|
|
277 |
TaxonNodeDto taxonNode = (TaxonNodeDto) next;
|
|
279 | 278 |
input.remove(taxonNode); |
280 |
descriptiveDataSet.removeTaxonSubtree(taxonNode); |
|
279 |
TaxonNode node = CdmStore.getService(ITaxonNodeService.class).load(taxonNode.getUuid()); |
|
280 |
descriptiveDataSet.removeTaxonSubtree(node); |
|
281 | 281 |
} |
282 | 282 |
taxonTreeViewer.setInput(input); |
283 | 283 |
dirty.setDirty(true); |
... | ... | |
286 | 286 |
@Persist |
287 | 287 |
@Override |
288 | 288 |
public void save(IProgressMonitor monitor) { |
289 |
|
|
290 |
if (!conversation.isBound()) { |
|
291 |
conversation.bind(); |
|
292 |
|
|
293 |
} |
|
294 |
conversation.commit(true); |
|
289 | 295 |
Collection<TermDto> areas = composite.getAreas(); |
290 | 296 |
Object input = composite.getTaxonNodeTree().getInput(); |
291 | 297 |
if(input!=null){ |
292 | 298 |
descriptiveDataSet.setTaxonSubtreeFilter(new HashSet<>());//clear existing filter |
293 |
Collection<ITaxonTreeNode> taxonNodes = (Collection<ITaxonTreeNode>) input; |
|
294 |
for (ITaxonTreeNode taxonTreeNode : taxonNodes) { |
|
295 |
if(taxonTreeNode instanceof TaxonNode){ |
|
296 |
TaxonNode taxonNode = (TaxonNode)taxonTreeNode; |
|
297 |
descriptiveDataSet.addTaxonSubtree(taxonNode); |
|
298 |
} |
|
299 |
Collection<TaxonNodeDto> taxonNodes = (Collection<TaxonNodeDto>) input; |
|
300 |
for (TaxonNodeDto taxonTreeNode : taxonNodes) { |
|
301 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonTreeNode.getUuid()); |
|
302 |
descriptiveDataSet.addTaxonSubtree(taxonNode); |
|
299 | 303 |
} |
300 | 304 |
} |
301 | 305 |
TermTree<Feature> characters = composite.getCharacters(); |
... | ... | |
325 | 329 |
terms.forEach(term->areaTerms.add((NamedArea) term)); |
326 | 330 |
descriptiveDataSet.setGeoFilter(areaTerms); |
327 | 331 |
|
328 |
conversation.commit(); |
|
332 |
// conversation.commit();
|
|
329 | 333 |
CdmStore.getService(IDescriptiveDataSetService.class).merge(descriptiveDataSet, true); |
330 |
//event for updatin matrix |
|
334 |
//event for updating matrix
|
|
331 | 335 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DESCRIPTIVE_DATASET, descriptiveDataSet.getUuid()); |
332 | 336 |
dirty.setDirty(false); |
333 | 337 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/DeleteDescriptiveDataSetHandler.java | ||
---|---|---|
17 | 17 |
import org.eclipse.e4.ui.services.IServiceConstants; |
18 | 18 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
19 | 19 |
import org.eclipse.jface.viewers.IStructuredSelection; |
20 |
import org.eclipse.swt.widgets.Shell; |
|
20 | 21 |
|
21 | 22 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
22 | 23 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
24 |
import eu.etaxonomy.cdm.api.service.config.DeleteDescriptiveDataSetConfigurator; |
|
23 | 25 |
import eu.etaxonomy.cdm.common.monitor.IRemotingProgressMonitor; |
24 | 26 |
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet; |
25 | 27 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
... | ... | |
28 | 30 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
29 | 31 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
30 | 32 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
33 |
import eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator.DeleteConfiguratorDialog; |
|
31 | 34 |
|
32 | 35 |
public class DeleteDescriptiveDataSetHandler { |
33 | 36 |
protected EPartService partService; |
34 | 37 |
|
35 | 38 |
@Execute |
36 | 39 |
public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)IStructuredSelection selection, |
37 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, EPartService partService) { |
|
38 |
boolean confirm = MessagingUtils.confirmDialog(Messages.DeleteDescriptiveDataSetHandler_DELETE_TITLE, Messages.DeleteDescriptiveDataSetHandler_DELETE_MESSAGE); |
|
40 |
@Named(IServiceConstants.ACTIVE_PART)MPart activePart, |
|
41 |
@Named(IServiceConstants.ACTIVE_SHELL)Shell shell, |
|
42 |
EPartService partService) { |
|
43 |
// boolean confirm = MessagingUtils.confirmDialog(Messages.DeleteDescriptiveDataSetHandler_DELETE_TITLE, Messages.DeleteDescriptiveDataSetHandler_DELETE_MESSAGE); |
|
39 | 44 |
this.partService = partService; |
40 | 45 |
Object object = activePart.getObject(); |
41 |
if(!selection.isEmpty() && confirm && object instanceof DescriptiveDataSetNavigator){
|
|
46 |
if(!selection.isEmpty() && object instanceof DescriptiveDataSetNavigator){ |
|
42 | 47 |
Iterator iterator = selection.iterator(); |
43 | 48 |
while(iterator.hasNext()){ |
44 | 49 |
Object next = iterator.next(); |
45 | 50 |
if(next instanceof DescriptiveDataSet){ |
51 |
DeleteDescriptiveDataSetConfigurator deleteConfig = new DeleteDescriptiveDataSetConfigurator(); |
|
52 |
|
|
53 |
if (!DeleteConfiguratorDialog.openConfirmWithConfigurator(deleteConfig, shell, Messages.DeleteDescriptiveDataSetHandler_DELETE_TITLE, Messages.DeleteDescriptiveDataSetHandler_DELETE_MESSAGE)){ |
|
54 |
return; |
|
55 |
} |
|
46 | 56 |
// IDescriptiveDataSetService descriptiveDataSetService = CdmStore.getService(IDescriptiveDataSetService.class); |
47 | 57 |
// descriptiveDataSetService.delete(((DescriptiveDataSet) next).getUuid()); |
48 |
deleteDescriptiveDataSet(((DescriptiveDataSet) next).getUuid()); |
|
58 |
deleteDescriptiveDataSet(((DescriptiveDataSet) next).getUuid(), deleteConfig);
|
|
49 | 59 |
DescriptiveDataSetNavigator navigator = (DescriptiveDataSetNavigator) object; |
50 | 60 |
navigator.removeDescriptiveDataSet((DescriptiveDataSet) next); |
51 | 61 |
navigator.getConversationHolder().commit(); |
... | ... | |
60 | 70 |
} |
61 | 71 |
} |
62 | 72 |
|
63 |
private void deleteDescriptiveDataSet(UUID descriptiveDataSetUuid){ |
|
73 |
private void deleteDescriptiveDataSet(UUID descriptiveDataSetUuid, DeleteDescriptiveDataSetConfigurator deleteConfig){
|
|
64 | 74 |
EditorUtil.closeObsoleteDescriptiveDatasetEditor(descriptiveDataSetUuid, partService); |
65 |
UUID monitorUuid = CdmApplicationState.getLongRunningTasksService().deleteDescriptiveDataset(descriptiveDataSetUuid); |
|
75 |
UUID monitorUuid = CdmApplicationState.getLongRunningTasksService().deleteDescriptiveDataset(descriptiveDataSetUuid, deleteConfig);
|
|
66 | 76 |
|
67 | 77 |
String jobLabel = "Delete descriptive dataset"; |
68 | 78 |
Job job = Job.create(jobLabel, (ICoreRunnable) monitor -> { |
... | ... | |
83 | 93 |
} |
84 | 94 |
else if(resultObject instanceof UpdateResult){ |
85 | 95 |
UpdateResult result = (UpdateResult)resultObject; |
96 |
|
|
86 | 97 |
if(!result.getExceptions().isEmpty() && result.isOk()){ |
87 |
MessagingUtils.warningDialog(Messages.DeleteDescriptiveDatasetHandler_Warning_Message, this,
|
|
98 |
MessagingUtils.messageDialog(Messages.DeleteDescriptiveDatasetHandler_Warning_Message, this,
|
|
88 | 99 |
String.format(Messages.DeleteDescriptiveDatasetHandler_Warning_Message, result.getExceptions() |
89 | 100 |
.stream().map(ex->ex.toString()) |
90 | 101 |
.collect(Collectors.joining("\n")))); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/DescriptiveDataSetRemoveTaxonHandler.java | ||
---|---|---|
1 | 1 |
|
2 | 2 |
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.handler; |
3 | 3 |
|
4 |
import java.util.Collection; |
|
5 |
|
|
4 | 6 |
import javax.inject.Named; |
5 | 7 |
|
6 | 8 |
import org.eclipse.e4.core.di.annotations.CanExecute; |
... | ... | |
12 | 14 |
import org.eclipse.jface.viewers.TreeSelection; |
13 | 15 |
import org.eclipse.jface.viewers.TreeViewer; |
14 | 16 |
|
15 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
|
17 |
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
|
16 | 18 |
import eu.etaxonomy.taxeditor.editor.descriptiveDataSet.DescriptiveDataSetEditor; |
17 | 19 |
|
18 | 20 |
public class DescriptiveDataSetRemoveTaxonHandler { |
... | ... | |
29 | 31 |
MMenuItem menuItem) { |
30 | 32 |
boolean canExecute = false; |
31 | 33 |
TreeSelection sel= ((TreeViewer)((DescriptiveDataSetEditor)activePart.getObject()).getTaxonTreeViewer()).getSelection() instanceof TreeSelection ?(TreeSelection)((TreeViewer)((DescriptiveDataSetEditor)activePart.getObject()).getTaxonTreeViewer()).getSelection(): null; |
32 |
canExecute = !selection.isEmpty() && activePart.getObject() instanceof DescriptiveDataSetEditor && sel != null && (sel.getFirstElement() instanceof TaxonNode ); |
|
33 |
menuItem.setVisible(canExecute); |
|
34 |
canExecute = !selection.isEmpty() && activePart.getObject() instanceof DescriptiveDataSetEditor && sel != null && sel.getFirstElement() instanceof TaxonNodeDto ; |
|
35 |
TreeViewer viewer = ((TreeViewer)((DescriptiveDataSetEditor)activePart.getObject()).getTaxonTreeViewer()); |
|
36 |
Collection<TaxonNodeDto> input = (Collection<TaxonNodeDto>)viewer.getInput(); |
|
37 |
|
|
38 |
canExecute &= input.contains(sel.getFirstElement()); |
|
39 |
|
|
40 |
menuItem.setVisible(canExecute); |
|
34 | 41 |
return canExecute; |
35 | 42 |
} |
36 | 43 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java | ||
---|---|---|
283 | 283 |
public static String DeleteTermBaseOperation_TERM_INLCUDES; |
284 | 284 |
public static String DeleteTermBaseOperation_VOC_NOT_EMPTY; |
285 | 285 |
|
286 |
public static String DeleteConfiguration_descriptiveDataSet_deleteAllSpecimenDesc; |
|
287 |
public static String DeleteConfiguration_descriptiveDataSet_deleteAllLiteratureDesc; |
|
288 |
public static String DeleteConfiguration_descriptiveDataSet_deleteAllDefaultDesc; |
|
289 |
public static String DeleteConfiguration_descriptiveDataSet_deleteAllAggregatedDesc; |
|
290 |
|
|
291 |
|
|
286 | 292 |
|
287 | 293 |
public static String DescriptionPreferences_1; |
288 | 294 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties | ||
---|---|---|
220 | 220 |
DeleteTermBaseOperation_TERM_INLCUDES=Term has included terms |
221 | 221 |
DeleteTermBaseOperation_VOC_NOT_EMPTY=Vocabulary not empty |
222 | 222 |
|
223 |
DeleteConfiguration_descriptiveDataSet_deleteAllSpecimenDesc=Specimen descriptions |
|
224 |
DeleteConfiguration_descriptiveDataSet_deleteAllLiteratureDesc=Literature descriptions |
|
225 |
DeleteConfiguration_descriptiveDataSet_deleteAllDefaultDesc=Default descriptions |
|
226 |
DeleteConfiguration_descriptiveDataSet_deleteAllAggregatedDesc=Aggregated descriptions |
|
227 |
|
|
223 | 228 |
NewGrantedAuthority_AlreadyInDb=The granted authority already exists. |
224 | 229 |
|
225 | 230 |
SetSecundumConfiguration_IncludeAcceptedTaxa=Include accepted taxa |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties | ||
---|---|---|
219 | 219 |
DeleteTermBaseOperation_TERM_INLCUDES=Der Term enth?lt weitere Terme |
220 | 220 |
DeleteTermBaseOperation_VOC_NOT_EMPTY=Vokabular ist nicht leer |
221 | 221 |
|
222 |
DeleteConfiguration_descriptiveDataSet_deleteAllSpecimenDesc=Specimen Beschreibungen |
|
223 |
DeleteConfiguration_descriptiveDataSet_deleteAllLiteratureDesc=Literatur Beschreibungen |
|
224 |
DeleteConfiguration_descriptiveDataSet_deleteAllDefaultDesc=Default Beschreibungen |
|
225 |
DeleteConfiguration_descriptiveDataSet_deleteAllAggregatedDesc=Aggregierten Beschreibungen |
|
226 |
|
|
222 | 227 |
NewGrantedAuthority_AlreadyInDb=Die GrantedAuthority ist bereits in der DB enthalten. |
223 | 228 |
|
224 | 229 |
SetSecundumConfiguration_IncludeAcceptedTaxa=Anwenden auf akzeptierte Taxa |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteConfiguratorDialog.java | ||
---|---|---|
17 | 17 |
import org.eclipse.swt.widgets.Shell; |
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.api.service.config.DeleteConfiguratorBase; |
20 |
import eu.etaxonomy.cdm.api.service.config.DeleteDescriptiveDataSetConfigurator; |
|
20 | 21 |
import eu.etaxonomy.cdm.api.service.config.MediaDeletionConfigurator; |
21 | 22 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
22 | 23 |
import eu.etaxonomy.cdm.api.service.config.SpecimenDeleteConfigurator; |
... | ... | |
64 | 65 |
composite.addConfiguratorComposite(new DeleteNameConfiguratorComposite((NameDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE)); |
65 | 66 |
} else if(configurator instanceof MediaDeletionConfigurator){ |
66 | 67 |
composite.addConfiguratorComposite(new DeleteMediaConfiguratorComposite((MediaDeletionConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE, fromBulkEditor)); |
68 |
} else if(configurator instanceof DeleteDescriptiveDataSetConfigurator){ |
|
69 |
composite.addConfiguratorComposite(new DeleteDescriptiveDatasetConfiguratorComposite((DeleteDescriptiveDataSetConfigurator) configurator, composite.getSectionConfigure(), SWT.NONE)); |
|
67 | 70 |
} |
68 | 71 |
|
69 | 72 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/deleteConfigurator/DeleteDescriptiveDatasetConfiguratorComposite.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2020 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.ui.dialog.configurator.deleteConfigurator; |
|
10 |
|
|
11 |
import org.eclipse.core.databinding.DataBindingContext; |
|
12 |
import org.eclipse.core.databinding.beans.PojoProperties; |
|
13 |
import org.eclipse.core.databinding.observable.value.IObservableValue; |
|
14 |
import org.eclipse.jface.databinding.swt.WidgetProperties; |
|
15 |
import org.eclipse.swt.SWT; |
|
16 |
import org.eclipse.swt.events.DisposeEvent; |
|
17 |
import org.eclipse.swt.events.DisposeListener; |
|
18 |
import org.eclipse.swt.layout.RowLayout; |
|
19 |
import org.eclipse.swt.widgets.Button; |
|
20 |
import org.eclipse.swt.widgets.Composite; |
|
21 |
import org.eclipse.swt.widgets.Display; |
|
22 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
|
23 |
|
|
24 |
import eu.etaxonomy.cdm.api.service.config.DeleteDescriptiveDataSetConfigurator; |
|
25 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
|
26 |
|
|
27 |
/** |
|
28 |
* @author k.luther |
|
29 |
* @since Jun 16, 2020 |
|
30 |
*/ |
|
31 |
public class DeleteDescriptiveDatasetConfiguratorComposite extends Composite { |
|
32 |
private final DataBindingContext m_bindingContext; |
|
33 |
|
|
34 |
private final FormToolkit toolkit = new FormToolkit(Display.getCurrent()); |
|
35 |
private final DeleteDescriptiveDataSetConfigurator configurator; |
|
36 |
private Button btnDeleteAllSpecimenDescriptions; |
|
37 |
private Button btnDeleteAllLiteratureDescriptions; |
|
38 |
private Button btnDeleteAllDefaultDescriptions; |
|
39 |
private Button btnDeleteAllAggregatedDescriptions; |
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
public DeleteDescriptiveDatasetConfiguratorComposite(DeleteDescriptiveDataSetConfigurator configurator, Composite parent, int style) { |
|
45 |
super(parent, style); |
|
46 |
|
|
47 |
this.configurator = configurator; |
|
48 |
addDisposeListener(new DisposeListener() { |
|
49 |
@Override |
|
50 |
public void widgetDisposed(DisposeEvent e) { |
|
51 |
toolkit.dispose(); |
|
52 |
} |
|
53 |
}); |
|
54 |
toolkit.paintBordersFor(this); |
|
55 |
setLayout(new RowLayout(SWT.VERTICAL)); |
|
56 |
setBackground(getBackground()); |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
btnDeleteAllSpecimenDescriptions = new Button(this, SWT.CHECK); |
|
62 |
btnDeleteAllSpecimenDescriptions.setText(Messages.DeleteConfiguration_descriptiveDataSet_deleteAllSpecimenDesc); |
|
63 |
btnDeleteAllSpecimenDescriptions.setEnabled(true); |
|
64 |
btnDeleteAllSpecimenDescriptions.setSelection(configurator.isDeleteAllSpecimenDescriptions()); |
|
65 |
|
|
66 |
btnDeleteAllDefaultDescriptions = new Button(this, SWT.CHECK); |
|
67 |
btnDeleteAllDefaultDescriptions.setText(Messages.DeleteConfiguration_descriptiveDataSet_deleteAllDefaultDesc); |
|
68 |
btnDeleteAllDefaultDescriptions.setEnabled(true); |
|
69 |
btnDeleteAllDefaultDescriptions.setSelection(configurator.isDeleteAllDefaultDescriptions()); |
|
70 |
|
|
71 |
btnDeleteAllLiteratureDescriptions = new Button(this, SWT.CHECK); |
|
72 |
btnDeleteAllLiteratureDescriptions.setText(Messages.DeleteConfiguration_descriptiveDataSet_deleteAllLiteratureDesc); |
|
73 |
btnDeleteAllLiteratureDescriptions.setEnabled(true); |
|
74 |
btnDeleteAllLiteratureDescriptions.setSelection(configurator.isDeleteAllLiteratureDescriptions()); |
|
75 |
|
|
76 |
btnDeleteAllAggregatedDescriptions = new Button(this, SWT.CHECK); |
|
77 |
btnDeleteAllAggregatedDescriptions.setText(Messages.DeleteConfiguration_descriptiveDataSet_deleteAllAggregatedDesc); |
|
78 |
btnDeleteAllAggregatedDescriptions.setEnabled(true); |
|
79 |
btnDeleteAllAggregatedDescriptions.setSelection(configurator.isDeleteAllAggregatedDescriptions()); |
|
80 |
|
|
81 |
m_bindingContext = initDataBindings(); |
|
82 |
|
|
83 |
} |
|
84 |
|
|
85 |
protected DataBindingContext initDataBindings() { |
|
86 |
DataBindingContext bindingContext = new DataBindingContext(); |
|
87 |
|
|
88 |
IObservableValue observeSelectionBtnDeleteAllSpecimen = WidgetProperties.selection().observe(btnDeleteAllSpecimenDescriptions); |
|
89 |
IObservableValue deleteAllSpecimenConfiguratorObserveValue = PojoProperties.value("deleteAllSpecimenDescriptions").observe(configurator); |
|
90 |
bindingContext.bindValue(observeSelectionBtnDeleteAllSpecimen, deleteAllSpecimenConfiguratorObserveValue, null, null); |
|
91 |
|
|
92 |
IObservableValue observeSelectionBtnDeleteAllDefault = WidgetProperties.selection().observe(btnDeleteAllDefaultDescriptions); |
|
93 |
IObservableValue deleteAlldefaultConfiguratorObserveValue = PojoProperties.value("deleteAllDefaultDescriptions").observe(configurator); |
|
94 |
bindingContext.bindValue(observeSelectionBtnDeleteAllDefault, deleteAlldefaultConfiguratorObserveValue, null, null); |
|
95 |
|
|
96 |
IObservableValue observeSelectionBtnDeleteAllLiterature = WidgetProperties.selection().observe(btnDeleteAllLiteratureDescriptions); |
|
97 |
IObservableValue deleteAllLiteratureConfiguratorObserveValue = PojoProperties.value("deleteAllLiteratureDescriptions").observe(configurator); |
|
98 |
bindingContext.bindValue(observeSelectionBtnDeleteAllLiterature, deleteAllLiteratureConfiguratorObserveValue, null, null); |
|
99 |
|
|
100 |
|
|
101 |
IObservableValue observeSelectionBtnDeleteAllAggregated = WidgetProperties.selection().observe(btnDeleteAllAggregatedDescriptions); |
|
102 |
IObservableValue deleteAllAggregatedConfiguratorObserveValue = PojoProperties.value("deleteAllAggregatedDescriptions").observe(configurator); |
|
103 |
bindingContext.bindValue(observeSelectionBtnDeleteAllAggregated, deleteAllAggregatedConfiguratorObserveValue, null, null); |
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
return bindingContext; |
|
110 |
} |
|
111 |
|
|
112 |
|
|
113 |
} |
Also available in: Unified diff
ref #8754: adapt deleteHandling to configuration