Project

General

Profile

« Previous | Next » 

Revision 7d3b42ec

Added by Katja Luther over 6 years ago

ref #4155: adaptions in setPublishForSubTree config wizard

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java
15 15
import org.eclipse.jface.databinding.swt.WidgetProperties;
16 16
import org.eclipse.jface.wizard.WizardPage;
17 17
import org.eclipse.swt.SWT;
18
import org.eclipse.swt.events.SelectionEvent;
19
import org.eclipse.swt.events.SelectionListener;
18 20
import org.eclipse.swt.layout.GridData;
19 21
import org.eclipse.swt.layout.GridLayout;
20 22
import org.eclipse.swt.widgets.Button;
23
import org.eclipse.swt.widgets.Combo;
21 24
import org.eclipse.swt.widgets.Composite;
22 25
import org.eclipse.swt.widgets.Display;
23 26
import org.eclipse.swt.widgets.Event;
......
32 35
 * @date 10.10.2017
33 36
 *
34 37
 */
35
public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements Listener {
38
public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements Listener, SelectionListener {
36 39

  
37 40
    private DataBindingContext m_bindingContext;
38 41

  
......
43 46
    private Button btnIncludeSynonyms;
44 47
    private Button btnIncludeSharedTaxa;
45 48

  
46
    private Button btnPublish;
49
    private Combo btnPublish;
47 50

  
48 51

  
49 52
    /**
......
52 55
    public PublishSubTreeConfiguratorWizardPage(PublishForSubtreeConfigurator configurator) {
53 56
        super("Set Publish Flag Configuration");
54 57
        this.configurator = configurator;
58
        this.setTitle(Messages.SetPublishConfiguration_Title);
55 59
        this.setDescription(Messages.SetPublishConfiguration_Description_Configurator);
56 60

  
57 61
    }
......
76 80
        control.setLayout(gridLayoutControl);
77 81
        control.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
78 82

  
79
        btnPublish = new Button(control, SWT.CHECK);
83
        btnPublish = new Combo(control, SWT.BORDER| SWT.READ_ONLY);
80 84
        btnPublish.setText(Messages.SetPublishConfiguration_Publish);
81 85
        btnPublish.setToolTipText(Messages.SetPublishConfiguration_Publish_tooltip);
82
        btnPublish.setSelection(configurator.isPublish());
86
        btnPublish.add("publish", 0);
87
        btnPublish.add("don't publish",1);
88
        if (configurator.isPublish()){
89
            btnPublish.select(0);
90
        }else{
91
            btnPublish.select(1);
92
        }
93
        btnPublish.addSelectionListener(this);
83 94

  
84 95

  
85 96
      //  Composite control = toolkit.createComposite(composite);
......
159 170
        IObservableValue includeSharedTaxaConfiguratorObserveValue = PojoProperties.value("includeSharedTaxa").observe(configurator);
160 171
        bindingContext.bindValue(observeSelectionBtnIncludeSharedTaxal, includeSharedTaxaConfiguratorObserveValue, null, null);
161 172

  
162
        IObservableValue observeSelectionBtnPublish = WidgetProperties.selection().observe(btnPublish);
163
        IObservableValue publishConfiguratorObserveValue = PojoProperties.value("publish").observe(configurator);
164
        bindingContext.bindValue(observeSelectionBtnPublish, publishConfiguratorObserveValue, null, null);
173
//        IObservableValue observeSelectionBtnPublish = WidgetProperties.selection().observe(btnPublish);
174
//        IObservableValue publishConfiguratorObserveValue = PojoProperties.value("publish").observe(configurator);
175
//        bindingContext.bindValue(observeSelectionBtnPublish, publishConfiguratorObserveValue, null, null);
165 176
        return bindingContext;
166 177

  
167 178
    }
179

  
180

  
181

  
182
    /* (non-Javadoc)
183
     * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
184
     */
185
    @Override
186
    public void widgetSelected(SelectionEvent e) {
187
        if (btnPublish.getSelectionIndex() > 0){
188
            configurator.setPublish(false);
189
        } else{
190
            configurator.setPublish(true);
191
        }
192

  
193
    }
194

  
195

  
196

  
197
    /* (non-Javadoc)
198
     * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
199
     */
200
    @Override
201
    public void widgetDefaultSelected(SelectionEvent e) {
202
        // TODO Auto-generated method stub
203

  
204
    }
168 205
}

Also available in: Unified diff