+package eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator;
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.beans.PojoProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.RowLayout;
+
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonNodeDeletionConfigurator;
+/**
+ * @author kluther
+ * @date Jul 13, 2015
+ *
+ */
+public class DeleteNodeConfiguratorComposite extends Composite {
+ // $Id$
+
+ private final DataBindingContext m_bindingContext;
+
+ private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());
+ private final TaxonNodeDeletionConfigurator configurator;
+ private final Button btnDeleteTaxon;
+
+
+ /**
+ * Create the composite.
+ * @param parent
+ * @param style
+ */
+ public DeleteNodeConfiguratorComposite(TaxonNodeDeletionConfigurator configurator, Composite parent, int style) {
+ super(parent, style);
+ this.configurator = configurator;
+ addDisposeListener(new DisposeListener() {
+ @Override
+ public void widgetDisposed(DisposeEvent e) {
+ toolkit.dispose();
+ }
+ });
+ toolkit.paintBordersFor(this);
+ setLayout(new RowLayout(SWT.VERTICAL));
+ setBackground(getBackground());
+
+ btnDeleteTaxon = new Button(this, SWT.CHECK);
+ btnDeleteTaxon.setText("Delete taxon if possible");
+
+ m_bindingContext = initDataBindings();
+
+ }
+
+ protected DataBindingContext initDataBindings() {
+ DataBindingContext bindingContext = new DataBindingContext();
+ //
+ IObservableValue observeSelectionBtnDeleteTaxonObserveWidget = WidgetProperties.selection().observe(btnDeleteTaxon);
+ IObservableValue deleteTaxonIfPossibleConfiguratorObserveValue = PojoProperties.value("deleteTaxon").observe(configurator);
+ bindingContext.bindValue(observeSelectionBtnDeleteTaxonObserveWidget, deleteTaxonIfPossibleConfiguratorObserveValue, null, null);
+ //
+ return bindingContext;
+ }
+ }
+
+