List of usage examples for org.eclipse.jface.preference StringFieldEditor StringFieldEditor
public StringFieldEditor(String name, String labelText, Composite parent)
From source file:net.sf.smbt.ui.ableton.preferences.AbletonLivePreferencePage.java
License:LGPL
/** * 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 va 2 s . co m*/ */ public void createFieldEditors() { addField(new IntegerFieldEditor(PreferenceConstants.P_ABLETON_INPUT_PORT, "Ableton Input Port:", getFieldEditorParent())); addField(new StringFieldEditor(PreferenceConstants.P_ABLETON_IP_ADDRESS, "Ableton IP Address:", getFieldEditorParent())); addField(new IntegerFieldEditor(PreferenceConstants.P_ABLETON_OUTPUT_PORT, "Ableton Output Port:", getFieldEditorParent())); }
From source file:net.sf.smbt.ui.btc.prefs.BlockchainWalletPreferencePage.java
License:LGPL
public void createFieldEditors() { addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_WALLET_ADDR_KEY, "Wallet :", getFieldEditorParent()));/*from w ww .j av a 2 s. com*/ addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_USER_KEY, "User :", getFieldEditorParent())); addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_PASSWORD_KEY, "Password :", getFieldEditorParent())); addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_CONNECT_KEY, "Connect :", getFieldEditorParent())); addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_PORT_KEY, "Port :", getFieldEditorParent())); addField(new StringFieldEditor(BlockchainWalletPreferenceConstants.P_BLOCKCHAIN_SSL_KEY, "SSL :", getFieldEditorParent())); }
From source file:net.sf.smbt.ui.btc.prefs.MtGoxWalletPreferencePage.java
License:LGPL
public void createFieldEditors() { addField(new StringFieldEditor(MtGoxWalletPreferenceConstants.P_MTGOX_API_KEY, "API Key :", getFieldEditorParent()));/*from ww w. j a v a 2 s . co m*/ addField(new StringFieldEditor(MtGoxWalletPreferenceConstants.P_MTGOX_SECRET_KEY, "Secret Key :", getFieldEditorParent())); }
From source file:net.sf.smbt.ui.lemur.ui.prefs.JZMUIPreferencePage.java
License:LGPL
/** * 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 a2 s .com*/ */ public void createFieldEditors() { fieldEditorOSC0 = new StringFieldEditor(LemurPreferences.LEMUR_OSC0_TARGET_PREF.getLiteral(), "Target OSC0:", getFieldEditorParent()); fieldEditorOSC0Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC0_PORT_IN_PREF.getLiteral(), "Ports In OSC0:", getFieldEditorParent()); fieldEditorOSC1 = new StringFieldEditor(LemurPreferences.LEMUR_OSC1_TARGET_PREF.getLiteral(), "Target OSC1:", getFieldEditorParent()); fieldEditorOSC1Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC1_PORT_IN_PREF.getLiteral(), "Ports In OSC1:", getFieldEditorParent()); fieldEditorOSC2 = new StringFieldEditor(LemurPreferences.LEMUR_OSC2_TARGET_PREF.getLiteral(), "Target OSC2:", getFieldEditorParent()); fieldEditorOSC2Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC2_PORT_IN_PREF.getLiteral(), "Ports In OSC2:", getFieldEditorParent()); fieldEditorOSC3 = new StringFieldEditor(LemurPreferences.LEMUR_OSC3_TARGET_PREF.getLiteral(), "Target OSC3:", getFieldEditorParent()); fieldEditorOSC3Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC3_PORT_IN_PREF.getLiteral(), "Ports In OSC3:", getFieldEditorParent()); fieldEditorOSC4 = new StringFieldEditor(LemurPreferences.LEMUR_OSC4_TARGET_PREF.getLiteral(), "Target OSC4:", getFieldEditorParent()); fieldEditorOSC4Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC4_PORT_IN_PREF.getLiteral(), "Ports In OSC4:", getFieldEditorParent()); fieldEditorOSC5 = new StringFieldEditor(LemurPreferences.LEMUR_OSC5_TARGET_PREF.getLiteral(), "Target OSC5:", getFieldEditorParent()); fieldEditorOSC5Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC5_PORT_IN_PREF.getLiteral(), "Ports In OSC5:", getFieldEditorParent()); fieldEditorOSC6 = new StringFieldEditor(LemurPreferences.LEMUR_OSC6_TARGET_PREF.getLiteral(), "Target OSC6:", getFieldEditorParent()); fieldEditorOSC6Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC6_PORT_IN_PREF.getLiteral(), "Ports In OSC6:", getFieldEditorParent()); fieldEditorOSC7 = new StringFieldEditor(LemurPreferences.LEMUR_OSC7_TARGET_PREF.getLiteral(), "Target OSC7:", getFieldEditorParent()); fieldEditorOSC7Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC7_PORT_IN_PREF.getLiteral(), "Ports In OSC7:", getFieldEditorParent()); fieldEditorOSC8 = new StringFieldEditor(LemurPreferences.LEMUR_OSC8_TARGET_PREF.getLiteral(), "Target OSC8:", getFieldEditorParent()); fieldEditorOSC8Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC8_PORT_IN_PREF.getLiteral(), "Ports In OSC8:", getFieldEditorParent()); fieldEditorOSC9 = new StringFieldEditor(LemurPreferences.LEMUR_OSC9_TARGET_PREF.getLiteral(), "Target OSC9:", getFieldEditorParent()); fieldEditorOSC9Ports = new IntegerFieldEditor(LemurIncomingPorts.LEMUR_OSC9_PORT_IN_PREF.getLiteral(), "Ports In OSC9:", getFieldEditorParent()); addField(fieldEditorOSC0); addField(fieldEditorOSC0Ports); addField(fieldEditorOSC1); addField(fieldEditorOSC1Ports); addField(fieldEditorOSC2); addField(fieldEditorOSC2Ports); addField(fieldEditorOSC3); addField(fieldEditorOSC3Ports); addField(fieldEditorOSC4); addField(fieldEditorOSC4Ports); addField(fieldEditorOSC5); addField(fieldEditorOSC5Ports); addField(fieldEditorOSC6); addField(fieldEditorOSC6Ports); addField(fieldEditorOSC7); addField(fieldEditorOSC7Ports); addField(fieldEditorOSC8); addField(fieldEditorOSC8Ports); addField(fieldEditorOSC9); addField(fieldEditorOSC9Ports); IPreferenceStore prefs = getPreferenceStore(); fieldEditorOSC0.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC0_TARGET_PREF.getLiteral())); fieldEditorOSC0Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC0_PORT_IN_PREF.getLiteral())); fieldEditorOSC1.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC1_TARGET_PREF.getLiteral())); fieldEditorOSC1Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC1_PORT_IN_PREF.getLiteral())); fieldEditorOSC2.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC2_TARGET_PREF.getLiteral())); fieldEditorOSC2Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC2_PORT_IN_PREF.getLiteral())); fieldEditorOSC3.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC3_TARGET_PREF.getLiteral())); fieldEditorOSC3Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC3_PORT_IN_PREF.getLiteral())); fieldEditorOSC4.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC4_TARGET_PREF.getLiteral())); fieldEditorOSC4Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC4_PORT_IN_PREF.getLiteral())); fieldEditorOSC5.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC5_TARGET_PREF.getLiteral())); fieldEditorOSC5Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC5_PORT_IN_PREF.getLiteral())); fieldEditorOSC6.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC6_TARGET_PREF.getLiteral())); fieldEditorOSC6Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC6_PORT_IN_PREF.getLiteral())); fieldEditorOSC7.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC7_TARGET_PREF.getLiteral())); fieldEditorOSC7Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC7_PORT_IN_PREF.getLiteral())); fieldEditorOSC8.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC8_TARGET_PREF.getLiteral())); fieldEditorOSC8Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC8_PORT_IN_PREF.getLiteral())); fieldEditorOSC9.setStringValue(prefs.getString(LemurPreferences.LEMUR_OSC9_TARGET_PREF.getLiteral())); fieldEditorOSC9Ports .setStringValue(prefs.getString(LemurIncomingPorts.LEMUR_OSC9_PORT_IN_PREF.getLiteral())); }
From source file:net.sf.webcat.eclipse.cxxtest.preferences.CxxTestPreferencePage.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 a 2 s .com*/ public void createFieldEditors() { addField(new StringFieldEditor(CxxTestPlugin.CXXTEST_PREF_DRIVER_FILENAME, Messages.CxxTestPreferencePage_GeneratedDriverFileName, getFieldEditorParent())); // TODO: re-enable this later by using conditional code to include // Dereferee in the test runner. // addField(new BooleanFieldEditor(CxxTestPlugin.CXXTEST_PREF_TRACK_HEAP, // Messages.CxxTestPreferencePage_EnableBasicHeapChecking, getFieldEditorParent())); addField(new BooleanFieldEditor(CxxTestPlugin.CXXTEST_PREF_TRAP_SIGNALS, Messages.CxxTestPreferencePage_TrapSignals, getFieldEditorParent())); final CancelableBooleanFieldEditor editor; editor = new CancelableBooleanFieldEditor(CxxTestPlugin.CXXTEST_PREF_TRACE_STACK, Messages.CxxTestPreferencePage_GenerateStackTraces, getFieldEditorParent()); editor.setCancelableListener(new ICancelableBooleanListener() { public boolean shouldDenyChange(boolean newValue) { if (newValue == true) { boolean found = checkForRequiredLibraries(); if (!found) { return true; } } return false; } }); addField(editor); }
From source file:net.sourceforge.eclipseccase.ui.preferences.ClearCasePreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { // general settings addField(new StringFieldEditor(CLEARCASE_PRIMARY_GROUP, PreferenceMessages.getString("Preferences.General.ClearCasePrimaryGroup"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); addField(new BooleanFieldEditor(PREVENT_UNNEEDED_CHILDREN_REFRESH, PreferenceMessages.getString("Preferences.General.RefreshChildren"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); // addField(new BooleanFieldEditor(IGNORE_NEW, PreferenceMessages.getString("Preferences.General.IgnoreNew"), //$NON-NLS-1$ // getFieldEditorParent(GENERAL))); addField(new BooleanFieldEditor(HIDE_REFRESH_STATE_ACTIVITY, PreferenceMessages.getString("Preferences.General.HideRefreshStateActivity"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); // addField(new BooleanFieldEditor(RECURSIVE, PreferenceMessages.getString("Preferences.General.Recursive"), //$NON-NLS-1$ // getFieldEditorParent(GENERAL))); // addField(new BooleanFieldEditor(PRESERVE_TIMES, PreferenceMessages.getString("Preferences.General.PreserveTimes"), //$NON-NLS-1$ // getFieldEditorParent(GENERAL))); // addField(new BooleanFieldEditor(TEST_LINKED_PARENT_IN_CLEARCASE, PreferenceMessages.getString("Preferences.General.TestLinkedParentInClearCase"), //$NON-NLS-1$ // getFieldEditorParent(GENERAL))); // addField(new RadioGroupFieldEditor(SAVE_DIRTY_EDITORS, PreferenceMessages.getString("Preferences.General.SaveDirtyEditors"), 1, //$NON-NLS-1$ // ALWAYS_NEVER_PROMPT, getFieldEditorParent(GENERAL), true)); addField(new BooleanFieldEditor(USE_CLEARDLG, PreferenceMessages.getString("Preferences.Source.ClearDlg"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); addField(new BooleanFieldEditor(FULL_REFRESH, PreferenceMessages.getString("Preferences.Source.FullRefreshOnAssoc"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); addField(new RadioGroupFieldEditor(JOB_QUEUE_PRIORITY, PreferenceMessages.getString("Preferences.General.JobQueuePriority"), 1, //$NON-NLS-1$ PRIORITIES, getFieldEditorParent(GENERAL), true)); // general settings addField(new StringFieldEditor(TIMEOUT_GRAPHICAL_TOOLS, PreferenceMessages.getString("Preferences.General.GraphicalTimeout"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); addField(new BooleanFieldEditor(GRAPHICAL_EXTERNAL_UPDATE_VIEW, PreferenceMessages.getString("Preferences.General.GraphicalUpdateView"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); addField(new BooleanFieldEditor(FORBID_CONFIG_SPEC_MODIFICATION, PreferenceMessages.getString("Preferences.General.ModifyConfigSpec"), //$NON-NLS-1$ getFieldEditorParent(GENERAL))); // addField(new BooleanFieldEditor(COMPARE_EXTERNAL, PreferenceMessages.getString("Preferences.General.CompareWithExternalTool"), //$NON-NLS-1$ // getFieldEditorParent(GENERAL))); // RadioGroupFieldEditor clearcaseLayer = new // RadioGroupFieldEditor(CLEARCASE_API, // "Interface for ClearCase operations",1, // new String[][]{ // {"Native - CAL (ClearCase Automation Library)", CLEARCASE_NATIVE}, // {"Native - cleartool executable", CLEARCASE_CLEARTOOL}, // {"Compatible - ClearDlg executable", CLEARCASE_CLEARDLG} // }/*www .j a v a 2s. c o m*/ // ,getFieldEditorParent(GENERAL),true); // addField(clearcaseLayer); // source management // addField(new BooleanFieldEditor(CHECKOUT_AUTO, PreferenceMessages // .getString("Preferences.Source.CheckoutAuto"), //$NON-NLS-1$ // getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new RadioGroupFieldEditor(CHECKOUT_AUTO, PreferenceMessages.getString("Preferences.Source.CheckoutAuto"), //$NON-NLS-1$ 3, ALWAYS_NEVER_PROMPT, getFieldEditorParent(SOURCE_MANAGEMENT), true)); addField(new BooleanFieldEditor(AUTO_PARENT_CHECKIN_AFTER_MOVE, PreferenceMessages.getString("Preferences.Source.AutoParentCheckinAfterMove"), getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new BooleanFieldEditor(CHECKIN_IDENTICAL, PreferenceMessages.getString("Preferences.Source.CheckinIdentical"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new BooleanFieldEditor(KEEP_CHANGES_AFTER_UNCHECKOUT, PreferenceMessages.getString("Preferences.Source.KeepChangesAfterUncheckout"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new BooleanFieldEditor(ADD_WITH_CHECKIN, PreferenceMessages.getString("Preferences.Source.AddWithCheckin"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new BooleanFieldEditor(CHECKOUT_LATEST, PreferenceMessages.getString("Preferences.Source.CheckoutLatest"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); // addField(new RadioGroupFieldEditor(IClearCasePreferenceConstants.CHECKOUT_RESERVED, PreferenceMessages.getString("Preferences.Source.CheckoutReserved"), 4, //$NON-NLS-1$ // ALWAYS_IF_POSSIBLE_NEVER, getFieldEditorParent(SOURCE_MANAGEMENT), true)); // // addField(new BooleanFieldEditor(ADD_WITH_MASTER, PreferenceMessages.getString("Preferences.Source.AddWithMaster"), //$NON-NLS-1$ // getFieldEditorParent(SOURCE_MANAGEMENT))); reservedCo = new RadioGroupFieldEditor(IClearCasePreferenceConstants.CHECKOUT_RESERVED, PreferenceMessages.getString("Preferences.Source.CheckoutReserved"), 4, //$NON-NLS-1$ ALWAYS_IF_POSSIBLE_NEVER, getFieldEditorParent(SOURCE_MANAGEMENT), true); addField(reservedCo); // Avoid that -nmaster is set when RESERVED checkouts are used. // nMaster = new BooleanFieldEditor(ADD_WITH_MASTER, PreferenceMessages.getString("Preferences.Source.AddWithMaster"), //$NON-NLS-1$ // getFieldEditorParent(SOURCE_MANAGEMENT)); nMaster = new BooleanFieldEditor(ADD_WITH_MASTER, PreferenceMessages.getString("Preferences.Source.AddWithMaster"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT)) { protected void valueChanged(boolean oldValue, boolean newValue) { setReservedCheckoutEnabledState(oldValue, newValue); } }; addField(nMaster); // comment settings addField(new BooleanFieldEditor(SILENT_PREVENT, PreferenceMessages.getString("Preferences.Source.SilentPrevent"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); addField(new StringFieldEditor(PREVENT_CHECKOUT, PreferenceMessages.getString("Preferences.Source.PreventCheckOut"), //$NON-NLS-1$ getFieldEditorParent(SOURCE_MANAGEMENT))); // comment settings addField( new BooleanFieldEditor(COMMENT_ADD, PreferenceMessages.getString("Preferences.Comments.CommentAdd"), //$NON-NLS-1$ getFieldEditorParent(COMMENTS))); addField(new BooleanFieldEditor(COMMENT_CHECKIN, PreferenceMessages.getString("Preferences.Comments.CommentCheckin"), //$NON-NLS-1$ getFieldEditorParent(COMMENTS))); addField(new BooleanFieldEditor(COMMENT_CHECKOUT, PreferenceMessages.getString("Preferences.Comments.CommentCheckout"), //$NON-NLS-1$ getFieldEditorParent(COMMENTS))); addField(new BooleanFieldEditor(COMMENT_CHECKOUT_NEVER_ON_AUTO, PreferenceMessages.getString("Preferences.Comments.CommentCheckoutNeverOnAuto"), //$NON-NLS-1$ getFieldEditorParent(COMMENTS))); addField(new StringFieldEditor(BRANCH_PREFIX, PreferenceMessages.getString("Preferences.Comments.BranchPrefix"), //$NON-NLS-1$ getFieldEditorParent(COMMENTS))); // addField(new BooleanFieldEditor(COMMENT_ADD_NEVER_ON_AUTO, PreferenceMessages.getString("Preferences.Comments.CommentAddNeverOnAuto"), //$NON-NLS-1$ // getFieldEditorParent(COMMENTS))); // addField(new BooleanFieldEditor(COMMENT_ESCAPE, PreferenceMessages.getString("Preferences.Comments.CommentEscapeXml"), //$NON-NLS-1$ // getFieldEditorParent(COMMENTS))); }
From source file:net.sourceforge.sqlexplorer.preferences.GeneralPreferencePage.java
License:Open Source License
protected void createFieldEditors() { IntegerFieldEditor iEdit;// w ww. j a v a2 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() { 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:net.sourceforge.texlipse.spelling.SpellCheckerPreferencePage.java
License:Open Source License
/** * Creates the property editing UI components of this page. *///from ww w . j av a 2 s . c o m protected void createFieldEditors() { TexlipsePreferencePage.addSpacer(3, getFieldEditorParent()); final Group group = new Group(getFieldEditorParent(), SWT.NONE); group.setText(TexlipsePlugin.getResourceString("preferenceSpellBuildIn")); group.setLayout(new GridLayout()); GridData layData = new GridData(SWT.FILL, SWT.NONE, true, true); layData.horizontalSpan = 3; group.setLayoutData(layData); TexlipsePreferencePage.addSpacer(1, group); BooleanFieldEditor buildInSpell = new BooleanFieldEditor(TexlipseProperties.ECLIPSE_BUILDIN_SPELLCHECKER, TexlipsePlugin.getResourceString("preferenceSpellUseBuildIn"), group) { protected void valueChanged(boolean oldValue, boolean newValue) { super.valueChanged(oldValue, newValue); customDictDir.setEnabled(newValue, group); dictDir.setEnabled(newValue, group); } }; BooleanFieldEditor ignoreComments = new BooleanFieldEditor(TexlipseProperties.SPELLCHECKER_IGNORE_COMMENTS, TexlipsePlugin.getResourceString("preferenceSpellIgnoreComments"), group); BooleanFieldEditor ignoreMixedCase = new BooleanFieldEditor( TexlipseProperties.SPELLCHECKER_IGNORE_MIXED_CASE, TexlipsePlugin.getResourceString("preferenceSpellIgnoreMixedCase"), group); addField(ignoreMixedCase); // BooleanFieldEditor ignoreMath = new BooleanFieldEditor(TexlipseProperties.SPELLCHECKER_IGNORE_MATH, // TexlipsePlugin.getResourceString("preferenceSpellIgnoreMath") , group); // addField(ignoreMath); TexlipsePreferencePage.addSpacer(3, group); dictDir = new DirectoryFieldEditor(TexlipseProperties.SPELLCHECKER_DICT_DIR, TexlipsePlugin.getResourceString("preferenceSpellDictDir"), group); dictDir.setEnabled(TexlipsePlugin.getDefault().getPreferenceStore() .getBoolean(TexlipseProperties.ECLIPSE_BUILDIN_SPELLCHECKER), group); customDictDir = new DirectoryFieldEditor(TexlipseProperties.SPELLCHECKER_CUSTOM_DICT_DIR, TexlipsePlugin.getResourceString("preferenceSpellCustomDict"), group); customDictDir.setEnabled(TexlipsePlugin.getDefault().getPreferenceStore() .getBoolean(TexlipseProperties.ECLIPSE_BUILDIN_SPELLCHECKER), group); addField(buildInSpell); addField(dictDir); addField(customDictDir); addField(ignoreComments); TexlipsePreferencePage.addSpacer(3, group); //Construct Aspell preferences group final Group aspellGroup = new Group(getFieldEditorParent(), SWT.NONE); aspellGroup.setText(TexlipsePlugin.getResourceString("preferenceSpellAspell")); aspellGroup.setLayout(new GridLayout()); GridData aspellLayData = new GridData(SWT.FILL, SWT.NONE, true, true); aspellLayData.horizontalSpan = 3; aspellGroup.setLayoutData(aspellLayData); TexlipsePreferencePage.addSpacer(3, aspellGroup); addField(new FileFieldEditor(SpellChecker.SPELL_CHECKER_COMMAND, TexlipsePlugin.getResourceString("preferenceSpellCommandLabel"), aspellGroup)); //FIXME: Looks ugly but I have no clue how to get it in one row Composite c = new Composite(aspellGroup, SWT.NONE); c.setLayout(new GridLayout(3, false)); GridData layData2 = new GridData(); layData2.horizontalSpan = 2; c.setLayoutData(layData2); addField(new StringFieldEditor(SpellChecker.SPELL_CHECKER_ARGUMENTS, TexlipsePlugin.getResourceString("preferenceSpellArgumentsLabel"), c)); }
From source file:net.sourceforge.veditor.preference.AbstractSimplePreferencePage.java
License:Open Source License
protected void addStringField(String name, String label) { addField(new StringFieldEditor(name, label, getFieldEditorParent())); }
From source file:net.sourceforge.veditor.preference.TopPreferencePage.java
License:Open Source License
private void addCommandField(final String name, final String label) { final StringFieldEditor comp = new StringFieldEditor(name, label, getFieldEditorParent()); addField(comp);// ww w. j a v a 2 s. co m final Button button = new Button(getFieldEditorParent(), SWT.NONE); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { final StringVariableSelectionDialog dialog = new StringVariableSelectionDialog( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); dialog.open(); final String var = dialog.getVariableExpression(); comp.getTextControl(getFieldEditorParent()).insert(var); } }); button.setText("Variables..."); GridData data = new GridData(); data.horizontalSpan = 2; data.horizontalAlignment = SWT.END; button.setLayoutData(data); }