Example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor

Introduction

In this page you can find the example usage for org.eclipse.jface.preference StringFieldEditor StringFieldEditor.

Prototype

public StringFieldEditor(String name, String labelText, Composite parent) 

Source Link

Document

Creates a string field editor of unlimited width.

Usage

From source file:org.fredy.openhere.ui.preferences.OpenHerePreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor("consoleCommand", "Console command", getFieldEditorParent()));
    addField(new StringFieldEditor("fileBrowserCommand", "File browser command", getFieldEditorParent()));
}

From source file:org.ganoro.phing.ui.internal.preferences.AntPreferencePage.java

License:Open Source License

protected void createFieldEditors() {
    storeAppliedValues();/*w  ww  .j ava 2 s .c  om*/

    Font font = getFieldEditorParent().getFont();
    Label label = new Label(getFieldEditorParent(), SWT.WRAP);
    label.setText(AntPreferencesMessages.AntPreferencePage_Enter);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 3;
    gd.widthHint = convertWidthInCharsToPixels(60);
    label.setLayoutData(gd);
    label.setLayoutData(gd);
    label.setFont(font);

    StringFieldEditor editor = new StringFieldEditor(IAntUIPreferenceConstants.ANT_FIND_BUILD_FILE_NAMES,
            AntPreferencesMessages.AntPreferencePage__Names__3, getFieldEditorParent());
    addField(editor);

    timeout = new AntIntegerFieldEditor(PhingLaunching.getUniqueIdentifier(), "ANT_COMMUNICATION_TIMEOUT",
            AntPreferencesMessages.AntPreferencePage_13, getFieldEditorParent(), 2000);
    int minValue = 20000;
    int maxValue = 1200000;
    timeout.setValidRange(minValue, maxValue);
    timeout.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
    timeout.setErrorMessage(MessageFormat.format(AntPreferencesMessages.AntPreferencePage_14,
            new Object[] { new Integer(minValue), new Integer(maxValue) }));
    addField(timeout);

    editor = new URLFieldEditor(IAntUIPreferenceConstants.DOCUMENTATION_URL,
            AntPreferencesMessages.AntPreferencePage_2, getFieldEditorParent());
    addField(editor);

    workspacejre = new BooleanFieldEditor(IAntUIPreferenceConstants.USE_WORKSPACE_JRE,
            AntPreferencesMessages.always_run_in_workspace_jre, getFieldEditorParent());
    workspacejre.fillIntoGrid(getFieldEditorParent(), 3);
    addField(workspacejre);

    createSpace();

    if (!PhingUi.isMacOS()) {
        //the mac does not have a tools.jar Bug 40778
        label = new Label(getFieldEditorParent(), SWT.WRAP);
        label.setText(AntPreferencesMessages.AntPreferencePage_0);
        gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
        gd.horizontalSpan = 3;
        gd.widthHint = convertWidthInCharsToPixels(60);
        label.setLayoutData(gd);
        label.setFont(font);
        fToolsWarningEditor = new BooleanFieldEditor(IAntUIPreferenceConstants.ANT_TOOLS_JAR_WARNING,
                AntPreferencesMessages.AntPreferencePage_1, getFieldEditorParent());
        addField(fToolsWarningEditor);
        createSpace();
    }

    addField(new BooleanFieldEditor(IAntUIPreferenceConstants.ANT_ERROR_DIALOG,
            AntPreferencesMessages.AntPreferencePage_12, getFieldEditorParent()));
    createSpace();

    addField(new BooleanFieldEditor(IAntUIPreferenceConstants.ANT_CREATE_MARKERS,
            AntPreferencesMessages.AntPreferencePage_15, getFieldEditorParent()));
    label = new Label(getFieldEditorParent(), SWT.WRAP);
    label.setText(AntPreferencesMessages.AntPreferencePage_16);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 3;
    gd.widthHint = convertWidthInCharsToPixels(60);
    label.setLayoutData(gd);
    label.setFont(font);

    createSpace();
    createColorComposite();
    getPreferenceStore().addPropertyChangeListener(this);
}

From source file:org.glassmaker.ui.editor.preferences.LoginPreferencePage.java

License:Open Source License

/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.//from www . j av a 2  s .  c om
 */
public void createFieldEditors() {
    addField(new StringFieldEditor(PreferenceConstants.CLIENT_ID, "Google API Client Id:",
            getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.CLIENT_SECRET, "Google API Client Secret:",
            getFieldEditorParent()));
}

From source file:org.gradle.eclipse.preferences.GradleRuntimePreferencePage.java

License:Apache License

protected void createFieldEditors() {
    storeAppliedValues();/*from w  w  w  .  ja  v  a2  s  . co m*/

    if (!isPropertyPage()) {
        Font font = getFieldEditorParent().getFont();
        Label label = new Label(getFieldEditorParent(), SWT.WRAP);
        label.setText(GradlePreferencesMessages.GradleRuntimePreferencePage_Enter);
        GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
        gd.horizontalSpan = 3;
        gd.widthHint = convertWidthInCharsToPixels(60);
        label.setLayoutData(gd);
        label.setLayoutData(gd);
        label.setFont(font);

        FieldEditor editor = new StringFieldEditor(IGradlePreferenceConstants.GRADLE_FIND_BUILD_FILE_NAMES,
                GradlePreferencesMessages.GradleRuntimePreferencePage_BuildFileName, getFieldEditorParent());
        addField(editor);
    }

    useCustomCacheFieldEditor = new BooleanFieldEditor(IGradlePreferenceConstants.USE_SPECIFIC_GRADLE_CACHE,
            GradlePreferencesMessages.GradleRuntimePreferencePage_USE_MANUEL_GRADLE_CACHE,
            getFieldEditorParent());
    useCustomCacheFieldEditor.setPropertyChangeListener(this);
    addField(useCustomCacheFieldEditor);

    gradleCacheDirEditor = new DirectoryFieldEditor(IGradlePreferenceConstants.GRADLE_CACHE,
            GradlePreferencesMessages.GradleRuntimePreferencePage_GRADLE_CACHE_DIR, getFieldEditorParent());
    gradleCacheDirEditor.setEmptyStringAllowed(isPropertyPage());

    gradleCacheDirEditor.setPropertyChangeListener(this);

    addField(gradleCacheDirEditor);

    useCustomGradleHomeFieldEditor = new BooleanFieldEditor(IGradlePreferenceConstants.USE_SPECIFIC_GRADLE_HOME,
            GradlePreferencesMessages.GradleRuntimePreferencePage_USE_MANUEL_GRADLE_HOME,
            getFieldEditorParent());
    useCustomGradleHomeFieldEditor.setPropertyChangeListener(this);
    addField(useCustomGradleHomeFieldEditor);

    gradleHomeDirectoryFieldEditor = new DirectoryFieldEditor(IGradlePreferenceConstants.MANUELL_GRADLE_HOME,
            GradlePreferencesMessages.GradleRuntimePreferencePage_GradleHome_Label, getFieldEditorParent());
    gradleHomeDirectoryFieldEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
    gradleHomeDirectoryFieldEditor.setErrorMessage("GRADLE_HOME must not be empty!");

    gradleHomeDirectoryFieldEditor.setPropertyChangeListener(this);
    addField(gradleHomeDirectoryFieldEditor);

    boolean useCustomHome = getPreferenceStore()
            .getBoolean(IGradlePreferenceConstants.USE_SPECIFIC_GRADLE_HOME);
    if (useCustomHome) {
        gradleHomeDirectoryFieldEditor.setEmptyStringAllowed(false);
        gradleHomeDirectoryFieldEditor.setEnabled(true, getFieldEditorParent());
    } else {
        gradleHomeDirectoryFieldEditor.setEmptyStringAllowed(true);
        gradleHomeDirectoryFieldEditor.setEnabled(false, getFieldEditorParent());
    }
    boolean useCustomCache = getPreferenceStore()
            .getBoolean(IGradlePreferenceConstants.USE_SPECIFIC_GRADLE_CACHE);
    if (useCustomCache) {
        gradleCacheDirEditor.setEmptyStringAllowed(false);
        gradleCacheDirEditor.setEnabled(true, getFieldEditorParent());
    } else {
        gradleCacheDirEditor.setEmptyStringAllowed(true);
        gradleCacheDirEditor.setEnabled(false, getFieldEditorParent());
    }
    gradleCmdParamsEditor = new StringFieldEditor(IGradlePreferenceConstants.ADDITIONAL_COMMANDLINE_PARAMS,
            GradlePreferencesMessages.GradleRuntimePreferencePage_ADDITIONAL_COMMANDLINE_PARAMS,
            getFieldEditorParent());
    addField(gradleCmdParamsEditor);
    createSpace();
    getPreferenceStore().addPropertyChangeListener(this);

    if (!isPropertyPage()) {
        createColorComposite();
    }

    checkState();
}

From source file:org.hibernate.eclipse.console.preferences.HibernateConsolePreferencePage.java

License:Open Source License

/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself.//from ww  w. ja v  a2s.  com
 */

public void createFieldEditors() {
    addField(new DirectoryFieldEditor(P_PATH,
            HibernateConsoleMessages.HibernateConsolePreferencePage_dir_preference, getFieldEditorParent()));
    addField(new BooleanFieldEditor(P_BOOLEAN,
            HibernateConsoleMessages.HibernateConsolePreferencePage_example_of_bool_pref,
            getFieldEditorParent()));

    addField(new RadioGroupFieldEditor(P_CHOICE,
            HibernateConsoleMessages.HibernateConsolePreferencePage_example_of_multichoise_pref, 1,
            new String[][] {
                    { HibernateConsoleMessages.HibernateConsolePreferencePage_choice_1,
                            HibernateConsoleMessages.HibernateConsolePreferencePage_choice1 },
                    { HibernateConsoleMessages.HibernateConsolePreferencePage_choice_2,
                            HibernateConsoleMessages.HibernateConsolePreferencePage_choice2 } },
            getFieldEditorParent()));
    addField(new StringFieldEditor(P_STRING, HibernateConsoleMessages.HibernateConsolePreferencePage_text_pref,
            getFieldEditorParent()));
}

From source file:org.hpccsystems.eclide.importWizards.ImportWizardPage.java

License:Open Source License

@Override
protected void createSourceGroup(Composite parent) {
    Composite fileSelectionArea = new Composite(parent, SWT.NONE);
    GridData fileSelectionData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    fileSelectionArea.setLayoutData(fileSelectionData);

    GridLayout fileSelectionLayout = new GridLayout();
    fileSelectionLayout.numColumns = 3;/* www  . jav a2s  .  c o m*/
    fileSelectionLayout.makeColumnsEqualWidth = false;
    fileSelectionLayout.marginWidth = 0;
    fileSelectionLayout.marginHeight = 0;
    fileSelectionArea.setLayout(fileSelectionLayout);

    fIPText = new StringFieldEditor("IPSelect", Messages.ImportWizardPage_2, fileSelectionArea); //$NON-NLS-1$
    fIPText.setStringValue("X.X.X.X"); //$NON-NLS-1$
    fUserText = new StringFieldEditor("User", Messages.ImportWizardPage_5, fileSelectionArea); //$NON-NLS-1$
    fUserText.setStringValue(""); //$NON-NLS-1$
    fPasswordText = new PasswordFieldEditor("Password", Messages.ImportWizardPage_8, fileSelectionArea); //$NON-NLS-1$
    fPasswordText.setStringValue(""); //$NON-NLS-1$
}

From source file:org.hpccsystems.eclide.preferences.ECLCompilerPreferencePage.java

License:Open Source License

/**
 * Creates the field editors. Field editors are abstractions of
 * the common GUI blocks needed to manipulate various types
 * of preferences. Each field editor knows how to save and
 * restore itself./*from ww w . j  av a2s. co m*/
 */
@Override
public void createFieldEditors() {
    addField(new SpacerFieldEditor(getFieldEditorParent()));
    addField(new LabelFieldEditor(Messages.ECLCompilerPreferencePage_1, getFieldEditorParent()));
    addField(new DirectoryFieldEditor(ClientTools.P_TOOLSPATH, Messages.ECLCompilerPreferencePage_2,
            getFieldEditorParent()));

    addField(new SpacerFieldEditor(getFieldEditorParent()));
    addField(new LabelFieldEditor(Messages.ECLCompilerPreferencePage_3, getFieldEditorParent()));
    addField(new StringFieldEditor(ClientTools.P_ARGSCOMMON, Messages.ECLCompilerPreferencePage_4,
            getFieldEditorParent()));
    addField(new StringFieldEditor(ClientTools.P_ARGSSYNTAX, Messages.ECLCompilerPreferencePage_5,
            getFieldEditorParent()));
    addField(new StringFieldEditor(ClientTools.P_ARGSCOMPILE, Messages.ECLCompilerPreferencePage_6,
            getFieldEditorParent()));
    addField(new StringFieldEditor(ClientTools.P_ARGSCOMPILEREMOTE, Messages.ECLCompilerPreferencePage_7,
            getFieldEditorParent()));

    addField(new SpacerFieldEditor(getFieldEditorParent()));
    addField(new LabelFieldEditor(Messages.ECLCompilerPreferencePage_8, getFieldEditorParent()));
    addField(new StringFieldEditor(ClientTools.P_ARGSWULOCAL, Messages.ECLCompilerPreferencePage_9,
            getFieldEditorParent()));

    addField(new SpacerFieldEditor(getFieldEditorParent()));
    addField(new LabelFieldEditor(Messages.ECLCompilerPreferencePage_10, getFieldEditorParent()));
    addField(new IntegerFieldEditor(ClientTools.P_INLINERESULTLIMIT, Messages.ECLCompilerPreferencePage_11,
            getFieldEditorParent()));
    addField(new BooleanFieldEditor(ClientTools.P_MONITORDEPENDEES, Messages.ECLCompilerPreferencePage_12,
            getFieldEditorParent()));
    addField(new BooleanFieldEditor(ClientTools.P_SUPRESSSECONDERROR, Messages.ECLCompilerPreferencePage_13,
            getFieldEditorParent()));
    addField(new BooleanFieldEditor(ClientTools.P_ENABLEMETAPROCESSING, Messages.ECLCompilerPreferencePage_14,
            getFieldEditorParent()));
}

From source file:org.hpccsystems.eclide.wizards.ImportWizardPage.java

License:Open Source License

@Override
protected void createSourceGroup(Composite parent) {
    Composite fileSelectionArea = new Composite(parent, SWT.NONE);
    GridData fileSelectionData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL);
    fileSelectionArea.setLayoutData(fileSelectionData);

    GridLayout fileSelectionLayout = new GridLayout();
    fileSelectionLayout.numColumns = 3;//from  w w  w . ja  va 2s.  c om
    fileSelectionLayout.makeColumnsEqualWidth = false;
    fileSelectionLayout.marginWidth = 0;
    fileSelectionLayout.marginHeight = 0;
    fileSelectionArea.setLayout(fileSelectionLayout);

    fIPText = new StringFieldEditor("IPSelect", Messages.Wizard_ImportWizardPage_2, fileSelectionArea); //$NON-NLS-1$
    fIPText.setStringValue(Messages.Wizard_ImportWizardPage_3);
    fUserText = new StringFieldEditor("User", Messages.Wizard_ImportWizardPage_5, fileSelectionArea); //$NON-NLS-1$
    fUserText.setStringValue(""); //$NON-NLS-1$
    fPasswordText = new PasswordFieldEditor("Password", Messages.Wizard_ImportWizardPage_8, fileSelectionArea); //$NON-NLS-1$
    fPasswordText.setStringValue(""); //$NON-NLS-1$
}

From source file:org.iatrix.help.wiki.preferences.WikiPreferences.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor(Constants.CFG_BASE_URL, "Basis-URL", getFieldEditorParent()));
    addField(new StringFieldEditor(Constants.CFG_START_PAGE, "Start-Seite", getFieldEditorParent()));
    addField(new StringFieldEditor(Constants.CFG_HANDBOOK, "Handbuch", getFieldEditorParent()));
}

From source file:org.iatrix.preferences.IatrixPreferences.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor(Iatrix.CFG_MAX_SHOWN_CHARGES, "Kons-Leistungen", getFieldEditorParent()));

    addField(new StringFieldEditor(Iatrix.CFG_MAX_SHOWN_CONSULTATIONS, "Angezeigte Konsultationen",
            getFieldEditorParent()));//  www. j  a v  a2 s .  c o m
}