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

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

Introduction

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

Prototype

public void setTextLimit(int limit) 

Source Link

Document

Sets this text field's text limit.

Usage

From source file:ch.elexis.extdoc.preferences.ExterneDokumente.java

License:Open Source License

@Override
protected void createFieldEditors() {
    DirectoryFieldEditor dfe;// w ww.  ja  v  a2s .c  o  m
    StringFieldEditor sfe;
    FileFieldEditor ffe;

    PreferenceConstants.PathElement[] prefElems = PreferenceConstants.getPrefenceElements();
    for (int j = 0; j < prefElems.length; j++) {
        sfe = new StringFieldEditor(prefElems[j].prefName,
                String.format(Messages.ExterneDokumente_shorthand_for_path, j), getFieldEditorParent());
        sfe.setTextLimit(8);
        addField(sfe);
        dfe = new DirectoryFieldEditor(prefElems[j].prefBaseDir, Messages.ExterneDokumente_path_name_preference,
                getFieldEditorParent());
        addField(dfe);
    }
    sfe = new StringFieldEditor(PreferenceConstants.CONCERNS, Messages.ExterneDokumente_Concerns,
            getFieldEditorParent());
    sfe.setTextLimit(60);
    addField(sfe);
    Composite composite = getFieldEditorParent();
    ffe = new FileFieldEditor(PreferenceConstants.EMAIL_PROGRAM, Messages.ExterneDokumente_email_app,
            getFieldEditorParent());
    ffe.getLabelControl(composite).setToolTipText(
            "Programm das zum Verschicken von E-Mails verwendet werden soll, falls leer wird dir URL mailto: verwendet, welche keine Anhnge untersttzt");
    addField(ffe);

}

From source file:com.clustercontrol.repository.preference.RepositoryPreferencePage.java

License:Open Source License

/**
 * ????//  w  w w .  j  a v  a  2  s.c  o m
 */
@Override
public void createFieldEditors() {
    Composite parent = this.getFieldEditorParent();
    GridData gridData = null;

    // ?[]
    Group nodeGroup = new Group(parent, SWT.SHADOW_NONE);
    WidgetTestUtil.setTestId(this, null, nodeGroup);
    gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = 10;
    gridData.verticalSpan = 10;
    nodeGroup.setLayoutData(gridData);
    nodeGroup.setText(Messages.getString("view.repository.node"));
    // 
    StringFieldEditor progExec = new StringFieldEditor(P_PROGRAM_EXECUTION, MSG_PROGRAM_EXECUTION, nodeGroup);
    progExec.setTextLimit(DataRangeConstant.VARCHAR_1024);
    String[] args = { Integer.toString(DataRangeConstant.VARCHAR_1024) };
    progExec.setErrorMessage(Messages.getString("message.hinemos.7", args));
    this.addField(progExec);

    // This setting is not available for Web Client. Disable and show message.
    // Note: RAP BUG? If there is no FieldEditor set, label will not be shown.
    if (ClusterControlPlugin.isRAP()) {
        progExec.getTextControl(nodeGroup).setEnabled(false);

        Label lblNotAvailable = new Label(parent, SWT.LEFT);
        lblNotAvailable.setText(Messages.getString("preferencepage.notavailable.message"));
        lblNotAvailable.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
        WidgetTestUtil.setTestId(this, "notavailable", nodeGroup);
    }
}

From source file:com.nextep.designer.sqlclient.ui.preferences.SQLClientPreferencePage.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 a  v a 2 s .  com*/
 */
public void createFieldEditors() {
    // addField(new DirectoryFieldEditor(PreferenceConstants.P_PATH, "&Directory preference:",
    // getFieldEditorParent()));
    // addField(new BooleanFieldEditor(PreferenceConstants.P_BOOLEAN,
    // "&An example of a boolean preference", getFieldEditorParent()));
    //
    // addField(new RadioGroupFieldEditor(PreferenceConstants.P_CHOICE,
    // "An example of a multiple-choice preference", 1, new String[][] {
    // { "&Choice 1", "choice1" }, { "C&hoice 2", "choice2" } },
    // getFieldEditorParent()));
    // addField(new StringFieldEditor(PreferenceConstants.P_STRING, "A &text preference:",
    // getFieldEditorParent()));
    addField(new DateFormatFieldEditor(PreferenceConstants.EXPORT_DATE_FORMAT, "Date format : ",
            getFieldEditorParent()));
    final StringFieldEditor decimalEditor = new StringFieldEditor(PreferenceConstants.EXPORT_DECIMAL_SEPARATOR,
            "Decimal separator : ", getFieldEditorParent());
    decimalEditor.setTextLimit(1);
    addField(decimalEditor);
    final StringFieldEditor enclosedEditor = new StringFieldEditor(PreferenceConstants.EXPORT_ENCLOSER,
            "Field enclosed by : ", getFieldEditorParent());
    enclosedEditor.setTextLimit(1);
    addField(enclosedEditor);
    final StringFieldEditor escapeEditor = new StringFieldEditor(PreferenceConstants.EXPORT_ESCAPER,
            "Escape character:", getFieldEditorParent());
    escapeEditor.setTextLimit(1);
    addField(escapeEditor);

    addField(new StringFieldEditor(PreferenceConstants.EXPORT_NULL_VALUE, "Null value : ",
            getFieldEditorParent()));
    addField(new StringFieldEditor(PreferenceConstants.EXPORT_SEPARATOR, "Field separator : ",
            getFieldEditorParent()));

}

From source file:com.safi.workshop.sqlexplorer.preferences.GeneralPreferencePage.java

License:Open Source License

@Override
protected void createFieldEditors() {
    IntegerFieldEditor iEdit;//from w  w w  .j  a v a 2  s. c o  m
    StringFieldEditor sEdit;

    iEdit = new IntegerFieldEditor(IConstants.PRE_ROW_COUNT, Messages.getString("Preview_Max_Rows_3"),
            getFieldEditorParent(), 5);
    iEdit.setValidRange(1, 100);
    iEdit.setErrorMessage(Messages.getString("Accepted_Range_is__1_-_100_1"));
    iEdit.setEmptyStringAllowed(false);
    addField(iEdit);

    iEdit = new IntegerFieldEditor(IConstants.MAX_SQL_ROWS, Messages.getString("SQL_Limit_Rows_2"),
            getFieldEditorParent());
    iEdit.setValidRange(100, 5000);
    iEdit.setErrorMessage(Messages.getString("Accepted_Range_is__100_-_5000_3"));
    addField(iEdit);

    BooleanFieldEditor bfe;
    addField(bfe = new BooleanFieldEditor(IConstants.AUTO_COMMIT,
            Messages.getString("GeneralPreferencePage.AutoCommit_1"), getFieldEditorParent()));
    final Button autoCommitBox = bfe.getCheckbox();
    addField(bfe = new BooleanFieldEditor(IConstants.COMMIT_ON_CLOSE,
            Messages.getString("GeneralPreferencePage.Commit_On_Close_2"), getFieldEditorParent()));
    final Button commitOnCloseBox = bfe.getCheckbox();

    /*
     * final Button autoCommitBox = new Button(getFieldEditorParent(), SWT.CHECK);
     * autoCommitBox.setText(Messages.getString("GeneralPreferencePage.AutoCommit_1"));
     * //$NON-NLS-1$ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
     * gd.horizontalAlignment = GridData.BEGINNING; gd.horizontalSpan = 2;
     * autoCommitBox.setLayoutData(gd); addAccessor(new
     * CheckBoxAccessor(IConstants.AUTO_COMMIT, autoCommitBox));
     * 
     * 
     * final Button commitOnCloseBox = new Button(getFieldEditorParent(), SWT.CHECK);
     * commitOnCloseBox
     * .setText(Messages.getString("GeneralPreferencePage.Commit_On_Close_2"));
     * //$NON-NLS-1$ gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalAlignment =
     * GridData.BEGINNING; gd.horizontalSpan = 2; commitOnCloseBox.setLayoutData(gd);
     * addAccessor(new CheckBoxAccessor(IConstants.COMMIT_ON_CLOSE, commitOnCloseBox));
     */

    autoCommitBox.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (autoCommitBox.getSelection())
                commitOnCloseBox.setEnabled(false);
            else
                commitOnCloseBox.setEnabled(true);
        }
    });
    commitOnCloseBox.setEnabled(!autoCommitBox.getSelection());

    addField(new BooleanFieldEditor(IConstants.SQL_ASSIST, Messages.getString(
            "GeneralPreferencePage.Tables_and_columns_auto-completing_assistance._Use_only_with_fast_database_connections_1"),
            getFieldEditorParent()));

    sEdit = new StringFieldEditor(IConstants.SQL_QRY_DELIMITER,
            Messages.getString("Preferences.SQLExplorer.QueryDelimiter"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(false);
    sEdit.setTextLimit(1);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.QueryDelimiter.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null || sEdit.getStringValue().length() == 0)
        sEdit.loadDefault();

    sEdit = new StringFieldEditor(IConstants.SQL_ALT_QRY_DELIMITER,
            Messages.getString("Preferences.SQLExplorer.AltQueryDelimiter"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(4);
    addField(sEdit);

    sEdit = new StringFieldEditor(IConstants.SQL_SL_COMMENT,
            Messages.getString("Preferences.SQLExplorer.SLComment"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(4);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.SLComment.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null)
        sEdit.loadDefault();

    sEdit = new StringFieldEditor(IConstants.SQL_ML_COMMENT_START,
            Messages.getString("Preferences.SQLExplorer.MLCommentStart"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(4);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.MLCommentStart.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null)
        sEdit.loadDefault();

    sEdit = new StringFieldEditor(IConstants.SQL_ML_COMMENT_END,
            Messages.getString("Preferences.SQLExplorer.MLCommentEnd"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(4);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.MLCommentEnd.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null)
        sEdit.loadDefault();

    sEdit = new StringFieldEditor(IConstants.SQL_QUOTE_ESCAPE_CHAR,
            Messages.getString("Preferences.SQLExplorer.QuoteEscapeChar"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(1);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.QuoteEscapeChar.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null)
        sEdit.loadDefault();

    addField(new BooleanFieldEditor(IConstants.WORD_WRAP,
            Messages.getString("Preferences.SQLExplorer.WordWrap"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.AUTO_OPEN_EDITOR,
            Messages.getString("Preferences.SQLExplorer.OpenEditorOnConnection"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.CLEAR_RESULTS_ON_EXECUTE,
            Messages.getString("Preferences.SQLExplorer.ClearResultsOnExecute"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.USE_LONG_CAPTIONS_ON_RESULTS,
            Messages.getString("Preferences.SQLExplorer.UseLongCaptionsOnResults"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.STOP_ON_ERROR,
            Messages.getString("Preferences.SQLExplorer.StopOnError"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.LOG_SUCCESS_MESSAGES,
            Messages.getString("Preferences.SQLExplorer.LogSuccessMessages"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.REQUIRE_SAVE_ON_CLOSE_EDITOR,
            Messages.getString("Preferences.SQLExplorer.RequireSaveOnClose"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.ENABLE_STRUCTURED_COMMENTS,
            Messages.getString("Preferences.SQLExplorer.EnableStructuredComments"), getFieldEditorParent()));

    addField(new BooleanFieldEditor(IConstants.WORD_WRAP,
            Messages.getString("Preferences.SQLExplorer.WordWrap"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.AUTO_OPEN_EDITOR,
            Messages.getString("Preferences.SQLExplorer.OpenEditorOnConnection"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.TREAT_NEW_AS_SCRATCH,
            Messages.getString("Preferences.SQLExplorer.TreatNewAsScratch"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.CLEAR_RESULTS_ON_EXECUTE,
            Messages.getString("Preferences.SQLExplorer.ClearResultsOnExecute"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.USE_LONG_CAPTIONS_ON_RESULTS,
            Messages.getString("Preferences.SQLExplorer.UseLongCaptionsOnResults"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.STOP_ON_ERROR,
            Messages.getString("Preferences.SQLExplorer.StopOnError"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.LOG_SUCCESS_MESSAGES,
            Messages.getString("Preferences.SQLExplorer.LogSuccessMessages"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.LOG_SQL_HISTORY,
            Messages.getString("Preferences.SQLExplorer.LogSQLHistory"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.REQUIRE_SAVE_ON_CLOSE_EDITOR,
            Messages.getString("Preferences.SQLExplorer.RequireSaveOnClose"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.ENABLE_STRUCTURED_COMMENTS,
            Messages.getString("Preferences.SQLExplorer.EnableStructuredComments"), getFieldEditorParent()));

    final String[][] DEBUG_LEVEL_VALUES = new String[][] {
            { Messages.getString("Preferences.SQLExplorer.DebugLevelOff"), IConstants.QUERY_DEBUG_OFF },
            { Messages.getString("Preferences.SQLExplorer.DebugLevelFailed"), IConstants.QUERY_DEBUG_FAILED },
            { Messages.getString("Preferences.SQLExplorer.DebugLevelAll"), IConstants.QUERY_DEBUG_ALL } };
    ComboFieldEditor combo = new ComboFieldEditor(IConstants.QUERY_DEBUG_LOG_LEVEL,
            Messages.getString("Preferences.SQLExplorer.QueryDebugLog"), DEBUG_LEVEL_VALUES,
            getFieldEditorParent());
    addField(combo);
}

From source file:es.cv.gvcase.ide.redmine.preferences.MOSKittRedminePreferencePage.java

License:Open Source License

public void createFieldEditors() {
    RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(
            MOSKittRedminePreferenceConstants.RedmineAutentication, "Select autentication type on Redmine:", 1,
            new String[][] { { "Anonymous", MOSKittRedminePreferenceConstants.RedmineAutenticationAnonymous },
                    { "Personal API Access Key", MOSKittRedminePreferenceConstants.RedmineAutenticationUser } },
            getFieldEditorParent());/*from   w ww.  j a  va2s .  com*/
    addField(rgfe);

    StringFieldEditor sfe = new StringFieldEditor(MOSKittRedminePreferenceConstants.APIAccessKeyUser,
            "API Access Key", getFieldEditorParent());
    sfe.setTextLimit(40);
    addField(sfe);
}

From source file:net.sourceforge.sqlexplorer.preferences.GeneralPreferencePage.java

License:Open Source License

protected void createFieldEditors() {
    IntegerFieldEditor iEdit;//from  w w w  . ja v  a2  s .c om
    StringFieldEditor sEdit;

    iEdit = new IntegerFieldEditor(IConstants.PRE_ROW_COUNT, Messages.getString("Preview_Max_Rows_3"),
            getFieldEditorParent(), 5);
    iEdit.setValidRange(1, 100);
    iEdit.setErrorMessage(Messages.getString("Accepted_Range_is__1_-_100_1"));
    iEdit.setEmptyStringAllowed(false);
    addField(iEdit);

    iEdit = new IntegerFieldEditor(IConstants.MAX_SQL_ROWS, Messages.getString("SQL_Limit_Rows_2"),
            getFieldEditorParent());
    iEdit.setValidRange(100, 5000);
    iEdit.setErrorMessage(Messages.getString("Accepted_Range_is__100_-_5000_3"));
    addField(iEdit);

    BooleanFieldEditor bfe;
    addField(bfe = new BooleanFieldEditor(IConstants.AUTO_COMMIT,
            Messages.getString("GeneralPreferencePage.AutoCommit_1"), getFieldEditorParent()));
    final Button autoCommitBox = bfe.getCheckbox();
    addField(bfe = new BooleanFieldEditor(IConstants.COMMIT_ON_CLOSE,
            Messages.getString("GeneralPreferencePage.Commit_On_Close_2"), getFieldEditorParent()));
    final Button commitOnCloseBox = bfe.getCheckbox();

    /*
    final Button autoCommitBox = new Button(getFieldEditorParent(), SWT.CHECK);
    autoCommitBox.setText(Messages.getString("GeneralPreferencePage.AutoCommit_1")); //$NON-NLS-1$
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalAlignment = GridData.BEGINNING;
    gd.horizontalSpan = 2;
    autoCommitBox.setLayoutData(gd);
    addAccessor(new CheckBoxAccessor(IConstants.AUTO_COMMIT, autoCommitBox));
            
            
    final Button commitOnCloseBox = new Button(getFieldEditorParent(), SWT.CHECK);
    commitOnCloseBox.setText(Messages.getString("GeneralPreferencePage.Commit_On_Close_2")); //$NON-NLS-1$
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalAlignment = GridData.BEGINNING;
    gd.horizontalSpan = 2;
    commitOnCloseBox.setLayoutData(gd);
    addAccessor(new CheckBoxAccessor(IConstants.COMMIT_ON_CLOSE, commitOnCloseBox));
    */

    autoCommitBox.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            if (autoCommitBox.getSelection())
                commitOnCloseBox.setEnabled(false);
            else
                commitOnCloseBox.setEnabled(true);
        }
    });
    commitOnCloseBox.setEnabled(!autoCommitBox.getSelection());

    addField(new BooleanFieldEditor(IConstants.SQL_ASSIST, Messages.getString(
            "GeneralPreferencePage.Tables_and_columns_auto-completing_assistance._Use_only_with_fast_database_connections_1"),
            getFieldEditorParent()));

    sEdit = new StringFieldEditor(IConstants.SQL_QRY_DELIMITER,
            Messages.getString("Preferences.SQLExplorer.QueryDelimiter"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(false);
    sEdit.setTextLimit(1);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.QueryDelimiter.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null || sEdit.getStringValue().length() == 0)
        sEdit.loadDefault();

    sEdit = new StringFieldEditor(IConstants.SQL_ALT_QRY_DELIMITER,
            Messages.getString("Preferences.SQLExplorer.AltQueryDelimiter"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(true);
    sEdit.setTextLimit(4);
    addField(sEdit);

    sEdit = new StringFieldEditor(IConstants.SQL_COMMENT_DELIMITER,
            Messages.getString("Preferences.SQLExplorer.CommentDelimiter"), getFieldEditorParent());
    sEdit.setEmptyStringAllowed(false);
    sEdit.setTextLimit(4);
    sEdit.setErrorMessage(Messages.getString("Preferences.SQLExplorer.CommentDelimiter.Error"));
    addField(sEdit);
    if (sEdit.getStringValue() == null || sEdit.getStringValue().length() == 0)
        sEdit.loadDefault();

    addField(new BooleanFieldEditor(IConstants.WORD_WRAP,
            Messages.getString("Preferences.SQLExplorer.WordWrap"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.AUTO_OPEN_EDITOR,
            Messages.getString("Preferences.SQLExplorer.OpenEditorOnConnection"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.CLEAR_RESULTS_ON_EXECUTE,
            Messages.getString("Preferences.SQLExplorer.ClearResultsOnExecute"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.USE_LONG_CAPTIONS_ON_RESULTS,
            Messages.getString("Preferences.SQLExplorer.UseLongCaptionsOnResults"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.STOP_ON_ERROR,
            Messages.getString("Preferences.SQLExplorer.StopOnError"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.LOG_SUCCESS_MESSAGES,
            Messages.getString("Preferences.SQLExplorer.LogSuccessMessages"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.REQUIRE_SAVE_ON_CLOSE_EDITOR,
            Messages.getString("Preferences.SQLExplorer.RequireSaveOnClose"), getFieldEditorParent()));
    addField(new BooleanFieldEditor(IConstants.ENABLE_STRUCTURED_COMMENTS,
            Messages.getString("Preferences.SQLExplorer.EnableStructuredComments"), getFieldEditorParent()));

    final String[][] DEBUG_LEVEL_VALUES = new String[][] {
            { Messages.getString("Preferences.SQLExplorer.DebugLevelOff"), IConstants.QUERY_DEBUG_OFF },
            { Messages.getString("Preferences.SQLExplorer.DebugLevelFailed"), IConstants.QUERY_DEBUG_FAILED },
            { Messages.getString("Preferences.SQLExplorer.DebugLevelAll"), IConstants.QUERY_DEBUG_ALL } };
    ComboFieldEditor combo = new ComboFieldEditor(IConstants.QUERY_DEBUG_LOG_LEVEL,
            Messages.getString("Preferences.SQLExplorer.QueryDebugLog"), DEBUG_LEVEL_VALUES,
            getFieldEditorParent());
    addField(combo);
}

From source file:org.fhsolution.eclipse.plugins.csvedit.customeditor.preferences.CSVPreferencePage.java

License:Apache 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.
 *
 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
 *//*w  w  w  .j a  va  2s  .  com*/
public void createFieldEditors() {

    String[][] pagesLabelsAndValues = new String[2][2];
    pagesLabelsAndValues[0][0] = "Table";
    pagesLabelsAndValues[0][1] = "0";
    pagesLabelsAndValues[1][0] = "Source";
    pagesLabelsAndValues[1][1] = "1";
    addField(new ComboFieldEditor(PreferenceConstants.DEFAULT_VIEW_PAGE,
            "Select the default tab to view csv file:", pagesLabelsAndValues, getFieldEditorParent()));

    addField(new BooleanFieldEditor(PreferenceConstants.USE_FIRST_LINE_AS_HEADER,
            "&Use the first line of the CSV file as the column headers", getFieldEditorParent()));

    StringFieldEditor customDelimiterField = new StringFieldEditor(PreferenceConstants.CUSTOM_DELIMITER,
            "Choose the delimiter to use:", 2, getFieldEditorParent());
    customDelimiterField.setTextLimit(1);
    customDelimiterField.setEmptyStringAllowed(false);
    addField(customDelimiterField);

    StringFieldEditor textQualifierChar = new StringFieldEditor(PreferenceConstants.TEXT_QUALIFIER,
            "Define the character used as a text qualifier of the data:", 2, getFieldEditorParent());
    customDelimiterField.setTextLimit(1);
    customDelimiterField.setEmptyStringAllowed(false);
    addField(textQualifierChar);
    addField(new BooleanFieldEditor(PreferenceConstants.USE_QUALIFIER,
            "For the text qualifier to be used for all fields", getFieldEditorParent()));

    StringFieldEditor commentChar = new StringFieldEditor(PreferenceConstants.COMMENT_CHAR,
            "Choose the character to use as a comment:", 2, getFieldEditorParent());
    customDelimiterField.setTextLimit(1);
    customDelimiterField.setEmptyStringAllowed(true);
    addField(commentChar);

    addField(new BooleanFieldEditor(PreferenceConstants.CASE_SENSITIVE_SEARCH, "&make filtering case sensitive",
            getFieldEditorParent()));

}