List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor
public StringFieldEditor(String name, String labelText, Composite parent)
From source file:net.openchrom.chromatogram.msd.processor.supplier.massshiftdetector.ui.preferences.PreferencePage.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 .com*/ public void createFieldEditors() { addField(new StringFieldEditor(PreferenceSupplier.P_FILTER_PATH_REFERENCE_CHROMATOGRAM, "Path Reference Chromatogram", getFieldEditorParent())); addField(new StringFieldEditor(PreferenceSupplier.P_FILTER_PATH_ISOTOPE_CHROMATOGRAM, "Path Istope Chromatogram", getFieldEditorParent())); }
From source file:net.openchrom.xxd.processor.supplier.rscripting.ui.preferences.RServePrefs.java
License:Open Source License
public void createFieldEditors() { addField(new SpacerFieldEditor(getFieldEditorParent())); addField(new DirectoryFieldEditor(PreferenceConstants.P_TEMP_R, "Path to temporary R Folder", getFieldEditorParent()));//from w ww . ja v a 2 s . co m addField(new BooleanFieldEditor("RSERVE_NATIVE_START", "Start Rserve in native R", getFieldEditorParent())); addField(new BooleanFieldEditor("RSERVE_AUTOSTART", "Start Rserve automatically after Plugin start (Not available in native mode connection!)", getFieldEditorParent())); addField(new BooleanFieldEditor(PreferenceConstants.P_BOOLEAN, "Install path at startup", getFieldEditorParent())); addField(new BooleanFieldEditor(PreferenceConstants.R_START_SHELL, "Start with shell", getFieldEditorParent())); selectLinuxShell = new RadioGroupFieldEditor("LINUX_SHELL", "Select Shell (Linux, Mac):", 2, new String[][] { { "xterm (Linux, Mac)", "XTERM" }, { "Gnome (Linux)", "GNOME" } }, getFieldEditorParent(), false); addField(selectLinuxShell); // addField(new SpacerFieldEditor(getFieldEditorParent())); addField(new StringFieldEditor("RSERVE_ARGS", "Rserve startup arguments", getFieldEditorParent())); addField(new MultiLineTextFieldEditor("R_STARTUP_ARGS", "R startup commands", -1, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent())); addField(new SpacerFieldEditor(getFieldEditorParent())); /* * addField(new LabelFieldEditor("Plot:", getFieldEditorParent())); * addField(new BooleanFieldEditor("USE_CUSTOM_DEVICE", "Use Custom Device", BooleanFieldEditor.DEFAULT, getFieldEditorParent())); * selectionDevice=new RadioGroupFieldEditor("PLOT_DEVICE_SELECTION", "Select Device:\nPlease use action \"Apply \" to see changes and after using action \"Restore Defaults\".\nValues in the Device Definition can be changed and will be stored!", 3, new String[][] { { "Image Default", "PLOT_IMAGE" },{ "Image Cairo", "PLOT_CAIRO" },{ "Image Print", "PLOT_PRINT" }, { "PDF", "PLOT_PDF" },{ "SVG", "PLOT_SVG" },{ "PostScript", "PLOT_POSTSCRIPT" } }, getFieldEditorParent(), false); * addField(selectionDevice); * //addField(new StringFieldEditor("DEVICE_DEFINITION", "Device Definiton", -1, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent())); * mult=new MultiLineTextFieldEditor("DEVICE_DEFINITION", "Device Definiton", -1, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent()); * addField(mult); * deviceFilename=new StringFieldEditor("DEVICE_FILENAME", "Filename", -1, StringFieldEditor.VALIDATE_ON_KEY_STROKE, getFieldEditorParent()); * addField(deviceFilename); * deviceFilename.setEnabled(false, getFieldEditorParent()); * selectPDFReader=new RadioGroupFieldEditor("PDF_READER", "PDF Reader (Linux):", 4, new String[][] { { "Acrobat", "ACROBAT" },{ "Evince", "EVINCE" },{ "Kpdf", "KPDF" },{ "Xpdf", "XPDF" } }, getFieldEditorParent(), false); * addField(selectPDFReader); * addField(new SpacerFieldEditor(getFieldEditorParent())); */ addField(new LabelFieldEditor("Packages:", getFieldEditorParent())); PackageServer = new StringFieldEditor(PreferenceConstants.PACKAGE_R_SERVER, "Package Server", getFieldEditorParent()); PackageServer.setErrorMessage("Please enter a valid address!"); PackageServer.setEmptyStringAllowed(false); PackageServer.setStringValue("http://cran.r-project.org"); addField(PackageServer); { Composite fieldEditorParent = getFieldEditorParent(); final ComboFieldEditor comboFieldEditor = new ComboFieldEditor("Server", "Select Server", new String[][] { new String[] { "", "" } }, fieldEditorParent); final Combo combo = comboFieldEditor.getComboBoxControl(fieldEditorParent); combo.addSelectionListener(new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { PackageServer.setStringValue(webAdresses[combo.getSelectionIndex()]); } }); combo.setItems(new String[] { "Argentina", "Australia", "Austria", "Belgium", "Brazil (PR)", "Brazil (RJ)", "Brazil (SP 1)", "Brazil (SP 2)", "Canada (BC)", "Canada (ON)", "Chile (Santiago)", "Croatia", "Czech Republic", "Denmark", "France (Toulouse)", "France (Paris)", "Germany (Goettingen)", "Germany (Muenchen)", "India", "Ireland", "Italy (Milano)", "Italy (Padua)", "Italy (Palermo)", "Japan (Aizu)", "Japan (Tokyo)", "Japan (Tsukuba)", "Korea", "Mexico", "Netherlands (Amsterdam 2)", "Netherlands (Amsterdam)", "Netherlands (Utrecht)", "New Zealand", "Norway", "Poland (Oswiecim)", "Poland (Wroclaw)", "Portugal", "Slovenia (Ljubljana)", "South Africa", "Spain (Madrid)", "Sweden", "Switzerland (Zuerich)", "Switzerland (Bern)", "Taiwan (Taichung)", "Taiwan (Taipeh)", "Thailand", "UK (Bristol)", "USA (CA 1)", "USA (CA 3)", "USA (IA)", "USA (MI)", "USA (MO)", "USA (NC)", "USA (PA 2)", "USA (PA)", "USA (WA)" }); combo.select(1); addField(comboFieldEditor); } { addField(new DirectoryFieldEditor("InstallLocation", "Package install location", getFieldEditorParent())); addField(new SpacerFieldEditor(getFieldEditorParent())); addField(new LabelFieldEditor("Rserve Remote:", getFieldEditorParent())); addField(new BooleanFieldEditor("REMOTE", "Remote enabled", getFieldEditorParent())); addField(new StringFieldEditor("HOST", "Host name/IP", getFieldEditorParent())); addField(new IntegerFieldEditor("TCP", "TCP port", getFieldEditorParent())); addField(new StringFieldEditor("USERNAME", "Username", getFieldEditorParent())); StringFieldEditor sf = new StringFieldEditor("PASSWORD", "Password", getFieldEditorParent()); sf.getTextControl(getFieldEditorParent()).setEchoChar('*'); addField(sf); } addField(new SpacerFieldEditor(getFieldEditorParent())); { addField(new LabelFieldEditor("Transfer to Table options:", getFieldEditorParent())); addField(new BooleanFieldEditor("TRANSFER_METHOD", "Transfer with \"format\" to Table (default is method \"as.character\")", getFieldEditorParent())); final IntegerFieldEditor integerFieldEditor = new IntegerFieldEditor("DEFAULT_DIGITS", "Digits", getFieldEditorParent()); // integerFieldEditor.setErrorMessage("Please select an integer value!"); integerFieldEditor.setValidRange(1, 100); addField(integerFieldEditor); } addField(new SpacerFieldEditor(getFieldEditorParent())); { addField(new LabelFieldEditor("Sweave/TeX options:", getFieldEditorParent())); addField(new DirectoryFieldEditor("SweaveScriptLocation", "Sweave File Location", getFieldEditorParent())); addField(new DirectoryFieldEditor("pdfLatex", "pdflatex Path", getFieldEditorParent())); } addField(new SpacerFieldEditor(getFieldEditorParent())); }
From source file:net.refractions.udig.project.ui.internal.wizard.NewProjectWizardPage.java
License:Open Source License
/** * Set up this page for use./*from w w w.jav a 2s . c om*/ * * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) * @param parent */ public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); projectNameEditor = new StringFieldEditor("newproject.name", Messages.NewProjectWizardPage_label_projectName, composite) { protected boolean doCheckState() { return validate(); } }; projectNameEditor.setPage(this); projectNameEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); Text textControl = projectNameEditor.getTextControl(composite); GridData gd = new GridData(SWT.LEFT, SWT.NONE, false, false); gd.widthHint = 100; gd.horizontalSpan = 2; textControl.setLayoutData(gd); projectDirectoryEditor = new DirectoryFieldEditor("newproject.directory", Messages.NewProjectWizardPage_label_projectDir, composite) { protected boolean doCheckState() { return validate(); } }; projectDirectoryEditor.setPage(this); projectDirectoryEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE); projectDirectoryEditor.fillIntoGrid(composite, 3); String defaultProjectName = Messages.NewProjectWizardPage_default_name; final IPath homepath = Platform.getLocation(); String projectPath = new File(homepath.toString()).getAbsolutePath(); projectNameEditor.setStringValue(defaultProjectName); projectDirectoryEditor.setStringValue(projectPath); composite.pack(); setControl(composite); setPageComplete(true); }
From source file:net.sf.eclipse.tomcat.TomcatManagerAppPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { Group box = new Group(this.getFieldEditorParent(), SWT.NULL); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2;/*from ww w. j a v a 2 s . c om*/ box.setLayoutData(gd); box.setLayout(new GridLayout(1, true)); Label details = new Label(box, SWT.WRAP); details.setText(PREF_PAGE_MANAGER_BANNER); new Label(this.getFieldEditorParent(), SWT.NULL); new Label(this.getFieldEditorParent(), SWT.NULL); urlEditor = new StringFieldEditor(TomcatLauncherPlugin.TOMCAT_PREF_MANAGER_URL, PREF_PAGE_MANAGER_URL, getFieldEditorParent()); this.addField(urlEditor); new Label(this.getFieldEditorParent(), SWT.NULL); new Label(this.getFieldEditorParent(), SWT.NULL); userEditor = new StringFieldEditor(TomcatLauncherPlugin.TOMCAT_PREF_MANAGER_USER, PREF_PAGE_MANAGER_USER, getFieldEditorParent()); this.addField(userEditor); pwdEditor = new StringFieldEditor(TomcatLauncherPlugin.TOMCAT_PREF_MANAGER_PASSWORD, PREF_PAGE_MANAGER_PASSWORD, getFieldEditorParent()); this.addField(pwdEditor); new Label(this.getFieldEditorParent(), SWT.NULL); Button addUserBt = new Button(getFieldEditorParent(), SWT.PUSH); addUserBt.setText(PREF_PAGE_MANAGER_ADDUSER); addUserBt.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { addUserToTomcatUsers(); } }); }
From source file:net.sf.fjep.fatjar.preferences.FatJarPreferencePage.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 . j av a 2 s .co m */ public void createFieldEditors() { addField(new StringFieldEditor(P_JARNAME, "Jar-Name:", getFieldEditorParent())); addField(new BooleanFieldEditor(P_MERGEMANIFEST, "merge individual-sections of all MANIFEST.MF files", getFieldEditorParent())); addField(new BooleanFieldEditor(P_REMOVESIGNERS, "remove signer files (META-INF/*.SF)", getFieldEditorParent())); addField(new BooleanFieldEditor(P_SCMAUTOCHECKOUT, "automatically checkout files from version control like SubVersion, ClearCase...", getFieldEditorParent())); addField(new BooleanFieldEditor(P_ESCAPEUPPERCASE, "escape upper case letters in package and class-names to avoid conflicts with filesystems like NTFS ignoring case", getFieldEditorParent())); addField(new StringFieldEditor(P_CONFIGFILE, "Project Config File:", getFieldEditorParent())); }
From source file:net.sf.gted.editor.preferences.EditorPreferencePage.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 2 s . com @Override public void createFieldEditors() { RadioGroupFieldEditor orientationPref = new RadioGroupFieldEditor(PreferenceConstants.P_ORIENTATION, "Editor orientation", 2, new String[][] { { "&Horizontal", PreferenceConstants.P_ORIENTATION_HORIZONTAL }, { "&Vertical", PreferenceConstants.P_ORIENTATION_VERTICAL } }, this.getFieldEditorParent(), true); this.addField(orientationPref); RadioGroupFieldEditor editorPref = new RadioGroupFieldEditor(PreferenceConstants.P_EDITOR_VIEW, "Inital editor view", 2, new String[][] { { "&Rich user interface", PreferenceConstants.P_EDITOR_VIEW_UI }, { "&Source editor", PreferenceConstants.P_EDITOR_VIEW_SOURCE } }, this.getFieldEditorParent(), true); this.addField(editorPref); ComboFieldEditor untranslatedPref = new ComboFieldEditor(PreferenceConstants.P_UNTRANSLATED, "If PO file contains untranslated entries ", namesAndValues, this.getFieldEditorParent()); this.addField(untranslatedPref); ComboFieldEditor fuzzyPref = new ComboFieldEditor(PreferenceConstants.P_FUZZY, "If PO file contains fuzzy entries ", namesAndValues, this.getFieldEditorParent()); this.addField(fuzzyPref); StringFieldEditor sourceRefPrefixPref = new StringFieldEditor(PreferenceConstants.P_SOURCE_REFERENCE_PREFIX, "Source reference prefix\ne.g. src/main, (use forward slashes)", this.getFieldEditorParent()); sourceRefPrefixPref.setEmptyStringAllowed(true); this.addField(sourceRefPrefixPref); }
From source file:net.sf.jmoney.jdbcdatastore.PreferencePage.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 a v a2 s .c o m*/ */ @Override public void createFieldEditors() { /* TODO: Add support for these radio buttons so users do not * have to manually enter the values for known drivers. addField(new RadioGroupFieldEditor( "driverOption", "JDBC Driver Selection", 1, new String[][] { { "HSQLDB", "&HSQL driver for HSQL database" }, { "JTDS", "&JTDS driver for Microsoft SQL Server" }, { "Other", "&Other JDBC Driver" } }, getFieldEditorParent())); */ addField(new StringFieldEditor("driver", "Driver:", getFieldEditorParent())); addField(new StringFieldEditor("subProtocol", "Sub-Protocol:", getFieldEditorParent())); addField(new StringFieldEditor("subProtocolData", "Sub-Protocol Data:", getFieldEditorParent())); addField(new StringFieldEditor("user", "User:", getFieldEditorParent())); addField(new StringFieldEditor("password", "Password:", getFieldEditorParent())); addField(new BooleanFieldEditor("promptEachTime", "Always &prompt for connection details each open", getFieldEditorParent())); }
From source file:net.sf.jmoney.preferences.PreferencePage.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 @Override public void createFieldEditors() { addField(new DirectoryFieldEditor(P_PATH, "&Directory preference:", getFieldEditorParent())); //$NON-NLS-1$ addField(new BooleanFieldEditor("booleanPreference", //$NON-NLS-1$ "&An example of a boolean preference", //$NON-NLS-1$ getFieldEditorParent())); String dateOptions[] = VerySimpleDateFormat.DATE_PATTERNS; String dateOptions2[][] = new String[dateOptions.length][]; for (int i = 0; i < dateOptions.length; i++) { dateOptions2[i] = new String[] { dateOptions[i], dateOptions[i] }; } addField(new RadioGroupFieldEditor("dateFormat", //$NON-NLS-1$ "Date Format", //$NON-NLS-1$ 1, dateOptions2, getFieldEditorParent())); addField(new StringFieldEditor("stringPreference", "A &text preference:", getFieldEditorParent())); //$NON-NLS-1$ //$NON-NLS-2$ }
From source file:net.sf.savedirtyeditors.preferences.PluginPreferencePage.java
License:Open Source License
private FieldEditor createStringFieldEditor(final Composite spacingComposite, final String preferenceKey, final String labelText) { final FieldEditor editor = new StringFieldEditor(preferenceKey, labelText, spacingComposite); editor.setPreferenceStore(PluginActivator.getDefault().getPreferenceStore()); editor.setPage(this); editor.load();/* ww w. j av a2s .c o m*/ return editor; }
From source file:net.sf.simpletest.eclipse.preferences.SimpletestPreferencePage.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.// w w w . ja v a 2 s . co m */ public void createFieldEditors() { addField(new FileFieldEditor(PHP_PATH, "Php.exe File:", getFieldEditorParent())); addField(new FileFieldEditor(PHP_INI, "php.ini File:", getFieldEditorParent())); addField(new DirectoryFieldEditor(SIMPLETEST_PATH, "&Simpletest Path:", getFieldEditorParent())); addField(new FileFieldEditor(TEST_INCLFILE, "Include File for Tests (optional):", getFieldEditorParent())); addField(new StringFieldEditor(TEST_SUFFIX, "Test File Suffix:", getFieldEditorParent())); addField(new DirectoryFieldEditor(PHPUNIT_PATH, "&PHPUnit2 Path:", getFieldEditorParent())); /* addField(new DirectoryFieldEditor(PHPUNIT3_PATH, "&PHPUnit3 Path (Framework.php should be in the selected directory):", getFieldEditorParent())); */ }