Java Code Examples for org.eclipse.jface.preference.RadioGroupFieldEditor#setEnabled()
The following examples show how to use
org.eclipse.jface.preference.RadioGroupFieldEditor#setEnabled() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ControlPreferencePage.java From tracecompass with Eclipse Public License 2.0 | 4 votes |
@Override protected void createFieldEditors() { StringFieldEditor tracingGroup = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_TRACING_GROUP_PREF, Messages.TraceControl_TracingGroupPreference, getFieldEditorParent()); addField(tracingGroup); BooleanFieldEditor logCommand = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_COMMANDS_PREF, Messages.TraceControl_LoggingPreference, getFieldEditorParent()); addField(logCommand); StringFieldEditor logfile = new StringFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_FILE_PATH_PREF, Messages.TraceControl_LogfilePath, getFieldEditorParent()); addField(logfile); fIsAppend = new BooleanFieldEditor(ControlPreferences.TRACE_CONTROL_LOG_APPEND_PREF, Messages.TraceControl_AppendLogfilePreference, getFieldEditorParent()); addField(fIsAppend); fVerboseLevel = new RadioGroupFieldEditor ( ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_PREF, Messages.TraceControl_VerboseLevelsPreference, 4, new String[][] { { Messages.TraceControl_VerboseLevelNonePreference, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_NONE, }, { Messages.TraceControl_VerboseLevelVerbosePreference, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_VERBOSE }, { Messages.TraceControl_VerboseLevelVeryVerbosePreference, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_VERBOSE }, { Messages.TraceControl_VerboseLevelVeryVeryVerbosePreference, ControlPreferences.TRACE_CONTROL_VERBOSE_LEVEL_V_V_VERBOSE } }, getFieldEditorParent(), true); addField(fVerboseLevel); Boolean enabled = ControlPreferences.getInstance().isLoggingEnabled(); fVerboseLevel.setEnabled(enabled, getFieldEditorParent()); fIsAppend.setEnabled(enabled, getFieldEditorParent()); logfile.setEnabled(false, getFieldEditorParent()); }
Example 2
Source File: UpdateCheckerPreferencePage.java From developer-studio with Apache License 2.0 | 4 votes |
@Override protected void createFieldEditors() { fieldEditorParent = getFieldEditorParent(); boolean isSchedulingEnabled = false; addBlankSeparator(fieldEditorParent); setSeparator(fieldEditorParent); addField(new BooleanFieldEditor(PreferenceConstants.ENABLE_AUTOMATIC_UPDATES, "Check for updates Automatically", fieldEditorParent)); setSeparator(fieldEditorParent); boolean isUpdatesEnabled = preferenceStore.getBoolean(PreferenceConstants.ENABLE_AUTOMATIC_UPDATES); enableDisableSet = new Composite(fieldEditorParent, SWT.LEFT); addBlankSeparator(enableDisableSet); updateSchedulingRadioBttn = new RadioGroupFieldEditor(PreferenceConstants.UPDATE_RUNNING_CONFIGURATION, "Automatic Updates Scheduling", 1, new String[][] { { PreferenceConstants.RUN_ON_STARTUP, PreferenceConstants.STARTUP }, { PreferenceConstants.SCHEDULE_UPDATER, PreferenceConstants.SCHEDULE } }, enableDisableSet); addField(updateSchedulingRadioBttn); updateSchedulingRadioBttn.setEnabled(isUpdatesEnabled, enableDisableSet); if (preferenceStore.getString(PreferenceConstants.UPDATE_RUNNING_CONFIGURATION) .equals(PreferenceConstants.SCHEDULE)) { isSchedulingEnabled = true; } String[][] dayIntervals = { { PreferenceConstants.DAILY, PreferenceConstants.DAILY }, { PreferenceConstants.DEFAULT_SUNDAY, PreferenceConstants.DEFAULT_SUNDAY }, { PreferenceConstants.EVERY_MONDAY, PreferenceConstants.EVERY_MONDAY }, { PreferenceConstants.EVERY_TUESDAY, PreferenceConstants.EVERY_TUESDAY }, { PreferenceConstants.EVERY_WEDNESDAY, PreferenceConstants.EVERY_WEDNESDAY }, { PreferenceConstants.EVERY_THURSDAY, PreferenceConstants.EVERY_THURSDAY }, { PreferenceConstants.EVERY_FRIDAY, PreferenceConstants.EVERY_FRIDAY }, { PreferenceConstants.EVERY_SATURDAY, PreferenceConstants.EVERY_SATURDAY } }; intervalDayEditor = new ComboFieldEditor(PreferenceConstants.UPDATE_DATE_INTERVAL, "Check for updates ", dayIntervals, enableDisableSet); addField(intervalDayEditor); intervalDayEditor.setEnabled(isUpdatesEnabled && isSchedulingEnabled, enableDisableSet); String[][] timeIntervals = { { PreferenceConstants.MIDNIGHT, PreferenceConstants.MIDNIGHT }, { PreferenceConstants.ONEAM, PreferenceConstants.ONEAM }, { PreferenceConstants.TWOAM, PreferenceConstants.TWOAM }, { PreferenceConstants.THREEAM, PreferenceConstants.THREEAM }, { PreferenceConstants.FOURAM, PreferenceConstants.FOURAM }, { PreferenceConstants.FIVEAM, PreferenceConstants.FIVEAM }, { PreferenceConstants.SIXAM, PreferenceConstants.SIXAM }, { PreferenceConstants.SEVENAM, PreferenceConstants.SEVENAM }, { PreferenceConstants.DEFAULT_EIGHT_AM, PreferenceConstants.NINEAM }, { PreferenceConstants.TENAM, PreferenceConstants.TENAM }, { PreferenceConstants.ELEVENAM, PreferenceConstants.ELEVENAM }, { PreferenceConstants.TWELEVENOON, PreferenceConstants.TWELEVENOON }, { PreferenceConstants.ONEPM, PreferenceConstants.ONEPM }, { PreferenceConstants.TWOPM, PreferenceConstants.TWOPM }, { PreferenceConstants.THREEPM, PreferenceConstants.THREEPM }, { PreferenceConstants.FOURPM, PreferenceConstants.FOURPM }, { PreferenceConstants.FIVEPM, PreferenceConstants.FIVEPM }, { PreferenceConstants.SIXPM, PreferenceConstants.SIXPM }, { PreferenceConstants.SIXPM, PreferenceConstants.SIXPM }, { PreferenceConstants.SEVENPM, PreferenceConstants.SEVENPM }, { PreferenceConstants.EIGHTPM, PreferenceConstants.EIGHTPM }, { PreferenceConstants.NINEPM, PreferenceConstants.NINEPM }, { PreferenceConstants.TENPM, PreferenceConstants.TENPM }, { PreferenceConstants.ELEVENPM, PreferenceConstants.ELEVENPM } }; intervalTimeEditor = new ComboFieldEditor(PreferenceConstants.UPDATE_TIME_INTERVAL, "at", timeIntervals, enableDisableSet); addField(intervalTimeEditor); intervalTimeEditor.setEnabled(isUpdatesEnabled && isSchedulingEnabled, enableDisableSet); setSeparator(enableDisableSet); addBlankSeparator(enableDisableSet); updateInstallationRadioBttn = new RadioGroupFieldEditor(PreferenceConstants.UPDATE_NOTIFICATION_CONFIGURATION, "Specify Installation Preference", 1, new String[][] { { PreferenceConstants.NOTIFY_ME_IF_UPDATES_AVAILABLE, PreferenceConstants.NOTIFY_ME }, { PreferenceConstants.DOWNLOAD_UPDATES, PreferenceConstants.INSTALL_AUTOMATICALLY } }, enableDisableSet); addField(updateInstallationRadioBttn); updateInstallationRadioBttn.setEnabled(isUpdatesEnabled, enableDisableSet); setSeparator(enableDisableSet); addBlankSeparator(enableDisableSet); updateSiteURL = new StringFieldEditor(PreferenceConstants.UPDATE_SITE_URL, "Update site:", enableDisableSet); releaseSiteURL = new StringFieldEditor(PreferenceConstants.RELESE_SITE_URL, "Release site:", enableDisableSet); updateSiteURL.setEnabled(isUpdatesEnabled, enableDisableSet); releaseSiteURL.setEnabled(isUpdatesEnabled, enableDisableSet); addField(updateSiteURL); addField(releaseSiteURL); setSeparator(fieldEditorParent); }