當前位置: 首頁>>代碼示例>>Java>>正文


Java PreferenceChangeEvent.getKey方法代碼示例

本文整理匯總了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;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:DefaultFoldingOptions.java

示例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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:DebuggingTreeModel.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:23,代碼來源:Utilities.java

示例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));
			}
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:27,代碼來源:RecentProjects.java

示例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);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:SettingsProvider.java

示例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());
	}
}
 
開發者ID:SensorsINI,項目名稱:jaer,代碼行數:30,代碼來源:TowerOnChip6BitVDAC.java

示例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();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:CodeFoldingSideBar.java

示例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));
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:15,代碼來源:PrefMonitorInt.java

示例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();
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:10,代碼來源:DebuggingNodeModel.java

示例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();
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:VariablesTreeModelFilter.java

示例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()));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:GsfCompletionProvider.java

示例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);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:HtmlPreferences.java

示例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"));
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:DebuggingViewComponent.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:ProxyPreferencesImplTest.java

示例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);
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:15,代碼來源:PrefMonitorBoolean.java


注:本文中的java.util.prefs.PreferenceChangeEvent.getKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。