Search in sources :

Example 21 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project AutoRefactor by JnRouvignac.

the class WorkspacePreferencePage method invalidateToggleRules.

private void invalidateToggleRules(final Composite ruleGroup) {
    boolean isAllRulesChecked = true;
    for (final BooleanFieldEditor rule : WorkspacePreferencePage.this.rules) {
        isAllRulesChecked = ((Button) rule.getDescriptionControl(ruleGroup)).getSelection();
        if (!isAllRulesChecked) {
            break;
        }
    }
    toggleAllRules.setSelection(isAllRulesChecked);
}
Also used : BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 22 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class PerformancePreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
    if (breaningService.isPoweredOnlyCamel()) {
        addField(new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.display.deactiveRepositoryUpdate"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPERTY_CODE_CHECK, Messages.getString("PerformancePreferencePage.propertyCodeCheck"), //$NON-NLS-1$
        getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.generateCode"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.CHECK_ONLY_LAST_VERSION, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.checkVersion"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPAGATE_CONTEXT_VARIABLE, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.addOrDeleteVariable"), getFieldEditorParent()));
        dbConnTimeoutActive = new CheckBoxFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED, Messages.getString("PerformancePreferencePage.ActivedTimeoutSetting"), //$NON-NLS-1$
        getFieldEditorParent());
        dbConnTimeoutActive.getButton().addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                checkDBTimeout();
            }
        });
        dbConnTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.ConnectionTimeout"), getFieldEditorParent());
        Text textControl = dbConnTimeout.getTextControl(getFieldEditorParent());
        //$NON-NLS-1$
        textControl.setToolTipText(Messages.getString("PerformancePreferencePage.ConnectionTimeoutTip"));
        dbConnTimeout.setValidRange(0, Short.MAX_VALUE);
        textControl.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED));
        addField(dbConnTimeoutActive);
        addField(dbConnTimeout);
        addSVNInforAutoCheckFiled();
    } else {
        addField(new BooleanFieldEditor(ITalendCorePrefConstants.DEACTIVE_REPOSITORY_UPDATE, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.display.deactiveRepositoryUpdate"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPERTY_CODE_CHECK, Messages.getString("PerformancePreferencePage.propertyCodeCheck"), //$NON-NLS-1$
        getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.GENERATE_CODE_WHEN_OPEN_JOB, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.generateCode"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.CHECK_ONLY_LAST_VERSION, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.checkVersion"), getFieldEditorParent()));
        addField(new BooleanFieldEditor(TalendDesignerPrefConstants.PROPAGATE_CONTEXT_VARIABLE, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.addOrDeleteVariable"), getFieldEditorParent()));
        dbConnTimeoutActive = new CheckBoxFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED, Messages.getString("PerformancePreferencePage.ActivedTimeoutSetting"), //$NON-NLS-1$
        getFieldEditorParent());
        dbConnTimeoutActive.getButton().addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                checkDBTimeout();
            }
        });
        dbConnTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.ConnectionTimeout"), getFieldEditorParent());
        Text textControl = dbConnTimeout.getTextControl(getFieldEditorParent());
        //$NON-NLS-1$
        textControl.setToolTipText(Messages.getString("PerformancePreferencePage.ConnectionTimeoutTip"));
        dbConnTimeout.setValidRange(0, Short.MAX_VALUE);
        textControl.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.DB_CONNECTION_TIMEOUT_ACTIVED));
        addField(dbConnTimeoutActive);
        addField(dbConnTimeout);
        addField(new BooleanFieldEditor(ITalendCorePrefConstants.ADD_USER_ROUTINES, //$NON-NLS-1$
        Messages.getString("PerformancePreferencePage.addAllUserRoutines"), getFieldEditorParent()));
        // TDI-8323:remove this one,we do not need this since we always add all system routines for new job
        // addField(new BooleanFieldEditor(ITalendCorePrefConstants.ADD_SYSTEM_ROUTINES, Messages
        // .getString("PerformancePreferencePage.addAllSystemRoutines"),//$NON-NLS-1$
        // getFieldEditorParent()));
        addSVNInforAutoCheckFiled();
    }
    IntegerFieldEditor codeFormatTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.PERFORMANCE_JAVA_PROCESS_CODE_FORMATE_TIMEOUT, //$NON-NLS-1$
    Messages.getString("PerformancePreferencePage.CodeFormatTimeout"), getFieldEditorParent());
    codeFormatTimeout.setValidRange(1, Short.MAX_VALUE);
    addField(codeFormatTimeout);
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IntegerFieldEditor(org.eclipse.jface.preference.IntegerFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) Text(org.eclipse.swt.widgets.Text) IBrandingService(org.talend.core.ui.branding.IBrandingService) CheckBoxFieldEditor(org.talend.commons.ui.swt.preferences.CheckBoxFieldEditor)

Example 23 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class ExchangePreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    Composite composite = new Composite(getFieldEditorParent(), SWT.NONE);
    composite.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
    composite.setLayout(new GridLayout());
    Group eGroup = new Group(composite, SWT.NONE);
    eGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    eGroup.setLayout(new GridLayout(3, false));
    Label userLabelTitle = new Label(eGroup, SWT.NONE);
    //$NON-NLS-1$
    userLabelTitle.setText(Messages.getString("ExchangePreferencePage.currentUserTitle"));
    GridData data = new GridData(GridData.FILL, GridData.CENTER, true, false);
    userLabelTitle.setLayoutData(data);
    userAccountLink = new Link(eGroup, SWT.NONE);
    GridData dataLink = new GridData(GridData.FILL, GridData.CENTER, true, false);
    dataLink.widthHint = convertVerticalDLUsToPixels(120);
    userAccountLink.setLayoutData(dataLink);
    userAccountLink.setText(userAccount != null ? "<a> " + userAccount + " </a>" : "<a> " + "< None >" + " </a>");
    logonButton = new Button(eGroup, SWT.PUSH);
    logonButton.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
    logonButton.setText(userAccount != null ? Messages.getString("ExchangePreferencePage.signOutExchangeTitle") : Messages.getString("ExchangePreferencePage.signInExchangeTitle"));
    if (PluginChecker.isSVNProviderPluginLoaded()) {
        BooleanFieldEditor checkTisLogonExchangeDialog = new BooleanFieldEditor(ITalendCorePrefConstants.EXCHANGE_CHECK_TIS_VERSION, Messages.getString("ExchangePreferencePage.checkTisLogonExchangeTitle"), //$NON-NLS-1$
        getFieldEditorParent());
        addField(checkTisLogonExchangeDialog);
    }
    BooleanFieldEditor downloadedCheckUpdates = new BooleanFieldEditor(ITalendCorePrefConstants.EXCHANGE_DOWNLOADED_CHECK_UPDATES, Messages.getString("ExchangePreferencePage.exchangeCheckUpdatesTitle"), //$NON-NLS-1$
    getFieldEditorParent());
    addField(downloadedCheckUpdates);
    addListeners();
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) Link(org.eclipse.swt.widgets.Link)

Example 24 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project tdi-studio-se by Talend.

the class AppearancePreferencePage method createFieldEditors.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
     */
@Override
protected void createFieldEditors() {
    addField(new BooleanFieldEditor(ITalendCorePrefConstants.CONTEXT_GROUP_BY_SOURCE, //$NON-NLS-1$
    Messages.getString("AppearancePreferencePage.groupBySource"), getFieldEditorParent()));
    Composite parent = getFieldEditorParent();
    addFields(parent);
}
Also used : Composite(org.eclipse.swt.widgets.Composite) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor)

Example 25 with BooleanFieldEditor

use of org.eclipse.jface.preference.BooleanFieldEditor in project eclipse.platform.text by eclipse.

the class SearchPreferencePage method createFieldEditors.

@Override
protected void createFieldEditors() {
    addField(new BooleanFieldEditor(REUSE_EDITOR, SearchMessages.SearchPreferencePage_reuseEditor, getFieldEditorParent()));
    addField(new BooleanFieldEditor(BRING_VIEW_TO_FRONT, SearchMessages.SearchPreferencePage_bringToFront, getFieldEditorParent()));
    fIgnorePotentialMatchesCheckbox = new BooleanFieldEditor(IGNORE_POTENTIAL_MATCHES, SearchMessages.SearchPreferencePage_ignorePotentialMatches, getFieldEditorParent());
    addField(fIgnorePotentialMatchesCheckbox);
    fEmphasizedCheckbox = new BooleanFieldEditor(EMPHASIZE_POTENTIAL_MATCHES, SearchMessages.SearchPreferencePage_emphasizePotentialMatches, getFieldEditorParent());
    addField(fEmphasizedCheckbox);
    fColorEditor = new ColorFieldEditor(POTENTIAL_MATCH_FG_COLOR, SearchMessages.SearchPreferencePage_potentialMatchFgColor, getFieldEditorParent());
    addField(fColorEditor);
    fEmphasizedCheckbox.setEnabled(!arePotentialMatchesIgnored(), getFieldEditorParent());
    fColorEditor.setEnabled(!arePotentialMatchesIgnored() && arePotentialMatchesEmphasized(), getFieldEditorParent());
    handleDeletedPerspectives();
    String[][] perspectiveNamesAndIds = getPerspectiveNamesAndIds();
    ComboFieldEditor comboEditor = new ComboFieldEditor(DEFAULT_PERSPECTIVE, SearchMessages.SearchPreferencePage_defaultPerspective, perspectiveNamesAndIds, getFieldEditorParent());
    addField(comboEditor);
    // in case we have a contributed engine, let the user choose.
    TextSearchEngineRegistry reg = SearchPlugin.getDefault().getTextSearchEngineRegistry();
    String[][] engineNamesAndIds = reg.getAvailableEngines();
    if (engineNamesAndIds.length > 1) {
        comboEditor = new ComboFieldEditor(TEXT_SEARCH_ENGINE, SearchMessages.SearchPreferencePage_textSearchEngine, engineNamesAndIds, getFieldEditorParent());
        addField(comboEditor);
    }
}
Also used : ColorFieldEditor(org.eclipse.jface.preference.ColorFieldEditor) BooleanFieldEditor(org.eclipse.jface.preference.BooleanFieldEditor) ComboFieldEditor(org.eclipse.jface.preference.ComboFieldEditor) TextSearchEngineRegistry(org.eclipse.search.internal.core.text.TextSearchEngineRegistry)

Aggregations

BooleanFieldEditor (org.eclipse.jface.preference.BooleanFieldEditor)37 Composite (org.eclipse.swt.widgets.Composite)20 IntegerFieldEditor (org.eclipse.jface.preference.IntegerFieldEditor)15 StringFieldEditor (org.eclipse.jface.preference.StringFieldEditor)11 GridData (org.eclipse.swt.layout.GridData)10 Label (org.eclipse.swt.widgets.Label)9 RadioGroupFieldEditor (org.eclipse.jface.preference.RadioGroupFieldEditor)8 Group (org.eclipse.swt.widgets.Group)8 GridLayout (org.eclipse.swt.layout.GridLayout)7 ComboFieldEditor (org.eclipse.jface.preference.ComboFieldEditor)5 Button (org.eclipse.swt.widgets.Button)4 FieldEditor (org.eclipse.jface.preference.FieldEditor)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)3 SelectionEvent (org.eclipse.swt.events.SelectionEvent)3 Link (org.eclipse.swt.widgets.Link)3 ColorFieldEditor (org.eclipse.jface.preference.ColorFieldEditor)2 DirectoryFieldEditor (org.eclipse.jface.preference.DirectoryFieldEditor)2 FileFieldEditor (org.eclipse.jface.preference.FileFieldEditor)2 SWT (org.eclipse.swt.SWT)2 SelectionListener (org.eclipse.swt.events.SelectionListener)2