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


Java Preferences.getBoolean方法代碼示例

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

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

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

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

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

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

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

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

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

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

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

示例12: isFinalFields

import java.util.prefs.Preferences; //導入方法依賴的package包/類
public static boolean isFinalFields(Preferences p) {
    return p.getBoolean(FINAL_FIELDS, true);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:FieldForUnusedParam.java

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

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

示例15: getPrefBoolean

import java.util.prefs.Preferences; //導入方法依賴的package包/類
private boolean getPrefBoolean(Preferences pref, MapFlag flag) {
    return pref.getBoolean(flag.getPrefKey(), flag.getDefault());
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:4,代碼來源:TimelinePanel.java


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