本文整理匯總了Java中java.util.prefs.Preferences.getBoolean方法的典型用法代碼示例。如果您正苦於以下問題:Java Preferences.getBoolean方法的具體用法?Java Preferences.getBoolean怎麽用?Java Preferences.getBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.util.prefs.Preferences
的用法示例。
在下文中一共展示了Preferences.getBoolean方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: store
import java.util.prefs.Preferences; //導入方法依賴的package包/類
public void store( ) {
Preferences node = MarkOccurencesSettings.getCurrentNode();
for (javax.swing.JCheckBox box : boxes) {
boolean value = box.isSelected();
boolean original = node.getBoolean(box.getActionCommand(),
DEFAULT_VALUE);
if (value != original) {
node.putBoolean(box.getActionCommand(), value);
}
}
try {
node.flush();
}
catch (BackingStoreException ex) {
Exceptions.printStackTrace(ex);
}
changed = false;
}
示例2: performTask
import java.util.prefs.Preferences; //導入方法依賴的package包/類
@Override
public void performTask() {
Preferences prefs = MimeLookup.getLookup(DocumentUtilities.getMimeType(doc)).lookup(Preferences.class);
if (prefs.getBoolean(SimpleValueNames.ON_SAVE_USE_GLOBAL_SETTINGS, Boolean.TRUE)) {
prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
}
String policy = prefs.get(SimpleValueNames.ON_SAVE_REMOVE_TRAILING_WHITESPACE, "never"); //NOI18N
if (!"never".equals(policy)) { //NOI18N
ModRootElement modRootElement = ModRootElement.get(doc);
if (modRootElement != null) {
boolean origEnabled = modRootElement.isEnabled();
modRootElement.setEnabled(false);
try {
new TrailingWhitespaceRemoveProcessor(doc, "modified-lines".equals(policy), canceled).removeWhitespace(); //NOI18N
} finally {
modRootElement.setEnabled(origEnabled);
}
}
}
}
示例3: load
import java.util.prefs.Preferences; //導入方法依賴的package包/類
void load( Preferences prefs, String prefix ) throws BackingStoreException {
name = prefs.get( prefix+"_name", "Filter" ); //NOI18N //NOI18N
if( prefs.getBoolean( prefix+"_types", false ) ) { //NOI18N
types = new TypesFilter();
types.load( prefs, prefix+"_types" ); //NOI18N
} else {
types = null;
}
if( prefs.getBoolean( prefix+"_keywords", false ) ) { //NOI18N
keywords = new KeywordsFilter();
keywords.load( prefs, prefix+"_keywords" ); //NOI18N
} else {
keywords = null;
}
}
示例4: setImages
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private void setImages() {
Preferences preferences = Preferences.userNodeForPackage(Player.class);
volDown.setGraphic(volDownImage);
volUp.setGraphic(volUpImage);
previous.setGraphic(previousImage);
play.setGraphic(playImage);
next.setGraphic(nextImage);
final boolean isShuffleMode = preferences.getBoolean("ShuffleMode", false);
shuffle.setGraphic(isShuffleMode ? shufflePressedImage : shuffleImage);
final boolean isLoopMode = preferences.getBoolean("LoopMode", false);
loop.setGraphic(isLoopMode ? loopPressedImage: loopImage);
volSlider.valueChangingProperty().addListener(rootController.volumeUpdated(volSlider));
}
示例5: fireChanged
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private void fireChanged() {
Preferences node = MarkOccurencesSettings.getCurrentNode();
for (JCheckBox box : boxes) {
if (node.getBoolean(box.getActionCommand(), DEFAULT_VALUE) != box.isSelected()) {
changed = true;
return;
}
}
changed = false;
}
示例6: addSecurityBugHandler
import java.util.prefs.Preferences; //導入方法依賴的package包/類
/**
* Add security manager bug handler, if needed. See bug #239962.
*/
private void addSecurityBugHandler(ExecSupport ee) {
Preferences prefs = NbPreferences.forModule(RegisterDerby.class);
if (!prefs.getBoolean(DISABLE_SECURITY_MANAGER, false)
&& !prefs.getBoolean(DO_NOT_CHECK_SECURITY_MANAGER_BUG, false)) {
ee.addOutputStringHandler(SECURITY_MANAGER_BUG_OUTPUT,
createSecurityManagerBugHandler());
}
}
示例7: setMenu
import java.util.prefs.Preferences; //導入方法依賴的package包/類
protected @Override void setMenu(){
super.setMenu();
JTextComponent c = getComponent();
MimePath mimePath = c == null ? MimePath.EMPTY : MimePath.parse(DocumentUtilities.getMimeType(c));
Preferences prefs = MimeLookup.getLookup(mimePath).lookup(Preferences.class);
boolean visible = prefs.getBoolean(SimpleValueNames.LINE_NUMBER_VISIBLE, EditorPreferencesDefaults.defaultLineNumberVisible);
SHOW_LINE_MENU.setState(visible);
}
示例8: isCamelCaseJavaNavigation
import java.util.prefs.Preferences; //導入方法依賴的package包/類
Boolean isCamelCaseJavaNavigation() {
Preferences p = NbPreferences.root ();
if ( p == null ) {
return null;
}
return p.getBoolean("useCamelCaseStyleNavigation", true) ? Boolean.TRUE : Boolean.FALSE; // NOI18N
}
示例9: isOpened
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private static boolean isOpened(String cid, boolean open) {
if (cid.equals("watchesView")) { // NOI18N
Preferences preferences = NbPreferences.forModule(ContextProvider.class).node("variables_view"); // NOI18N
open = !preferences.getBoolean("show_watches", true); // NOI18N
}
boolean wasClosed = Properties.getDefault().getProperties(PROPERTY_BASE_NAME).
getProperties(PROPERTY_CLOSED_TC).getBoolean(cid, false);
boolean wasOpened = !Properties.getDefault().getProperties(PROPERTY_BASE_NAME).
getProperties(PROPERTY_CLOSED_TC).getBoolean(cid, true);
open = (open && !wasClosed || !open && wasOpened);
return open;
}
示例10: getFoldingEnabledSetting
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private boolean getFoldingEnabledSetting(boolean useProperty) {
Boolean b = useProperty ? (Boolean)component.getClientProperty(SimpleValueNames.CODE_FOLDING_ENABLE) : null;
// no preferences in component; get from lookup:
if (b == null && component.getDocument() != null) {
String mime = DocumentUtilities.getMimeType(component.getDocument());
if (mime != null) {
Preferences prefs = getFoldPreferences();
b = prefs.getBoolean(PROPERTY_FOLDING_ENABLED, true);
}
}
boolean ret = (b != null) ? b.booleanValue() : DEFAULT_CODE_FOLDING_ENABLED;
PREF_LOG.log(Level.FINE, "Execution read enable: " + ret);
component.putClientProperty(SimpleValueNames.CODE_FOLDING_ENABLE, ret);
return ret;
}
示例11: getFormatOptionBoolean
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private boolean getFormatOptionBoolean(String optionName, boolean def) {
Preferences p = getFormatOptions();
if (p == null) {
return def;
} else {
return p.getBoolean(optionName, def);
}
}
示例12: isFinalFields
import java.util.prefs.Preferences; //導入方法依賴的package包/類
public static boolean isFinalFields(Preferences p) {
return p.getBoolean(FINAL_FIELDS, true);
}
示例13: actionPerformed
import java.util.prefs.Preferences; //導入方法依賴的package包/類
@Override
public void actionPerformed(ActionEvent evt, JTextComponent target) {
Preferences prefs = MimeLookup.getLookup(MimePath.EMPTY).lookup(Preferences.class);
boolean toolbarVisible = prefs.getBoolean(SimpleValueNames.TOOLBAR_VISIBLE_PROP, EditorPreferencesDefaults.defaultToolbarVisible);
prefs.putBoolean(SimpleValueNames.TOOLBAR_VISIBLE_PROP, !toolbarVisible);
}
示例14: isButtonSelected
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private static boolean isButtonSelected(String name) {
Preferences preferences = NbPreferences.forModule(VariablesViewButtons.class).node(PREFERENCES_NAME);
return preferences.getBoolean(name, getDefaultSelected(name));
}
示例15: getPrefBoolean
import java.util.prefs.Preferences; //導入方法依賴的package包/類
private boolean getPrefBoolean(Preferences pref, MapFlag flag) {
return pref.getBoolean(flag.getPrefKey(), flag.getDefault());
}