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.debug.internal.ui.views.memory.SetPaddedStringPreferencePage.java

License:Open Source License

protected void createFieldEditors() {
    fPaddedString = new StringFieldEditor(IDebugUIConstants.PREF_PADDED_STR,
            DebugUIMessages.SetPaddedStringPreferencePage_0, getFieldEditorParent());
    fPaddedString.setEmptyStringAllowed(false);
    fPaddedString.setTextLimit(5);/* www .  j  a va  2s  . co  m*/
    addField(fPaddedString);
}

From source file:org.eclipse.dirigible.ide.db.preferences.DatabaseAttributesPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    Text text = null;/*  w w  w  . j  ava  2 s.  c o  m*/

    StringFieldEditor databaseProductNameField = new StringFieldEditor(CommonParameters.DATABASE_PRODUCT_NAME,
            "&Product Name:", getFieldEditorParent());
    text = databaseProductNameField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.getDatabaseProductName() != null ? CommonParameters.getDatabaseProductName()
            : DatabasePreferencePage.N_A);
    addField(databaseProductNameField);

    StringFieldEditor databaseProductVersionField = new StringFieldEditor(
            CommonParameters.DATABASE_PRODUCT_VERSION, "&Product Version:", getFieldEditorParent());
    text = databaseProductVersionField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(
            CommonParameters.getDatabaseProductVersion() != null ? CommonParameters.getDatabaseProductVersion()
                    : DatabasePreferencePage.N_A);
    addField(databaseProductVersionField);

    StringFieldEditor databaseMinorVersionField = new StringFieldEditor(CommonParameters.DATABASE_MINOR_VERSION,
            "&Minor Version:", getFieldEditorParent());
    text = databaseMinorVersionField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_MINOR_VERSION) != null
            ? CommonParameters.get(CommonParameters.DATABASE_MINOR_VERSION)
            : DatabasePreferencePage.N_A);
    addField(databaseMinorVersionField);

    StringFieldEditor databaseMajorVersionField = new StringFieldEditor(CommonParameters.DATABASE_MAJOR_VERSION,
            "&Major Version:", getFieldEditorParent());
    text = databaseMajorVersionField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_MAJOR_VERSION) != null
            ? CommonParameters.get(CommonParameters.DATABASE_MAJOR_VERSION)
            : DatabasePreferencePage.N_A);
    addField(databaseMajorVersionField);

}

From source file:org.eclipse.dirigible.ide.db.preferences.DatabaseDriverPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    Text text = null;//ww w. j a  va  2s  .  co  m

    StringFieldEditor databaseDriverNameField = new StringFieldEditor(CommonParameters.DATABASE_DRIVER_NAME,
            "&Driver Name:", getFieldEditorParent());
    text = databaseDriverNameField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_DRIVER_NAME) != null
            ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_NAME)
            : DatabasePreferencePage.N_A);
    addField(databaseDriverNameField);

    StringFieldEditor databaseMinorVersionField = new StringFieldEditor(
            CommonParameters.DATABASE_DRIVER_MINOR_VERSION, "&Minor Version:", getFieldEditorParent());
    text = databaseMinorVersionField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_DRIVER_MINOR_VERSION) != null
            ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_MINOR_VERSION)
            : DatabasePreferencePage.N_A);
    addField(databaseMinorVersionField);

    StringFieldEditor databaseMajorVersionField = new StringFieldEditor(
            CommonParameters.DATABASE_DRIVER_MAJOR_VERSION, "&Major Version:", getFieldEditorParent());
    text = databaseMajorVersionField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_DRIVER_MAJOR_VERSION) != null
            ? CommonParameters.get(CommonParameters.DATABASE_DRIVER_MAJOR_VERSION)
            : DatabasePreferencePage.N_A);
    addField(databaseMajorVersionField);

    StringFieldEditor databaseConnectionClassNameField = new StringFieldEditor(
            CommonParameters.DATABASE_CONNECTION_CLASS_NAME, "&Connection Class Name:", getFieldEditorParent());
    text = databaseConnectionClassNameField.getTextControl(getFieldEditorParent());
    text.setEditable(false);
    text.setText(CommonParameters.get(CommonParameters.DATABASE_CONNECTION_CLASS_NAME) != null
            ? CommonParameters.get(CommonParameters.DATABASE_CONNECTION_CLASS_NAME)
            : DatabasePreferencePage.N_A);
    addField(databaseConnectionClassNameField);

}

From source file:org.eclipse.ecf.mgmt.host.eclipse.HostCategoryPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    editorComposite = getFieldEditorParent();
    hostnameEditor = new StringFieldEditor(Activator.HOSTNAME_PREF, "Hostname", editorComposite);
    hostnameEditor.setEmptyStringAllowed(false);
    hostnameEditor.setEnabled(enabled, editorComposite);
    addField(hostnameEditor);/*from   w ww . ja  v  a2 s  .  com*/
    portEditor = new IntegerFieldEditor(Activator.PORT_PREF, "Port", editorComposite, 5);
    portEditor.setEmptyStringAllowed(false);
    portEditor.setEnabled(enabled, editorComposite);
    addField(portEditor);
    noDefaultAndApplyButton();
}

From source file:org.eclipse.emf.cdo.dawn.preferences.DawnRemotePreferencePage.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.
 *///  ww w  .java  2  s  .  co m
@Override
public void createFieldEditors() {
    addField(new StringFieldEditor(PreferenceConstants.P_SERVER_NAME, "Server Name:", getFieldEditorParent()));
    addField(new IntegerFieldEditor(PreferenceConstants.P_SERVER_PORT, "Server Port:", getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.P_REPOSITORY_NAME, "Repository:",
            getFieldEditorParent()));
    // TODO change this to a list of repositories to allow auto connection for the clients
    addField(new StringFieldEditor(PreferenceConstants.P_PROTOCOL, "Protocol:", getFieldEditorParent()));
}

From source file:org.eclipse.epp.internal.logging.aeri.ui.PreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new StringFieldEditor(PROP_SERVER, Messages.FIELD_LABEL_SERVER, getFieldEditorParent()));

    addField(createStringFieldEditorAndToolTip(PROP_NAME, Messages.FIELD_LABEL_NAME,
            Messages.FIELD_MESSAGE_NAME));
    addField(createStringFieldEditorAndToolTip(PROP_EMAIL, Messages.FIELD_LABEL_EMAIL,
            Messages.FIELD_MESSAGE_EMAIL + " \n" + Messages.FIELD_DESC_EMAIL)); //$NON-NLS-1$
    addField(new ComboFieldEditor(PROP_SEND_ACTION, Messages.FIELD_LABEL_ACTION, createModeLabelAndValues(),
            getFieldEditorParent()));/*www  .j ava 2  s  .  co  m*/
    addField(createBooleanFieldEditorAndToolTip(PROP_SKIP_SIMILAR_ERRORS,
            Messages.FIELD_LABEL_SKIP_SIMILAR_ERRORS, Messages.TOOLTIP_SKIP_SIMILAR));
    addField(createBooleanFieldEditorAndToolTip(PROP_ANONYMIZE_STACKTRACES,
            Messages.FIELD_LABEL_ANONYMIZE_STACKTRACES, Messages.TOOLTIP_MAKE_STACKTRACE_ANONYMOUS));
    addField(createBooleanFieldEditorAndToolTip(PROP_ANONYMIZE_MESSAGES,
            Messages.FIELD_LABEL_ANONYMIZE_MESSAGES, Messages.TOOLTIP_MAKE_MESSAGES_ANONYMOUS));

    addLinks(getFieldEditorParent());
    Dialog.applyDialogFont(getFieldEditorParent());
}

From source file:org.eclipse.epp.internal.logging.aeri.ui.PreferencePage.java

License:Open Source License

private StringFieldEditor createStringFieldEditorAndToolTip(String name, String labelText, String toolTipText) {
    StringFieldEditor stringFieldEditor = new StringFieldEditor(name, labelText, getFieldEditorParent());
    DefaultToolTip toolTip = new DefaultToolTip(stringFieldEditor.getLabelControl(getFieldEditorParent()));
    calibrateTooltip(toolTip, toolTipText);

    return stringFieldEditor;
}

From source file:org.eclipse.epsilon.ewl.emf.WizardsExtensionPreferenceDialog.java

License:Open Source License

@Override
protected Control createDialogArea(Composite parent) {
    Composite zuper = (Composite) super.createDialogArea(parent);

    setTitle("Configure wizards");
    getShell().setText("GMF Wizards");
    setMessage("Configure wizards for an EMF namespace URI");

    GridLayout layout = new GridLayout(2, false);
    GridData fillData = new GridData(GridData.FILL_BOTH);
    fillData.horizontalIndent = 8;/*w  w  w  .j a v a2s .  com*/

    final Composite composite = new Composite(zuper, SWT.FILL);
    composite.setLayout(layout);
    composite.setLayoutData(fillData);

    // Main namespace URI (for activating the wizard)
    final Composite cNamespaceURIRow = new Composite(composite, SWT.FILL);
    cNamespaceURIRow.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    extensionEditor = new StringFieldEditor("", "Namespace URI", cNamespaceURIRow);
    extensionEditor.getTextControl(cNamespaceURIRow).setLayoutData(fillData);
    Button browseMetamodelUri = new Button(composite, SWT.NONE);
    browseMetamodelUri.setText("Browse EPackages...");
    browseMetamodelUri.addListener(SWT.Selection, new BrowseEPackagesListener() {
        @Override
        public void selectionChanged(String ePackageUri) {
            extensionEditor.getTextControl(cNamespaceURIRow).setText(ePackageUri);
        }
    });

    // EWL file picker
    Composite cEWLFileRow = new Composite(composite, SWT.FILL);
    wizardsEditor = new ResourceFieldEditor("", "Wizards", "EWL Files", "EWL files in the workspace", "ewl",
            cEWLFileRow);
    fillData = new GridData(GridData.FILL_BOTH);
    fillData.horizontalSpan = 2;
    cEWLFileRow.setLayoutData(fillData);

    // Extra packages picker
    extraPackagesEditor = new SettableListEditor("", "Extra packages:", composite);
    extraPackagesEditor.fillIntoGrid(composite, 2);

    // Read values back into the dialog
    extensionEditor.setStringValue(preference.getNamespaceURI());
    wizardsEditor.setStringValue(preference.getWizards());
    extraPackagesEditor.setStringValues(preference.getExtraPackages());

    return composite;
}

From source file:org.eclipse.etrice.ui.common.preferences.ETricePreferencePage.java

License:Open Source License

public void createFieldEditors() {
    addLabel("");
    addLabel("Diagram Editors");
    addField(new BooleanFieldEditor(PreferenceConstants.CONFIRM_DELETE, "&Confirm diagram element deletion",
            getFieldEditorParent()));/*from  www  . j a  v  a  2  s  .  c  o m*/

    BooleanFieldEditor useGrid = new BooleanFieldEditor(PreferenceConstants.USE_GRID,
            "Use &Grid (grid settings apply to new diagrams only)", getFieldEditorParent());
    addField(useGrid);

    snap = new BooleanFieldEditor(PreferenceConstants.SNAP_TO_GRID, "&Snap to Grid", getFieldEditorParent());
    addField(snap);

    hor = new StringFieldEditor(PreferenceConstants.HOR_GRID_UNIT, "&Horizontal Grid Unit [px]:",
            getFieldEditorParent());
    addField(hor);

    ver = new StringFieldEditor(PreferenceConstants.VER_GRID_UNIT, "&Vertical Grid Unit [px]:",
            getFieldEditorParent());
    addField(ver);

    useGridCheck = (Button) useGrid.getDescriptionControl(getFieldEditorParent());
    useGridCheck.addSelectionListener(new SelectionListener() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            updateGridFields();
        }

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

From source file:org.eclipse.ice.client.widgets.moose.MoosePreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    addField(new DirectoryFieldEditor("PATH", "&Directory preference:", getFieldEditorParent()));
    addField(new BooleanFieldEditor("BOOLEAN_VALUE", "&An example of a boolean preference",
            getFieldEditorParent()));//from ww w  .  j  av  a  2  s.  co  m

    addField(new RadioGroupFieldEditor("CHOICE", "An example of a multiple-choice preference", 1,
            new String[][] { { "&Choice 1", "choice1" }, { "C&hoice 2", "choice2" } }, getFieldEditorParent()));
    addField(new StringFieldEditor("MySTRING1", "A &text preference:", getFieldEditorParent()));
    addField(new StringFieldEditor("MySTRING2", "A &text preference:", getFieldEditorParent()));
}