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

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

Introduction

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

Prototype

public FileFieldEditor(String name, String labelText, boolean enforceAbsolute, Composite parent) 

Source Link

Document

Creates a file field editor.

Usage

From source file:com.embedthis.ejs.ide.preferences.EJSPreferencePage.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 v  a  2  s . c  o m
 */
public void createFieldEditors() {
    addField(new FileFieldEditor(PreferenceConstants.PATH_TO_EJS_COMPILER, "EJS Compiler location", true,
            getFieldEditorParent()));
}

From source file:com.github.caofangkun.bazelipse.preferences.BazelPreferencePage.java

License:Open Source License

public void createFieldEditors() {
    addField(new FileFieldEditor("BAZEL_PATH", "Path to the &Bazel binary:", true, getFieldEditorParent()));
}

From source file:com.google.devtools.depan.maven.eclipse.preferences.AnalysisPreferencesPage.java

License:Apache License

@Override
protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();

    FileFieldEditor executable = new FileFieldEditor(AnalysisPreferenceIds.MVN_ANALYSIS_EXECUTABLE,
            "Maven Executable", true, parent);
    executable.setEmptyStringAllowed(false);

    BooleanFieldEditor systemjava = new BooleanFieldEditor(AnalysisPreferenceIds.MVN_ANALYSIS_SYSTEMJAVA,
            "Use System JAVA_HOME", BooleanFieldEditor.SEPARATE_LABEL, parent);

    final DirectoryFieldEditor javahome = new DirectoryFieldEditor(AnalysisPreferenceIds.MVN_ANALYSIS_JAVAHOME,
            "JAVA_HOME", parent);

    StringFieldEditor effectivepom = new StringFieldEditor(AnalysisPreferenceIds.MVN_ANALYSIS_EFFECTIVEPOM,
            "Maven Effective POM command", parent);
    effectivepom.setEmptyStringAllowed(false);

    addField(executable);/* w  w w .j av a2 s  . c  o  m*/
    addField(systemjava);
    addField(javahome);
    addField(effectivepom);
}

From source file:gov.nasa.ensemble.core.activityDictionary.view.preferences.ActivityDictionaryPreferencePage.java

License:Open Source License

private void createActivityDictionaryFile(Composite parent) {
    Composite fileComp = new Composite(parent, SWT.None);
    activityDictionaryFile = new FileFieldEditor(ActivityDictionaryPreferences.ACTIVITY_DICTIONARY_LOCATION,
            "URL:", true, fileComp) {
        @Override//from w w  w .  j  a v  a2  s  .  com
        protected String changePressed() {
            String file = super.changePressed();
            if (file != null) {
                try {
                    file = URI.createFileURI(new File(file).getPath()).toFileString();
                } catch (Exception e) {
                    file = null;
                    trace.error(e);
                }
            }
            return file;
        }

        @Override
        protected boolean checkState() {
            String path = getTextControl().getText();
            if (path != null)
                path = path.trim();
            else
                path = "";//$NON-NLS-1$

            if (path.startsWith("file:"))
                return super.checkState();
            else
                return true; // if it is not a file, then not much validation we can do right now
        }
    };
    activityDictionaryFile.setFileExtensions(getDictionaryExtensions());
    activityDictionaryFile.setChangeButtonText("Select new AD");
    activityDictionaryFile.setPage(this);
    activityDictionaryFile.setPreferenceStore(getPreferenceStore());
    activityDictionaryFile.load();
    boolean enableChange = getPreferenceStore()
            .getBoolean(ActivityDictionaryPlugin.ACTIVITY_DICTIONARY_USER_CHANGE_PROPERTY);
    activityDictionaryFile.setEnabled(enableChange, fileComp);
    activityDictionaryFile.getTextControl(fileComp).addModifyListener(new FileModifyListener());
}

From source file:net.sourceforge.taggerplugin.preferences.TaggerPreferencePage.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 . j  a v  a  2s  .  com*/
 */
public void createFieldEditors() {
    addField(new BooleanFieldEditor(PreferenceConstants.CONFIRM_CLEAR_ASSOCIATIONS.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_ConfirmClear, getFieldEditorParent()));
    addField(new BooleanFieldEditor(PreferenceConstants.CONFIRM_DELETE_TAG.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_ConfirmDelete, getFieldEditorParent()));

    addField(new RadioGroupFieldEditor(PreferenceConstants.POSITION_LABEL_DECORATION.getKey(),
            TaggerMessages.TaggerPreferencePage_Label_LabelDecoration, 1,
            new String[][] {
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_TopRight,
                            String.valueOf(IDecoration.TOP_RIGHT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_TopLeft,
                            String.valueOf(IDecoration.TOP_LEFT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_BottomRight,
                            String.valueOf(IDecoration.BOTTOM_RIGHT) },
                    { TaggerMessages.TaggerPreferencePage_Label_LabelDecoration_BottomLeft,
                            String.valueOf(IDecoration.BOTTOM_LEFT) } },
            getFieldEditorParent()));

    //       FIXME: externalize
    addField(new FileFieldEditor(PreferenceConstants.TAGSET_FILE_LOCATION.getKey(), "TagSet Storage File:",
            true, getFieldEditorParent()));
}

From source file:org.axdt.common.preferences.fields.FileField.java

License:Open Source License

public FieldEditor createFieldEditor(Composite comp) {
    FileFieldEditor editor = new FileFieldEditor(key, desc, absolute, comp);
    editor.setFileExtensions(extensions);
    if ("".equals(defValue))
        editor.setEmptyStringAllowed(true);
    return editor;
}

From source file:org.lyllo.kickassplugin.ui.PreferencesCompiler.java

License:Open Source License

/**
 * {@inheritDoc}//from w ww. j  a v  a  2s. c o m
 */
protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();

    // Field for Compiler-Executable
    FileFieldEditor compiler = new FileFieldEditor(Constants.PREFERENCES_COMPILER_NAME,
            Messages.COMPILER_NAME + ": ", true, parent);
    compiler.setEmptyStringAllowed(false);
    compiler.setFileExtensions(new String[] { "*.jar" });

    addField(compiler);

    BooleanFieldEditor symbols = new BooleanFieldEditor(Constants.PREFERENCES_COMPILER_SYMBOLS,
            Messages.COMPILER_SYMBOLS, parent);
    addField(symbols);

    BooleanFieldEditor vicesymbols = new BooleanFieldEditor(Constants.PREFERENCES_COMPILER_VICESYMBOLS,
            Messages.COMPILER_VICESYMBOLS, parent);
    addField(vicesymbols);

    BooleanFieldEditor afo = new BooleanFieldEditor(Constants.PREFERENCES_COMPILER_AFO, Messages.COMPILER_AFO,
            parent);
    addField(afo);

    StringFieldEditor kickasscfg = new StringFieldEditor(Constants.PREFERENCES_LOCAL_CONFIG,
            Messages.COMPILER_LOCAL_CFG, parent);
    kickasscfg.setEmptyStringAllowed(true);
    addField(kickasscfg);

    PathEditor pathEditor = new PathEditor(Constants.PREFERENCES_COMPILER_LIBDIRS, Messages.COMPILER_LIBDIRS,
            Messages.COMPILER_LIBDIRS_CHOOSETEXT, parent);
    addField(pathEditor);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 3;

    Label label = new Label(parent, SWT.LEFT);
    label.setText(Messages.PARAMS_TEMPLATE_COMPILER);
    label.setLayoutData(gd);

    // Field for parameters to use Compiler-Executable
    MultiLineStringFieldEditor params = new MultiLineStringFieldEditor(Constants.PREFERENCES_COMPILER_PARAMS,
            Messages.PARAMS_NAME, parent);
    params.setErrorMessage("Invalid parameter. Must be in 'key=value' format.");

    addField(params);

}

From source file:org.lyllo.kickassplugin.ui.PreferencesDebugger.java

License:Open Source License

/**
 * {@inheritDoc}/*  w w w.j ava 2  s. c om*/
 */
protected void createFieldEditors() {
    Composite parent = getFieldEditorParent();

    // Field for Debugger-Executable
    FileFieldEditor linker = new FileFieldEditor(Constants.PREFERENCES_DEBUGGER_NAME,
            Messages.DEBUGGER_NAME + ": ", true, parent);
    addField(linker);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 3;

    Label label = new Label(parent, SWT.LEFT);
    label.setText(" \n" + Messages.PARAMS_TEMPLATE_DEBUGGER + "\n ");
    label.setLayoutData(gd);

    // Field for parameters to use Compiler-Executable
    MultiLineStringFieldEditor params = new MultiLineStringFieldEditor(Constants.PREFERENCES_DEBUGGER_PARAMS,
            Messages.PARAMS_NAME + ": ", parent) {

        @Override
        protected boolean doCheckState() {
            return true;
        }
    };
    addField(params);
}

From source file:org.mwc.cmap.core.preferences.ETOPOPrefsPage.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  . jav a  2  s  .c o m
 */
public void createFieldEditors() {
    addField(new FileFieldEditor(PreferenceConstants.ETOPO_FILE, "&ETOPO data file location:", true,
            getFieldEditorParent()));
}

From source file:org.openmaji.implementation.tool.eclipse.maji.MajiSystemPreferencePage.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.//w  w w  .  jav  a 2 s.com
 */

public void createFieldEditors() {
    addField(new FileFieldEditor(MAJI_LAUNCH_PROPERTIES, "Maji configuration file:", true,
            getFieldEditorParent()));
    addField(new FileFieldEditor(INTERMAJIK_LAUNCH_PROPERTIES, "Intermajik user keystore file:", true,
            getFieldEditorParent()));
}