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.eclipse.linuxtools.systemtap.ui.ide.preferences.CodeAssistPreferencePage.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 w w  w  .ja v a2  s. c  om*/
 */
public void createFieldEditors() {
    LogManager.logDebug("Start createFieldEditors:", this);
    addField(new BooleanFieldEditor(IDEPreferenceConstants.P_USE_CODE_ASSIST,
            Localization.getString("CodeAssistPreferencePage.UseCodeAssist"), getFieldEditorParent()));
    addField(new RadioGroupFieldEditor(IDEPreferenceConstants.P_COMPLETION,
            Localization.getString("CodeAssistPreferencePage.HowCodeAdded"), 1,
            new String[][] {
                    { Localization.getString("CodeAssistPreferencePage.Insert"),
                            IDEPreferenceConstants.P_COMPLETION_INSERT },
                    { Localization.getString("CodeAssistPreferencePage.Overwrite"),
                            IDEPreferenceConstants.P_COMPLETION_OVERWRITE } },
            getFieldEditorParent()));
    addField(new IntegerFieldEditor(IDEPreferenceConstants.P_ACTIVATION_DELAY,
            Localization.getString("CodeAssistPreferencePage.ActivationDelay"), getFieldEditorParent()));
    addField(new StringFieldEditor(IDEPreferenceConstants.P_ACTIVATION_TRIGGER,
            Localization.getString("CodeAssistPreferencePage.ActivationTrigger"), getFieldEditorParent()));
    LogManager.logDebug("End createFieldEditors", this);
}

From source file:org.eclipse.linuxtools.systemtap.ui.ide.preferences.StapOptionsPreferencePage.java

License:Open Source License

public void createFieldEditors() {
    LogManager.logDebug("Start createFieldEditors:", this);
    for (int i = 0; i < IDEPreferenceConstants.P_STAP.length; i++) {
        addField(new BooleanFieldEditor(IDEPreferenceConstants.P_STAP[i][2],
                IDEPreferenceConstants.P_STAP[i][0] + "\t" + IDEPreferenceConstants.P_STAP[i][1],
                getFieldEditorParent()));

        if (2 < IDEPreferenceConstants.P_STAP[i][0].length()) {
            StringFieldEditor sfe = new StringFieldEditor(IDEPreferenceConstants.P_STAP_OPTS[i
                    - IDEPreferenceConstants.P_STAP.length + IDEPreferenceConstants.P_STAP_OPTS.length], "\t",
                    getFieldEditorParent());

            addField(sfe);/*ww w .ja v  a 2 s.c  o m*/
        }
    }
    LogManager.logDebug("End createFieldEditors:", this);
}

From source file:org.eclipse.linuxtools.systemtap.ui.logging.preferences.LoggingPreferencePage.java

License:Open Source License

public void createFieldEditors() {
    BooleanFieldEditor logging = new BooleanFieldEditor(PreferenceConstants.P_LOG_ENABLED,
            Localization.getString("LoggingPreferencePage.EnableLogging"), getFieldEditorParent());
    String[] debugLevel = { Localization.getString("LoggingPreferencePage.Debug"), "" + LogManager.DEBUG };
    String[] infoLevel = { Localization.getString("LoggingPreferencePage.Info"), "" + LogManager.INFO };
    String[] criticalLevel = { Localization.getString("LoggingPreferencePage.Critical"),
            "" + LogManager.CRITICAL };
    String[] fatalLevel = { Localization.getString("LoggingPreferencePage.Fatal"), "" + LogManager.FATAL };
    String[][] levels = { debugLevel, infoLevel, criticalLevel, fatalLevel };

    ComboFieldEditor level = new ComboFieldEditor(PreferenceConstants.P_LOG_LEVEL,
            Localization.getString("LoggingPreferencePage.LoggingLevel"), levels, getFieldEditorParent());
    RadioGroupFieldEditor loggingType = new RadioGroupFieldEditor(PreferenceConstants.P_LOG_TYPE,
            Localization.getString("LoggingPreferencePage.LogTo"), 1,
            new String[][] {
                    { Localization.getString("LoggingPreferencePage.Console"), "" + LogManager.CONSOLE },
                    { Localization.getString("LoggingPreferencePage.File"), "" + LogManager.FILE } },
            getFieldEditorParent());//from  w ww  . j a v a 2  s .co  m
    StringFieldEditor file = new StringFieldEditor(PreferenceConstants.P_LOG_FILE,
            Localization.getString("LoggingPreferencePage.File"), getFieldEditorParent());
    file.setEmptyStringAllowed(true);

    this.addField(logging);
    this.addField(level);
    this.addField(loggingType);
    this.addField(file);
}

From source file:org.eclipse.linuxtools.systemtap.ui.systemtapgui.preferences.EnvironmentVariablesPreferencePage.java

License:Open Source License

/**
 * Creates and returns a StringFieldEditor object with preferences set to it.
 *
 * @param name Name of the field.//from ww  w .  j a  va  2 s.co m
 * @param lblText Label text of the field.
 * @param parent Composite object parent of the object.
 * 
 * @return The created and configued StringFieldEditor ojbect.
 */
private StringFieldEditor createStringFieldEditor(String name, String lblText, Composite parent) {
    LogManager.logDebug(
            "Start createStringFieldEditor: name-" + name + ", lblText-" + lblText + ", parent-" + parent,
            this);
    StringFieldEditor sfe = new StringFieldEditor(name, lblText, parent);
    sfe.setPage(this);
    sfe.setPreferenceStore(getPreferenceStore());
    sfe.load();

    LogManager.logDebug("End createStringFieldEditor: returnVal-" + sfe, this);
    return sfe;
}

From source file:org.eclipse.linuxtools.tools.launch.ui.properties.LinuxtoolsPathPropertyPage.java

License:Open Source License

@Override
protected Control createContents(Composite parent) {
    initializeDialogUnits(parent);/*from www  . java 2s. c  o m*/

    result = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
    layout.marginWidth = 0;
    layout.numColumns = 1;
    result.setLayout(layout);
    String paths[][] = fillPaths();

    //defaults
    getPreferenceStore().setDefault(LinuxtoolsPathProperty.LINUXTOOLS_PATH_SYSTEM_NAME,
            LINUXTOOLS_PATH_SYSTEM_DEFAULT);
    getPreferenceStore().setDefault(LINUXTOOLS_PATH_COMBO_NAME, paths[0][1]);

    // Add radio buttons
    Composite radios = new Composite(result, SWT.NONE);
    GridLayout layoutRadios = new GridLayout();
    layoutRadios.marginWidth = 0;
    layoutRadios.numColumns = 1;
    radios.setLayout(layoutRadios);
    Composite space = new Composite(result, SWT.NONE);

    boolean systemPathSelected = getPreferenceStore()
            .getBoolean(LinuxtoolsPathProperty.LINUXTOOLS_PATH_SYSTEM_NAME);
    systemEnvButton = new Button(radios, SWT.RADIO);
    systemEnvButton.setText(Messages.LINUXTOOLS_PATH_SYSTEM_ENV);
    systemEnvButton.setSelection(systemPathSelected);
    systemEnvButton.addSelectionListener(new SelectionListener() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            updateOptionsEnable();
        }

        @Override
        public void widgetDefaultSelected(SelectionEvent e) {
        }
    });

    customButton = new Button(radios, SWT.RADIO);
    customButton.setText(Messages.LINUXTOOLS_PATH_CUSTOM);
    customButton.setToolTipText(Messages.LINUXTOOLS_PATH_CUSTOM_TOOLTIP);
    customButton.setSelection(!systemPathSelected);

    //Add combo box
    linuxtoolsPathCombo = new ComboFieldEditor(LINUXTOOLS_PATH_COMBO_NAME, Messages.LINUXTOOLS_PATH_COMBO,
            paths, result);
    linuxtoolsPathCombo.setPage(this);
    linuxtoolsPathCombo.setPreferenceStore(getPreferenceStore());
    linuxtoolsPathCombo.load();
    linuxtoolsPathCombo.setPropertyChangeListener(new IPropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent event) {
            customSelected = event.getNewValue().toString().equals("");
            if (!customSelected)
                linuxtoolsPath.setStringValue(event.getNewValue().toString());
            updateOptionsEnable();
        }
    });

    //Add textbox
    linuxtoolsPath = new StringFieldEditor(LinuxtoolsPathProperty.LINUXTOOLS_PATH_NAME,
            Messages.LINUXTOOLS_PATH, result);

    linuxtoolsPath.setPage(this);
    linuxtoolsPath.setPreferenceStore(getPreferenceStore());
    linuxtoolsPath.getTextControl(result).setToolTipText(Messages.LINUXTOOLS_PATH_TOOLTIP);

    String selected = getPreferenceStore().getString(LINUXTOOLS_PATH_COMBO_NAME);
    customSelected = selected.equals("");
    getPreferenceStore().setDefault(LinuxtoolsPathProperty.LINUXTOOLS_PATH_NAME,
            LinuxtoolsPathProperty.LINUXTOOLS_PATH_DEFAULT);
    linuxtoolsPath.load();

    Dialog.applyDialogFont(result);
    updateOptionsEnable();
    return result;
}

From source file:org.eclipse.mylyn.internal.phabricator.ui.wizard.PhabricatorRepositorySettingsPage.java

License:Open Source License

@Override
protected void createAdditionalControls(final Composite parent) {
    addRepositoryTemplatesToServerUrlCombo();

    apiTokenEditor = new StringFieldEditor(API_TOKEN, "Text", parent);
    apiTokenEditor.setStringValue("api-kp7flwjp55ysb3p5plcqud4twc4k");

    //      Label accessTypeLabel = new Label(parent, SWT.NONE);
    //      accessTypeLabel.setText(Messages.TracRepositorySettingsPage_Access_Type_);
    //      accessTypeCombo = new Combo(parent, SWT.READ_ONLY);
    ///*from w  ww.  j av a2s .com*/
    //      accessTypeCombo.add(Messages.TracRepositorySettingsPage_Automatic__Use_Validate_Settings_);
    //
    //      versions = Version.values();
    //      for (Version version : versions) {
    //         accessTypeCombo.add(version.toString());
    //      }

    //      if (repository != null) {
    //         setTracVersion(Version.fromVersion(repository.getVersion()));
    //      } else {
    //         setTracVersion(null);
    //      }

    //      accessTypeCombo.addSelectionListener(new SelectionListener() {
    //         public void widgetSelected(SelectionEvent e) {
    //            if (accessTypeCombo.getSelectionIndex() > 0) {
    //               setVersion(versions[accessTypeCombo.getSelectionIndex() - 1].name());
    //            }
    //            getWizard().getContainer().updateButtons();
    //         }
    //
    //         public void widgetDefaultSelected(SelectionEvent e) {
    //            // ignore
    //         }
    //      });

}

From source file:org.eclipse.ptp.gem.preferences.IspPreferencePage.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 w  w w  .j  a  va2 s  .c  om*/
@Override
public void createFieldEditors() {
    final Composite fieldEditorParent = this.getFieldEditorParent();

    // Create group for BooleanFieldEditors
    final Group prefsGroup = new Group(fieldEditorParent, SWT.NULL);
    prefsGroup.setText(Messages.IspPreferencePage_0);

    // Create BooleanFieldEditors for command line options.
    addField(
            new BooleanFieldEditor(PreferenceConstants.GEM_PREF_FIB, Messages.IspPreferencePage_1, prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_MPICALLS, Messages.IspPreferencePage_2,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_OPENMP, Messages.IspPreferencePage_3,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_BLOCK, Messages.IspPreferencePage_4,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_REPORT, Messages.IspPreferencePage_5,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_UNIXSOCKETS, Messages.IspPreferencePage_6,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_VERBOSE, Messages.IspPreferencePage_7,
            prefsGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group of miscellaneous FieldEditors
    final Group miscGroup = new Group(fieldEditorParent, SWT.NULL);
    miscGroup.setText(Messages.IspPreferencePage_8);
    addField(new IntegerFieldEditor(PreferenceConstants.GEM_PREF_PORTNUM, Messages.IspPreferencePage_9,
            miscGroup));
    addField(new IntegerFieldEditor(PreferenceConstants.GEM_PREF_REPORTNUM, Messages.IspPreferencePage_10,
            miscGroup));
    addField(new StringFieldEditor(PreferenceConstants.GEM_PREF_HOSTNAME, Messages.IspPreferencePage_17,
            miscGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group for GEM-path FieldEditors
    final Group gemPathsGroup = new Group(fieldEditorParent, SWT.NULL);
    gemPathsGroup.setText(Messages.IspPreferencePage_11);
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPEXE_PATH, Messages.IspPreferencePage_12,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPCC_PATH, Messages.IspPreferencePage_13,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPCPP_PATH, Messages.IspPreferencePage_14,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_HBV_PATH, Messages.IspPreferencePage_15,
            gemPathsGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group for GEM-path FieldEditors
    final Group remoteGemPathsGroup = new Group(fieldEditorParent, SWT.NULL);
    remoteGemPathsGroup.setText(Messages.IspPreferencePage_18);
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPEXE_PATH,
            Messages.IspPreferencePage_19, remoteGemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPCC_PATH,
            Messages.IspPreferencePage_20, remoteGemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPCPP_PATH,
            Messages.IspPreferencePage_21, remoteGemPathsGroup));

    // Do the grid layout work for each group.
    doLayoutAndData(prefsGroup, 1, 300);
    doLayoutAndData(miscGroup, 3, 300);
    doLayoutAndData(gemPathsGroup, 3, 300);
    doLayoutAndData(remoteGemPathsGroup, 3, 300);

    // Help button setup
    final Button helpButton = new Button(fieldEditorParent, SWT.PUSH);
    helpButton.setLayoutData(new GridData(SWT.LEFT, SWT.NULL, false, false, 3, 1));
    helpButton.setImage(GemPlugin.getImageDescriptor("icons/help-contents.gif").createImage()); //$NON-NLS-1$
    helpButton.setToolTipText(Messages.IspPreferencePage_16);

    helpButton.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            // do nothing
        }

        public void widgetSelected(SelectionEvent e) {
            PlatformUI.getWorkbench().getHelpSystem()
                    .displayHelpResource("/org.eclipse.ptp.gem.help/html/preferences.html#ispPrefs"); //$NON-NLS-1$
        }
    });
}

From source file:org.eclipse.ptp.gig.preferences.GIGPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    final Composite composite = this.getFieldEditorParent();
    composite.setLayout(new GridLayout(1, false));

    final Group topGroup = new Group(composite, SWT.NULL);
    topGroup.setLayout(new GridLayout(1, false));
    final Group localRemoteGroup = new Group(topGroup, SWT.NULL);
    localRemoteGroup.setLayout(new GridLayout(0, false));
    final Group remoteGroup = new Group(localRemoteGroup, SWT.NULL);
    remoteGroup.setLayout(new GridLayout(1, false));
    final Group localGroup = new Group(localRemoteGroup, SWT.NULL);
    localGroup.setLayout(new GridLayout(1, false));
    this.addField(new BooleanFieldEditor(LOCAL, Messages.GIG_PREFERENCE_PAGE_1, BooleanFieldEditor.DEFAULT,
            localRemoteGroup));//from   w ww  .j  a v  a2  s. c om
    this.addField(new StringFieldEditor(GIGPreferencePage.USERNAME, GIGPreferencePage.USERNAME, remoteGroup));
    this.addField(new StringFieldEditor(GIGPreferencePage.PASSWORD, GIGPreferencePage.PASSWORD, remoteGroup));
    this.addField(new StringFieldEditor(Messages.SERVER_NAME, Messages.SERVER_NAME, remoteGroup));
    this.addField(new StringFieldEditor(Messages.TARGET_PROJECT, Messages.TARGET_PROJECT, remoteGroup));
    this.addField(new StringFieldEditor(GKLEE_HOME, GKLEE_HOME, localGroup));
    this.addField(new StringFieldEditor(FLA_KLEE_HOME_DIR, FLA_KLEE_HOME_DIR, localGroup));
    this.addField(
            new StringFieldEditor(GKLEE_DEBUG_PLUS_ASSERTS_BIN, GKLEE_DEBUG_PLUS_ASSERTS_BIN, localGroup));
    this.addField(new StringFieldEditor(LLVM_DEBUG_PLUS_ASSERTS_BIN, LLVM_DEBUG_PLUS_ASSERTS_BIN, localGroup));
    this.addField(new StringFieldEditor(LLVM_GCC_LINUX_BIN, LLVM_GCC_LINUX_BIN, localGroup));
    this.addField(new StringFieldEditor(BIN, BIN, localGroup));
    this.addField(new StringFieldEditor(ADDITIONAL_PATH, ADDITIONAL_PATH, localGroup));

    final Group tolerance = new Group(topGroup, SWT.NULL);
    tolerance.setLayout(new GridLayout(1, false));
    this.addField(new BooleanFieldEditor(Messages.BANK_OR_WARP, Messages.BANK_OR_WARP, tolerance));
    this.addField(new IntegerFieldEditor(Messages.BANK_CONFLICT_LOW, Messages.BANK_CONFLICT_LOW, tolerance));
    this.addField(new IntegerFieldEditor(Messages.BANK_CONFLICT_HIGH, Messages.BANK_CONFLICT_HIGH, tolerance));
    this.addField(
            new IntegerFieldEditor(Messages.MEMORY_COALESCING_LOW, Messages.MEMORY_COALESCING_LOW, tolerance));
    this.addField(new IntegerFieldEditor(Messages.MEMORY_COALESCING_HIGH, Messages.MEMORY_COALESCING_HIGH,
            tolerance));
    this.addField(
            new IntegerFieldEditor(Messages.WARP_DIVERGENCE_LOW, Messages.WARP_DIVERGENCE_LOW, tolerance));
    this.addField(
            new IntegerFieldEditor(Messages.WARP_DIVERGENCE_HIGH, Messages.WARP_DIVERGENCE_HIGH, tolerance));

}

From source file:org.eclipse.ptp.internal.gem.preferences.IspPreferencePage.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 w  ww .j a v a2s.com
@Override
public void createFieldEditors() {
    final Composite fieldEditorParent = this.getFieldEditorParent();

    // Create group for BooleanFieldEditors
    final Group prefsGroup = new Group(fieldEditorParent, SWT.NULL);
    prefsGroup.setText(Messages.IspPreferencePage_0);

    // Create BooleanFieldEditors for command line options.
    addField(
            new BooleanFieldEditor(PreferenceConstants.GEM_PREF_FIB, Messages.IspPreferencePage_1, prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_MPICALLS, Messages.IspPreferencePage_2,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_OPENMP, Messages.IspPreferencePage_3,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_BLOCK, Messages.IspPreferencePage_4,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_REPORT, Messages.IspPreferencePage_5,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_UNIXSOCKETS, Messages.IspPreferencePage_6,
            prefsGroup));
    addField(new BooleanFieldEditor(PreferenceConstants.GEM_PREF_VERBOSE, Messages.IspPreferencePage_7,
            prefsGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group of miscellaneous FieldEditors
    final Group miscGroup = new Group(fieldEditorParent, SWT.NULL);
    miscGroup.setText(Messages.IspPreferencePage_8);
    addField(new IntegerFieldEditor(PreferenceConstants.GEM_PREF_PORTNUM, Messages.IspPreferencePage_9,
            miscGroup));
    addField(new IntegerFieldEditor(PreferenceConstants.GEM_PREF_REPORTNUM, Messages.IspPreferencePage_10,
            miscGroup));
    addField(new StringFieldEditor(PreferenceConstants.GEM_PREF_HOSTNAME, Messages.IspPreferencePage_17,
            miscGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group for GEM-path FieldEditors
    final Group gemPathsGroup = new Group(fieldEditorParent, SWT.NULL);
    gemPathsGroup.setText(Messages.IspPreferencePage_11);
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPEXE_PATH, Messages.IspPreferencePage_12,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPCC_PATH, Messages.IspPreferencePage_13,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_ISPCPP_PATH, Messages.IspPreferencePage_14,
            gemPathsGroup));
    addField(new DirectoryFieldEditor(PreferenceConstants.GEM_PREF_HBV_PATH, Messages.IspPreferencePage_15,
            gemPathsGroup));

    // Vertical spacer
    new Label(fieldEditorParent, SWT.NULL).setLayoutData(new GridData(SWT.FILL, SWT.NULL, true, false, 3, 1));

    // Create group for GEM-path FieldEditors
    final Group remoteGemPathsGroup = new Group(fieldEditorParent, SWT.NULL);
    remoteGemPathsGroup.setText(Messages.IspPreferencePage_18);
    addField(new StringFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPEXE_PATH,
            Messages.IspPreferencePage_19, remoteGemPathsGroup));
    addField(new StringFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPCC_PATH,
            Messages.IspPreferencePage_20, remoteGemPathsGroup));
    addField(new StringFieldEditor(PreferenceConstants.GEM_PREF_REMOTE_ISPCPP_PATH,
            Messages.IspPreferencePage_21, remoteGemPathsGroup));

    // Do the grid layout work for each group.
    doLayoutAndData(prefsGroup, 1, 300);
    doLayoutAndData(miscGroup, 3, 300);
    doLayoutAndData(gemPathsGroup, 3, 300);
    doLayoutAndData(remoteGemPathsGroup, 3, 300);

    // Help button setup
    final Button helpButton = new Button(fieldEditorParent, SWT.PUSH);
    helpButton.setLayoutData(new GridData(SWT.LEFT, SWT.NULL, false, false, 3, 1));
    helpButton.setImage(GemPlugin.getImageDescriptor("icons/help-contents.gif").createImage()); //$NON-NLS-1$
    helpButton.setToolTipText(Messages.IspPreferencePage_16);

    helpButton.addSelectionListener(new SelectionListener() {
        public void widgetDefaultSelected(SelectionEvent e) {
            // do nothing
        }

        public void widgetSelected(SelectionEvent e) {
            PlatformUI.getWorkbench().getHelpSystem()
                    .displayHelpResource("/org.eclipse.ptp.gem.help/html/preferences.html#ispPrefs"); //$NON-NLS-1$
        }
    });
}

From source file:org.eclipse.ptp.internal.remote.terminal.TerminalPrefs.java

License:Open Source License

protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();
    addField(new StringFieldEditor(Messages.SHELL_STARTUP_COMMAND, Messages.STARTUP_COMMAND_TITLE, parent));
}