本文整理匯總了Java中java.util.prefs.PreferenceChangeEvent.getKey方法的典型用法代碼示例。如果您正苦於以下問題:Java PreferenceChangeEvent.getKey方法的具體用法?Java PreferenceChangeEvent.getKey怎麽用?Java PreferenceChangeEvent.getKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.prefs.PreferenceChangeEvent
的用法示例。
在下文中一共展示了PreferenceChangeEvent.getKey方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateCheckers
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
private String updateCheckers(PreferenceChangeEvent evt) {
String pk = evt.getKey();
if (pk != null) {
if (pk.equals(SimpleValueNames.CODE_FOLDING_ENABLE)) {
updateEnabledState();
return pk;
}
if (pk.equals(PREF_OVERRIDE_DEFAULTS)) {
updateOverrideChanged();
} else if (!pk.startsWith(COLLAPSE_PREFIX)) {
return pk;
}
} else {
updateEnabledState();
}
String c = pk == null ? null : pk.substring(COLLAPSE_PREFIX.length());
for (JCheckBox cb : controls) {
FoldType ft = (FoldType)cb.getClientProperty("type"); // NOI18N
FoldType ftp = ft.parent();
if (c == null || ft.code().equals(c) || (ftp != null && ftp.code().equals(c))) {
updateChecker(pk, cb, ft);
return pk;
}
}
return pk;
}
示例2: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
public void preferenceChange(PreferenceChangeEvent evt) {
String key = evt.getKey();
if (SORT_ALPHABET.equals(key) || SORT_SUSPEND.equals(key) ||
SHOW_SYSTEM_THREADS.equals(key) || SHOW_THREAD_GROUPS.equals(key) ||
SHOW_SUSPENDED_THREADS_ONLY.equals(key) ||
DebuggingNodeModel.SHOW_PACKAGE_NAMES.equals(key)) {
// We have to catch the Throwables, so that the AbstractPreferences.EventDispatchThread
// is not killed. See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6467096
try {
fireNodeChanged(ROOT);
} catch (ThreadDeath td) {
throw td;
} catch (Throwable t) {
Exceptions.printStackTrace(t);
}
}
}
示例3: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
String settingName = evt == null ? null : evt.getKey();
if (settingName == null || CodeCompletionPanel.GUESS_METHOD_ARGUMENTS.equals(settingName)) {
guessMethodArguments = preferences.getBoolean(CodeCompletionPanel.GUESS_METHOD_ARGUMENTS, CodeCompletionPanel.GUESS_METHOD_ARGUMENTS_DEFAULT);
}
if (settingName == null || CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART.equals(settingName)) {
autoPopupOnJavaIdentifierPart = preferences.getBoolean(CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART, CodeCompletionPanel.JAVA_AUTO_POPUP_ON_IDENTIFIER_PART_DEFAULT);
}
if (settingName == null || CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
javaCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS, CodeCompletionPanel.JAVA_AUTO_COMPLETION_TRIGGERS_DEFAULT);
}
if (settingName == null || CodeCompletionPanel.JAVA_COMPLETION_SELECTORS.equals(settingName)) {
javaCompletionSelectors = preferences.get(CodeCompletionPanel.JAVA_COMPLETION_SELECTORS, CodeCompletionPanel.JAVA_COMPLETION_SELECTORS_DEFAULT);
}
if (settingName == null || CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS.equals(settingName)) {
javadocCompletionAutoPopupTriggers = preferences.get(CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS, CodeCompletionPanel.JAVADOC_AUTO_COMPLETION_TRIGGERS_DEFAULT);
}
if (settingName == null || CodeCompletionPanel.JAVADOC_COMPLETION_SELECTORS.equals(settingName)) {
javadocCompletionSelectors = preferences.get(CodeCompletionPanel.JAVADOC_COMPLETION_SELECTORS, CodeCompletionPanel.JAVADOC_COMPLETION_SELECTORS_DEFAULT);
}
}
示例4: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent event) {
Preferences prefs = event.getNode();
String prop = event.getKey();
if (prop.startsWith(BASE_PROPERTY)) {
String rest = prop.substring(BASE_PROPERTY.length());
int index = -1;
try {
index = Integer.parseInt(rest);
if (index < 0 || index >= NUM_RECENT)
index = -1;
} catch (NumberFormatException e) {
}
if (index >= 0) {
File oldValue = recentFiles[index];
long oldTime = recentTimes[index];
getAndDecode(prefs, index);
File newValue = recentFiles[index];
long newTime = recentTimes[index];
if (!isSame(oldValue, newValue) || oldTime != newTime) {
AppPreferences.firePropertyChange(AppPreferences.RECENT_PROJECTS, new FileTime(oldValue, oldTime),
new FileTime(newValue, newTime));
}
}
}
}
示例5: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
public void preferenceChange(PreferenceChangeEvent evt) {
String settingName = evt == null ? null : evt.getKey();
if (settingName == null || settingName.equals(CompositeFCS.TEXT_ANTIALIASING_PROP)) { //NOI18N
synchronized (this) {
updateContents(false, true);
}
}
}
示例6: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(final PreferenceChangeEvent e) {
// TODO we get pref change events here but by this time the new values have already been set and there is no
// change in value so the GUI elements are not updated
try {
final String base = prefsKey() + TowerOnChip6BitVDAC.SEP;
final String key = e.getKey();
if (!key.startsWith(base)) {
return;
}
final String val = e.getNewValue();
// log.info("key="+key+" value="+val);
if (key.equals(base + TowerOnChip6BitVDAC.KEY_VDAC_VALUE)) {
if (getVdacBitValue() != Integer.parseInt(val)) {
Pot.log.info("reference voltage bit value change from preferences");
}
setVdacBitValue(Integer.parseInt(val));
}
else if (key.equals(base + TowerOnChip6BitVDAC.KEY_BUFFER_VALUE)) {
if (getBufferBitValue() != Integer.parseInt(val)) {
Pot.log.info("regulator bit value changed from preferences");
}
setBufferBitValue(Integer.parseInt(val));
}
}
catch (final Exception ex) {
Pot.log.warning("while responding to preference change event " + e + ", caught " + ex.toString());
}
}
示例7: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
public void preferenceChange(PreferenceChangeEvent evt) {
String key = evt == null ? null : evt.getKey();
if (key == null || SimpleValueNames.CODE_FOLDING_ENABLE.equals(key)) {
updateColors();
boolean newEnabled = prefs.getBoolean(SimpleValueNames.CODE_FOLDING_ENABLE, EditorPreferencesDefaults.defaultCodeFoldingEnable);
PREF_LOG.log(Level.FINE, "Sidebar folding-enable pref change: " + newEnabled);
if (enabled != newEnabled) {
enabled = newEnabled;
updatePreferredSize();
}
}
}
示例8: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent event) {
Preferences prefs = event.getNode();
String prop = event.getKey();
String name = getIdentifier();
if (prop.equals(name)) {
int oldValue = value;
int newValue = prefs.getInt(name, dflt);
if (newValue != oldValue) {
value = newValue;
AppPreferences.firePropertyChange(name, Integer.valueOf(oldValue), Integer.valueOf(newValue));
}
}
}
示例9: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
String key = evt.getKey();
if (DebuggingNodeModel.SHOW_PACKAGE_NAMES.equals(key)) {
synchronized (frameDescriptionsByFrame) {
frameDescriptionsByFrame.clear();
}
}
}
示例10: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
String key = evt.getKey();
if (VariablesViewButtons.SHOW_VALUE_PROPERTY_EDITORS.equals(key)) {
refresh();
}
}
示例11: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
public void preferenceChange(PreferenceChangeEvent evt) {
if (evt.getKey() == null || SimpleValueNames.COMPLETION_CASE_SENSITIVE.equals(evt.getKey())) {
setCaseSensitive(Boolean.valueOf(evt.getNewValue()));
} else if (SimpleValueNames.COMPLETION_AUTO_POPUP.equals(evt.getKey())) {
setAutoPopup(Boolean.valueOf(evt.getNewValue()));
}
}
示例12: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
String settingName = evt == null ? null : evt.getKey();
if (settingName == null || HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES_AFTER_EQS.equals(settingName)) {
autocompleQuotesAfterEQS = preferences.getBoolean(HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES_AFTER_EQS, HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES_AFTER_EQS_DEFAULT);
}
if (settingName == null || HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES.equals(settingName)) {
autocompleQuotes = preferences.getBoolean(HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES, HtmlCompletionOptionsPanel.HTML_AUTOCOMPLETE_QUOTES_DEFAULT);
}
if (settingName == null || HtmlCompletionOptionsPanel.HTML_COMPLETION_END_TAG_ADTER_LT.equals(settingName)) {
completionOffersEndTagAfterLt = preferences.getBoolean(HtmlCompletionOptionsPanel.HTML_COMPLETION_END_TAG_ADTER_LT, HtmlCompletionOptionsPanel.HTML_COMPLETION_END_TAG_ADTER_LT_DEFAULT);
}
if (settingName == null || HtmlCompletionOptionsPanel.HTML_COMPLETION_AUTOPOPUP_WINDOW.equals(settingName)) {
autoPopupCompletionWindow = preferences.getBoolean(HtmlCompletionOptionsPanel.HTML_COMPLETION_AUTOPOPUP_WINDOW, HtmlCompletionOptionsPanel.HTML_COMPLETION_AUTOPOPUP_WINDOW_DEFAULT);
}
if (settingName == null || HtmlCompletionOptionsPanel.HTML_END_TAG_AUTOCOMPLETION_AUTOPOPUP.equals(settingName)) {
autoPopupEndTagAutoCompletion = preferences.getBoolean(HtmlCompletionOptionsPanel.HTML_END_TAG_AUTOCOMPLETION_AUTOPOPUP, HtmlCompletionOptionsPanel.HTML_END_TAG_AUTOCOMPLETION_AUTOPOPUP_DEFAULT);
}
if (settingName == null || SELECTOR_TYPE_PROPERTY_NAME.equals(settingName)) {
selectorType = SelectorType.valueOf(preferences.get(SELECTOR_TYPE_PROPERTY_NAME, SELECTOR_TYPE_DEFAULT.name()));
}
if (settingName == null || SECTION_MODE_PROPERTY_NAME.equals(settingName)) {
sectionMode = Mode.valueOf(preferences.get(SECTION_MODE_PROPERTY_NAME, SECTION_MODE_DEFAULT.name()));
}
if (settingName == null || mimetypesWithEnabledHtmlErrorChecking_key.equals(settingName)) {
mimetypesWithEnabledHtmlErrorChecking = preferences.get(mimetypesWithEnabledHtmlErrorChecking_key, mimetypesWithEnabledHtmlErrorChecking_default);
}
}
示例13: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
String key = evt.getKey();
if (FiltersDescriptor.SHOW_SUSPEND_TABLE.equals(key)) {
setSuspendTableVisible(evt.getNewValue().equals("true"));
}
}
示例14: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent evt) {
changeCount++;
this.key = evt.getKey();
this.value = evt.getNewValue();
latch.countDown();
}
示例15: preferenceChange
import java.util.prefs.PreferenceChangeEvent; //導入方法依賴的package包/類
@Override
public void preferenceChange(PreferenceChangeEvent event) {
Preferences prefs = event.getNode();
String prop = event.getKey();
String name = getIdentifier();
if (prop.equals(name)) {
boolean oldValue = value;
boolean newValue = prefs.getBoolean(name, dflt);
if (newValue != oldValue) {
value = newValue;
AppPreferences.firePropertyChange(name, oldValue, newValue);
}
}
}