/* * Serves a listener for the preference widgets. (non-Javadoc) (non-Javadoc) * * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events .ModifyEvent) */ public void modifyText(ModifyEvent e) { Text source = (Text) e.getSource(); if (source == logFile) { String text = logFile.getText(); Preferences.setString( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.LOG_FILE, text); } }
@Override public void performDefaults() { reloadOption.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.FORCE_XML_RELOAD, false)); segmentPattern.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SEGMENT_PATTERN, false)); matchStatus.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.MATCH_STATUS, false)); actions.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.ACTIONS, false)); createdProperties.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.CREATED_PROPERTIES, false)); showCommand.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND, false)); showCommandOutput.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND_OUTPUT, false)); validateXML.setSelection( Preferences.getDefaultBoolean( JAXBCorePlugin.getUniqueIdentifier(), JAXBCorePreferenceConstants.VALIDATE_XML, false)); keepManagedFiles.setSelection( Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.KEEP_MANAGED_FILES, false)); logFile.setText( Preferences.getDefaultString( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.LOG_FILE, JAXBUIConstants.ZEROSTR)); updateApplyButton(); }
/* * Serves a listener for the preference widgets. (non-Javadoc) * * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt .events.SelectionEvent) */ public void widgetSelected(SelectionEvent e) { Button source = (Button) e.getSource(); if (source == reloadOption) { boolean b = reloadOption.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.FORCE_XML_RELOAD, b); } else if (source == segmentPattern) { boolean b = segmentPattern.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SEGMENT_PATTERN, b); } else if (source == matchStatus) { boolean b = matchStatus.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.MATCH_STATUS, b); } else if (source == actions) { boolean b = actions.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.ACTIONS, b); } else if (source == createdProperties) { boolean b = createdProperties.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.CREATED_PROPERTIES, b); } else if (source == showCommand) { boolean b = showCommand.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND, b); } else if (source == showCommandOutput) { boolean b = showCommandOutput.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND_OUTPUT, b); } else if (source == keepManagedFiles) { boolean b = keepManagedFiles.getSelection(); Preferences.setBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.KEEP_MANAGED_FILES, b); } else if (source == validateXML) { boolean b = validateXML.getSelection(); Preferences.setBoolean( JAXBCorePlugin.getUniqueIdentifier(), JAXBCorePreferenceConstants.VALIDATE_XML, b); } }
/** Load values from preference store */ private void loadSaved() { boolean def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.FORCE_XML_RELOAD, false); boolean b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.FORCE_XML_RELOAD, def, null); reloadOption.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SEGMENT_PATTERN, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SEGMENT_PATTERN, def, null); segmentPattern.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.MATCH_STATUS, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.MATCH_STATUS, def, null); matchStatus.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.ACTIONS, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.ACTIONS, def, null); actions.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.CREATED_PROPERTIES, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.CREATED_PROPERTIES, def, null); createdProperties.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND, def, null); showCommand.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND_OUTPUT, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.SHOW_COMMAND_OUTPUT, def, null); showCommandOutput.setSelection(b); def = Preferences.getDefaultBoolean( JAXBCorePlugin.getUniqueIdentifier(), JAXBCorePreferenceConstants.VALIDATE_XML, false); b = Platform.getPreferencesService() .getBoolean( JAXBCorePlugin.getUniqueIdentifier(), JAXBCorePreferenceConstants.VALIDATE_XML, def, null); validateXML.setSelection(b); def = Preferences.getDefaultBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.KEEP_MANAGED_FILES, false); b = Platform.getPreferencesService() .getBoolean( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.KEEP_MANAGED_FILES, def, null); keepManagedFiles.setSelection(b); String defText = Preferences.getDefaultString( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.LOG_FILE, JAXBUIConstants.ZEROSTR); String text = Platform.getPreferencesService() .getString( JAXBControlCorePlugin.getUniqueIdentifier(), JAXBRMPreferenceConstants.LOG_FILE, defText, null); logFile.setText(text); }