List of usage examples for org.eclipse.jface.preference RadioGroupFieldEditor RadioGroupFieldEditor
public RadioGroupFieldEditor(String name, String labelText, int numColumns, String[][] labelAndValues, Composite parent, boolean useGroup)
From source file:au.gov.ga.earthsci.catalog.part.preferences.CatalogBrowserPreferencesPage.java
License:Apache License
@Override protected void createFieldEditors() { addField(new SpacerFieldEditor(getFieldEditorParent())); String[][] userActionPreferenceLabelValues = new String[][] { { Messages.CatalogBrowserPreferencesPage_AwlaysOptionLabel, UserActionPreference.ALWAYS.name() }, { Messages.CatalogBrowserPreferencesPage_NeverOptionLabel, UserActionPreference.NEVER.name() }, { Messages.CatalogBrowserPreferencesPage_AskOptionLabel, UserActionPreference.ASK.name() } }; addNodeStructureModeEditor = new RadioGroupFieldEditor(ICatalogBrowserPreferences.ADD_NODE_STRUCTURE_MODE, Messages.CatalogBrowserPreferencesPage_AddNodeStructureMessage, 3, userActionPreferenceLabelValues, getFieldEditorParent(), false); addField(addNodeStructureModeEditor); addField(new SpacerFieldEditor(getFieldEditorParent())); deleteEmptyFoldersModeEditor = new RadioGroupFieldEditor( ICatalogBrowserPreferences.DELETE_EMPTY_FOLDERS_MODE, Messages.CatalogBrowserPreferencesPage_DeleteEmptyFoldersMessage, 3, userActionPreferenceLabelValues, getFieldEditorParent(), false); addField(deleteEmptyFoldersModeEditor); }
From source file:ch.elexis.laborimport.teamw.PreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { final Composite parentComp = getFieldEditorParent(); final RadioGroupFieldEditor groupFieldEditor = new RadioGroupFieldEditor(BATCH_OR_FTP, Messages.getString("PreferencePage.direktimport.label"), 2, new String[][] { //$NON-NLS-1$ { Messages.getString("PreferencePage.batchscript.label"), BATCH }, //$NON-NLS-1$ { Messages.getString("PreferencePage.ftpserver.label"), FTP } }, //$NON-NLS-1$ parentComp, true);//ww w.j a v a2s . c o m final FileFieldEditor batchFileEditor = new FileFieldEditor(BATCH_DATEI, Messages.getString("PreferencePage.batchdatei.label"), //$NON-NLS-1$ parentComp); addField(groupFieldEditor); addField(batchFileEditor); addField(new StringFieldEditor(FTP_HOST, Messages.getString("PreferencePage.label.host"), //$NON-NLS-1$ getFieldEditorParent())); addField(new StringFieldEditor(FTP_USER, Messages.getString("PreferencePage.label.user"), //$NON-NLS-1$ getFieldEditorParent())); addField(new StringFieldEditor(FTP_PWD, Messages.getString("PreferencePage.label.password"), //$NON-NLS-1$ getFieldEditorParent())); addField(new InexistingDirectoryOKDirectoryFieldEditor(DL_DIR, Messages.getString("PreferencePage.label.download"), getFieldEditorParent())); //$NON-NLS-1$ }
From source file:com.android.ide.eclipse.adt.internal.preferences.BuildPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_RES_AUTO_REFRESH, Messages.BuildPreferencePage_Auto_Refresh_Resources_on_Build, getFieldEditorParent())); addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_FORCE_ERROR_ON_NATIVELIB_IN_JAR, "Force error when external jars contain native libraries", getFieldEditorParent())); addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_SKIP_POST_COMPILE_ON_FILE_SAVE, "Skip packaging and dexing until export or launch. (Speeds up automatic builds on file save)", getFieldEditorParent()));//w w w . jav a 2s . co m RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(AdtPrefs.PREFS_BUILD_VERBOSITY, Messages.BuildPreferencePage_Build_Output, 1, new String[][] { { Messages.BuildPreferencePage_Silent, BuildVerbosity.ALWAYS.name() }, { Messages.BuildPreferencePage_Normal, BuildVerbosity.NORMAL.name() }, { Messages.BuildPreferencePage_Verbose, BuildVerbosity.VERBOSE.name() } }, getFieldEditorParent(), true); addField(rgfe); // default debug keystore fingerprints Fingerprints defaultFingerprints = getFingerprints( mPrefStore.getString(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE)); // default debug key store fields mDefaultKeyStore = new ReadOnlyFieldEditor(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Default_KeyStore, getFieldEditorParent()); mDefaultFingerprintMd5 = new LabelField(Messages.BuildPreferencePage_Default_Certificate_Fingerprint_MD5, defaultFingerprints != null ? defaultFingerprints.md5 : "", getFieldEditorParent()); mDefaultFingerprintSha1 = new LabelField(Messages.BuildPreferencePage_Default_Certificate_Fingerprint_SHA1, defaultFingerprints != null ? defaultFingerprints.sha1 : "", getFieldEditorParent()); addField(mDefaultKeyStore); addField(mDefaultFingerprintMd5); addField(mDefaultFingerprintSha1); // custom debug keystore fingerprints Fingerprints customFingerprints = null; String customDebugKeystorePath = mPrefStore.getString(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE); if (new File(customDebugKeystorePath).isFile()) { customFingerprints = getFingerprints(customDebugKeystorePath); } else { // file does not exist. setErrorMessage("Not a valid keystore path."); } // custom debug key store fields mCustomKeyStore = new KeystoreFieldEditor(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Custom_Keystore, getFieldEditorParent()); mCustomFingerprintMd5 = new LabelField(Messages.BuildPreferencePage_Default_Certificate_Fingerprint_MD5, customFingerprints != null ? customFingerprints.md5 : "", getFieldEditorParent()); mCustomFingerprintSha1 = new LabelField(Messages.BuildPreferencePage_Default_Certificate_Fingerprint_SHA1, customFingerprints != null ? customFingerprints.sha1 : "", getFieldEditorParent()); // set fingerprint fields mCustomKeyStore.setFingerprintMd5Field(mCustomFingerprintMd5); mCustomKeyStore.setFingerprintSha1Field(mCustomFingerprintSha1); addField(mCustomKeyStore); addField(mCustomFingerprintMd5); addField(mCustomFingerprintSha1); }
From source file:com.android.ide.eclipse.adt.internal.preferences.EditorsPage.java
License:Open Source License
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); addField(new DensityFieldEditor(AdtPrefs.PREFS_MONITOR_DENSITY, "Monitor Density", parent)); final MyBooleanFieldEditor editor = new MyBooleanFieldEditor(AdtPrefs.PREFS_USE_CUSTOM_XML_FORMATTER, "Format XML files using the standard Android XML style rather than the \n" + "configured Eclipse XML style (additional options below)", parent);//from w w w. ja v a2 s .co m addField(editor); // Add a listener which fires whenever the checkbox for the custom formatter // is toggled -- this will be used to enable/disable the formatting related options // on the page. To do this we subclass the BooleanFieldEditor to make the protected // method getChangeControl public (so we can access it and add a listener on it). // This is pretty ugly but I found several posts in the Eclipse forums asking // how to do it and they were all unanswered. (No, calling setPropertyChangeListener // does not work.) Button checkbox = editor.getChangeControl(parent); checkbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateCustomFormattingOptions(editor.getBooleanValue()); } }); mIndentEditor = new BooleanFieldEditor(AdtPrefs.PREFS_USE_ECLIPSE_INDENT, "Use Eclipse setting for indentation width and space or tab character " + "indentation \n(Android default is 4 space characters)", parent); addField(mIndentEditor); mRemoveEmptyEditor = new BooleanFieldEditor(AdtPrefs.PREVS_REMOVE_EMPTY_LINES, "Always remove empty lines between elements", parent); addField(mRemoveEmptyEditor); mOneAttrPerLineEditor = new BooleanFieldEditor(AdtPrefs.PREFS_ONE_ATTR_PER_LINE, "Allow single attributes to appear on the same line as their elements", parent); addField(mOneAttrPerLineEditor); mSpaceBeforeCloseEditor = new BooleanFieldEditor(AdtPrefs.PREFS_SPACE_BEFORE_CLOSE, "Add a space before the > or /> in opening tags", parent); addField(mSpaceBeforeCloseEditor); addField(new RadioGroupFieldEditor(AdtPrefs.PREFS_ATTRIBUTE_SORT, "Sort Attributes", 1, new String[][] { { "&Logical (id, style, layout attributes, remaining attributes alphabetically)", LOGICAL.key }, { "&Alphabetical", ALPHABETICAL.key }, { "&None", NO_SORTING.key }, }, parent, true)); mFormatGuiXmlEditor = new BooleanFieldEditor(AdtPrefs.PREFS_FORMAT_GUI_XML, "Automatically format the XML edited by the visual layout editor", parent); addField(mFormatGuiXmlEditor); addField(new BooleanFieldEditor(AdtPrefs.PREFS_FORMAT_ON_SAVE, "Format on Save", parent)); addField(new BooleanFieldEditor(AdtPrefs.PREFS_SHARED_LAYOUT_EDITOR, "Use a single layout editor for all configuration variations of a layout", parent)); boolean enabled = getPreferenceStore().getBoolean(AdtPrefs.PREFS_USE_CUSTOM_XML_FORMATTER); updateCustomFormattingOptions(enabled); }
From source file:com.android.ide.eclipse.adt.preferences.BuildPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(AdtPlugin.PREFS_RES_AUTO_REFRESH, Messages.BuildPreferencePage_Auto_Refresh_Resources_on_Build, getFieldEditorParent())); RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(AdtPlugin.PREFS_BUILD_VERBOSITY, Messages.BuildPreferencePage_Build_Output, 1, new String[][] { { Messages.BuildPreferencePage_Silent, BUILD_STR_SILENT }, { Messages.BuildPreferencePage_Normal, BUILD_STR_NORMAL }, { Messages.BuildPreferencePage_Verbose, BUILD_STR_VERBOSE } }, getFieldEditorParent(), true); addField(rgfe);/*from ww w . ja v a 2 s . co m*/ addField(new ReadOnlyFieldEditor(AdtPlugin.PREFS_DEFAULT_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Default_KeyStore, getFieldEditorParent())); addField(new KeystoreFieldEditor(AdtPlugin.PREFS_CUSTOM_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Custom_Keystore, getFieldEditorParent())); }
From source file:com.android.ide.eclipse.auidt.internal.preferences.BuildPreferencePage.java
License:Open Source License
@Override protected void createFieldEditors() { addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_RES_AUTO_REFRESH, Messages.BuildPreferencePage_Auto_Refresh_Resources_on_Build, getFieldEditorParent())); addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_FORCE_ERROR_ON_NATIVELIB_IN_JAR, "Force error when external jars contain native libraries", getFieldEditorParent())); addField(new BooleanFieldEditor(AdtPrefs.PREFS_BUILD_SKIP_POST_COMPILE_ON_FILE_SAVE, "Skip packaging and dexing until export or launch. (Speeds up automatic builds on file save)", getFieldEditorParent()));//w ww . j a v a2 s . c o m RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(AdtPrefs.PREFS_BUILD_VERBOSITY, Messages.BuildPreferencePage_Build_Output, 1, new String[][] { { Messages.BuildPreferencePage_Silent, BuildVerbosity.ALWAYS.name() }, { Messages.BuildPreferencePage_Normal, BuildVerbosity.NORMAL.name() }, { Messages.BuildPreferencePage_Verbose, BuildVerbosity.VERBOSE.name() } }, getFieldEditorParent(), true); addField(rgfe); addField(new ReadOnlyFieldEditor(AdtPrefs.PREFS_DEFAULT_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Default_KeyStore, getFieldEditorParent())); addField(new KeystoreFieldEditor(AdtPrefs.PREFS_CUSTOM_DEBUG_KEYSTORE, Messages.BuildPreferencePage_Custom_Keystore, getFieldEditorParent())); }
From source file:com.android.ide.eclipse.auidt.internal.preferences.EditorsPage.java
License:Open Source License
@Override protected void createFieldEditors() { Composite parent = getFieldEditorParent(); addField(new DensityFieldEditor(AdtPrefs.PREFS_MONITOR_DENSITY, "Monitor Density", parent)); final MyBooleanFieldEditor editor = new MyBooleanFieldEditor(AdtPrefs.PREFS_USE_CUSTOM_XML_FORMATTER, "Format XML files using the standard Android XML style rather than the\n" + "configured Eclipse XML style (additional options below)", parent);/* w ww . ja va2 s.c o m*/ addField(editor); // Add a listener which fires whenever the checkbox for the custom formatter // is toggled -- this will be used to enable/disable the formatting related options // on the page. To do this we subclass the BooleanFieldEditor to make the protected // method getChangeControl public (so we can access it and add a listener on it). // This is pretty ugly but I found several posts in the Eclipse forums asking // how to do it and they were all unanswered. (No, calling setPropertyChangeListener // does not work.) Button checkbox = editor.getChangeControl(parent); checkbox.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { updateCustomFormattingOptions(editor.getBooleanValue()); } }); mIndentEditor = new BooleanFieldEditor(AdtPrefs.PREFS_USE_ECLIPSE_INDENT, "Use Eclipse setting for indentation width and space or tab character " + "indentation\n(Android default is 4 space characters)", parent); addField(mIndentEditor); mRemoveEmptyEditor = new BooleanFieldEditor(AdtPrefs.PREVS_REMOVE_EMPTY_LINES, "Always remove empty lines between elements", parent); addField(mRemoveEmptyEditor); mOneAttrPerLineEditor = new BooleanFieldEditor(AdtPrefs.PREFS_ONE_ATTR_PER_LINE, "Allow single attributes to appear on the same line as their elements", parent); addField(mOneAttrPerLineEditor); mSpaceBeforeCloseEditor = new BooleanFieldEditor(AdtPrefs.PREFS_SPACE_BEFORE_CLOSE, "Add a space before the > or /> in opening tags", parent); addField(mSpaceBeforeCloseEditor); addField(new RadioGroupFieldEditor(AdtPrefs.PREFS_ATTRIBUTE_SORT, "Sort Attributes", 1, new String[][] { { "&Logical (id, style, layout attributes, remaining attributes alphabetically)", LOGICAL.key }, { "&Alphabetical", ALPHABETICAL.key }, { "&None", NO_SORTING.key }, }, parent, true)); mFormatGuiXmlEditor = new BooleanFieldEditor(AdtPrefs.PREFS_FORMAT_GUI_XML, "Automatically format the XML edited by the visual layout editor", parent); addField(mFormatGuiXmlEditor); addField(new BooleanFieldEditor(AdtPrefs.PREFS_FORMAT_ON_SAVE, "Format on Save", parent)); boolean enabled = getPreferenceStore().getBoolean(AdtPrefs.PREFS_USE_CUSTOM_XML_FORMATTER); updateCustomFormattingOptions(enabled); }
From source file:com.android.ide.eclipse.ddms.preferences.PreferencePage.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. *///from w w w. j a v a 2 s. c o m @Override public void createFieldEditors() { IntegerFieldEditor ife; ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_DEBUG_PORT_BASE, Messages.PreferencePage_Base_Local_Debugger_Port, getFieldEditorParent()); ife.setValidRange(1024, 32767); addField(ife); BooleanFieldEditor bfe; bfe = new BooleanFieldEditor(PreferenceInitializer.ATTR_DEFAULT_THREAD_UPDATE, Messages.PreferencePage_Thread_Updates_Enabled_By_Default, getFieldEditorParent()); addField(bfe); bfe = new BooleanFieldEditor(PreferenceInitializer.ATTR_DEFAULT_HEAP_UPDATE, Messages.PreferencePage_Heap_Updates_Enabled_Default, getFieldEditorParent()); addField(bfe); ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_THREAD_INTERVAL, Messages.PreferencePage_Thread_Status_Refresh_Interval, getFieldEditorParent()); ife.setValidRange(1, 60); addField(ife); if (InstallDetails.isAdtInstalled()) { ComboFieldEditor cfe = new ComboFieldEditor(PreferenceInitializer.ATTR_HPROF_ACTION, Messages.PreferencePage_HPROF_Action, new String[][] { { Messages.PreferencePage_Save_Disk, HProfHandler.ACTION_SAVE }, { Messages.PreferencePage_Open_Eclipse, HProfHandler.ACTION_OPEN }, }, getFieldEditorParent()); addField(cfe); } mProfilerBufsize = new IntegerFieldEditor(PreferenceInitializer.ATTR_PROFILER_BUFSIZE_MB, "Method Profiler buffer size (MB):", getFieldEditorParent()); addField(mProfilerBufsize); ife = new IntegerFieldEditor(PreferenceInitializer.ATTR_TIME_OUT, Messages.PreferencePage_ADB_Connection_Time_Out, getFieldEditorParent()); addField(ife); RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor(PreferenceInitializer.ATTR_LOG_LEVEL, Messages.PreferencePage_Logging_Level, 1, new String[][] { { Messages.PreferencePage_Verbose, LogLevel.VERBOSE.getStringValue() }, { Messages.PreferencePage_Debug, LogLevel.DEBUG.getStringValue() }, { Messages.PreferencePage_Info, LogLevel.INFO.getStringValue() }, { Messages.PreferencePage_Warning, LogLevel.WARN.getStringValue() }, { Messages.PreferencePage_Error, LogLevel.ERROR.getStringValue() }, { Messages.PreferencePage_Assert, LogLevel.ASSERT.getStringValue() } }, getFieldEditorParent(), true); addField(rgfe); mUseAdbHost = new BooleanFieldEditor(PreferenceInitializer.ATTR_USE_ADBHOST, Messages.PreferencePage_Use_Adbhost, getFieldEditorParent()); addField(mUseAdbHost); mAdbHostValue = new StringFieldEditor(PreferenceInitializer.ATTR_ADBHOST_VALUE, Messages.PreferencePage_Adbhost_value, getFieldEditorParent()); mAdbHostValue.setEnabled(getPreferenceStore().getBoolean(PreferenceInitializer.ATTR_USE_ADBHOST), getFieldEditorParent()); addField(mAdbHostValue); }
From source file:com.aptana.ide.editor.js.preferences.TypingPreferencePage.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 av a 2 s. c om public void createFieldEditors() { super.createFieldEditors(); Group formatting = new Group(getFieldEditorParent(), SWT.NONE); formatting.setLayout(new GridLayout(1, true)); formatting.setText(Messages.TypingPreferencePage_LBL_Formatting); GridData gdLabel = new GridData(SWT.FILL, SWT.FILL, true, false); gdLabel.horizontalSpan = 2; formatting.setLayoutData(gdLabel); Composite fComp = new Composite(formatting, SWT.NONE); fComp.setLayoutData(gdLabel); addField(new BooleanFieldEditor(IPreferenceConstants.PREFERENCE_COMMENT_INDENT_USE_STAR, Messages.GeneralPreferencePage_IndentWithLeadingStar, fComp)); addField(new RadioGroupFieldEditor(IPreferenceConstants.AUTO_INDENT_ON_CARRIAGE_RETURN, Messages.TypingPreferencePage_AutoIndentCarriageReturn, 1, new String[][] { { Messages.TypingPreferencePage_Indent, Boolean.TRUE.toString() }, { Messages.TypingPreferencePage_DontIndent, Boolean.FALSE.toString() } }, getFieldEditorParent(), true)); addField(new BooleanFieldEditor(IPreferenceConstants.AUTO_FORMAT_ON_CLOSE_CURLY, Messages.GeneralPreferencePage_AutoFormatOnCloseCurly, fComp)); }
From source file:com.aptana.ide.editor.xml.preferences.TypingPreferencePage.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 a va2 s . c o m public void createFieldEditors() { super.createFieldEditors(); addField(new RadioGroupFieldEditor(IPreferenceConstants.ATTRIBUTE_QUOTE_CHARACTER, Messages.GeneralPreferencePage_QuoteChar, 1, new String[][] { { Messages.GeneralPreferencePage_None, StringUtils.EMPTY }, { Messages.GeneralPreferencePage_Double, "\"" }, //$NON-NLS-1$ { Messages.GeneralPreferencePage_Single, "'" }, //$NON-NLS-1$ }, getFieldEditorParent(), true)); addField(new RadioGroupFieldEditor(IPreferenceConstants.AUTO_INDENT_ON_CARRIAGE_RETURN, Messages.GeneralPreferencePage_AutoIndentCarriageReturn, 1, new String[][] { { Messages.GeneralPreferencePage_Indent, "true" }, //$NON-NLS-1$ { Messages.GeneralPreferencePage_DontIndent, "false" } }, //$NON-NLS-1$ getFieldEditorParent(), true)); addField(new RadioGroupFieldEditor(IPreferenceConstants.AUTO_MODIFY_PAIR_TAG, Messages.TypingPreferencePage_AutoModifyPairTag, 1, new String[][] { { Messages.TypingPreferencePage_ModifyPairTag, "true" }, //$NON-NLS-1$ { Messages.TypingPreferencePage_NOModifyPairTag, "false" } }, //$NON-NLS-1$ getFieldEditorParent(), true)); }