Search in sources :

Example 11 with CheckBoxFieldEditor

use of org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor in project tdi-studio-se by Talend.

the class SpagoBiPreferencePage method createFieldEditors.

/*
     * @Override protected IPreferenceStore doGetPreferenceStore() { // SpagoPreferenceStore preferenceStore = new
     * SpagoPreferenceStore(ProxyRepositoryFactory.getInstance()); // try { // preferenceStore.load(); // } catch
     * (PersistenceException e) { // String detailError = e.getMessage(); // new ErrorDialogWidthDetailArea(new Shell(),
     * RepositoryPlugin.PLUGIN_ID, Messages // .getString("CommonWizard.persistenceException"), detailError);
     * //$NON-NLS-1$ // log.error(Messages.getString("CommonWizard.persistenceException") + "\n" + detailError);
     * //$NON-NLS-1$ // //$NON-NLS-2$ // } // return preferenceStore; return
     * Activator.getDefault().getPreferenceStore(); }
     */
@Override
protected void createFieldEditors() {
    parent = getFieldEditorParent();
    spagoBiCheckButton = new CheckBoxFieldEditor(SpagoPreferenceInitializer.SPAGO_STATUS, Messages.getString("SpagoBiPreferencePage.spagoBiCheckButton"), //$NON-NLS-1$
    parent);
    editor = new SpagoBiServerEditor(SpagoBiServer.SPAGOBI_SERVER, Messages.getString("SpagoBiPreferencePage.technicalStatusLabel"), //$NON-NLS-1$
    parent);
    addField(editor);
    updateEnableStateFromPreferences();
    SelectionListener listener = new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
        }

        public void widgetSelected(SelectionEvent e) {
            IPreferenceStore preferenceStore = getPreferenceStore();
            preferenceStore.setValue(SpagoPreferenceInitializer.SPAGO_STATUS, ((Button) e.getSource()).getSelection());
            updateEnableStateFromDisplay();
        }
    };
    spagoBiCheckButton.getButton().addSelectionListener(listener);
}
Also used : SelectionEvent(org.eclipse.swt.events.SelectionEvent) CheckBoxFieldEditor(org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

CheckBoxFieldEditor (org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor)11 SelectionEvent (org.eclipse.swt.events.SelectionEvent)4 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)3 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2 BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)1 GridData (org.eclipse.swt.layout.GridData)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1 LabelFieldEditor (org.talend.commons.ui.swt.advanced.dataeditor.LabelFieldEditor)1 IBrandingService (org.talend.core.ui.branding.IBrandingService)1