Java 类org.openide.util.NbPreferences 实例源码

项目:incubator-netbeans    文件:FilterRepository.java   
public void load() throws IOException {
    filters.clear();
    active = -1;
    Preferences prefs = NbPreferences.forModule(FilterRepository.class);
    prefs = prefs.node("Filters"); //NOI18N
    active = prefs.getInt("active", -1);

    int count = prefs.getInt("count", 0); //NOI18N
    for (int i = 0; i < count; i++) {
        NotificationFilter filter = new NotificationFilter();
        try {
            filter.load(prefs, "Filter_" + i); //NOI18N
        } catch (BackingStoreException bsE) {
            throw new IOException("Cannot load filter repository", bsE);
        }
        filters.add(filter);
    }
}
项目:incubator-netbeans    文件:TaskSchedulingManager.java   
private void loadTasks() {
    Preferences pref = NbPreferences.forModule(TaskSchedulingManager.class);
    try {
        for (String key : pref.keys()) {
            if (key.startsWith(PREF_SCHEDULED)) {
                String repositoryId = key.substring(PREF_SCHEDULED.length());
                String tasks = pref.get(key, "");
                for (String taskId : tasks.split(SEP)) {
                    if (!taskId.isEmpty()) {
                        getRepositoryTasks(repositoryId).add(taskId);
                    }
                }
            }
        }
    } catch (BackingStoreException ex) {
        Logger.getLogger(TaskSchedulingManager.class.getName()).log(Level.INFO, null, ex);
    }
}
项目:incubator-netbeans    文件:M2RepositoryBrowser.java   
private M2RepositoryBrowser() {
    super(Children.create(new RootNodes(), true));
    setName(NAME);
    setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
    setShortDescription(HINT_M2RepositoryBrowserTopComponent());
    setIconBaseWithExtension(ICON_PATH);
    NbPreferences.root().node("org/netbeans/modules/maven/nexus/indexing").addPreferenceChangeListener(new PreferenceChangeListener() {

        @Override
        public void preferenceChange(PreferenceChangeEvent evt) {
            if (RepositoryPreferences.PROP_INDEX.equals(evt.getKey())) {
                setDisplayName(CTL_M2RepositoryBrowserTopComponent2(RepositoryPreferences.isIndexRepositories() ? "" : CTL_M2RepositoriesDisabled()));
            }
        }
    });
}
项目:incubator-netbeans    文件:DerbyDatabasesImpl.java   
/**
 * Registers in the Database Explorer the specified database
 * on the local Derby server.
 */
private  synchronized DatabaseConnection registerDatabase(String databaseName, String user, String schema, String password, boolean rememberPassword) throws DatabaseException {
    JDBCDriver drivers[] = JDBCDriverManager.getDefault().getDrivers(DerbyOptions.DRIVER_CLASS_NET);
    if (drivers.length == 0) {
        throw new IllegalStateException("The " + DerbyOptions.DRIVER_DISP_NAME_NET + " driver was not found"); // NOI18N
    }
    Preferences pref = NbPreferences.root().node(PATH_TO_DATABASE_PREFERENCES + databaseName);
    pref.put(USER_KEY, user == null ? "" : user);
    pref.put(SCHEMA_KEY, schema == null ? "" : schema);
    pref.put(PASSWORD_KEY, password == null ? "" : password);
    DatabaseConnection dbconn = DatabaseConnection.create(drivers[0], "jdbc:derby://localhost:" + RegisterDerby.getDefault().getPort() + "/" + databaseName, user, schema, password, rememberPassword); // NOI18N
    if (ConnectionManager.getDefault().getConnection(dbconn.getName()) == null) {
        ConnectionManager.getDefault().addConnection(dbconn);
    }
    notifyChange();
    return dbconn;
}
项目:incubator-netbeans    文件:BuildArtifactMapperImpl.java   
private static boolean protectAgainstErrors(URL targetFolder, FileObject[][] sources, Object context) throws MalformedURLException {
    Preferences pref = NbPreferences.forModule(BuildArtifactMapperImpl.class).node(BuildArtifactMapperImpl.class.getSimpleName());

    if (!pref.getBoolean(UIProvider.ASK_BEFORE_RUN_WITH_ERRORS, true)) {
        return true;
    }

    sources(targetFolder, sources);

    for (FileObject file : sources[0]) {
        if (ErrorsCache.isInError(file, true) && !alreadyWarned.contains(context)) {
            UIProvider uip = Lookup.getDefault().lookup(UIProvider.class);
            if (uip == null || uip.warnContainsErrors(pref)) {
                alreadyWarned.add(context);
                return true;
            }
            return false;
        }
    }

    return true;
}
项目:incubator-netbeans    文件:InstancePropertiesManager.java   
/**
 * Returns all existing properties created in the given namespace.
 *
 * @param namespace string identifying the namespace
 * @return list of all existing properties created in the given namespace
 */
public List<InstanceProperties> getProperties(String namespace) {
    Preferences prefs = NbPreferences.forModule(InstancePropertiesManager.class);

    try {
        prefs = prefs.node(namespace);
        prefs.flush();

        List<InstanceProperties> allProperties = new ArrayList<InstanceProperties>();
        synchronized (this) {
            for (String id : prefs.childrenNames()) {
                Preferences child = prefs.node(id);
                InstanceProperties props = cache.get(child);
                if (props == null) {
                    props = new DefaultInstanceProperties(id, this, child);
                    cache.put(child, props);
                }
                allProperties.add(props);
            }
        }
        return allProperties;
    } catch (BackingStoreException ex) {
        LOGGER.log(Level.INFO, null, ex);
        throw new IllegalStateException(ex);
    }
}
项目:incubator-netbeans    文件:FindDialogPanel.java   
/** Initializes the Form */
FindDialogPanel() {
    regExp = NbPreferences.forModule(Controller.class).getBoolean(KEY_REGEXP, false);
    matchCase = NbPreferences.forModule(Controller.class).getBoolean(KEY_MATCHCASE, false);
    initComponents();
    acceptButton = new JButton();
    Mnemonics.setLocalizedText(chbRegExp, NbBundle.getMessage(FindDialogPanel.class, "LBL_Use_RegExp"));
    Mnemonics.setLocalizedText(chbMatchCase, NbBundle.getMessage(FindDialogPanel.class, "LBL_Match_Case"));

    getAccessibleContext().setAccessibleName(NbBundle.getMessage(FindDialogPanel.class, "ACSN_Find"));
    getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FindDialogPanel.class, "ACSD_Find"));
    findWhat.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FindDialogPanel.class, "ACSD_Find_What"));
    acceptButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FindDialogPanel.class, "ACSD_FindBTN"));

    findWhat.setModel(new DefaultComboBoxModel(history));
    findWhat.getEditor().addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            acceptButton.doClick();
        }
    });
    findWhatLabel.setFocusable(false);
}
项目:incubator-netbeans    文件:PreferredProjectPlatform.java   
/**
 * Returns a preferred {@link JavaPlatform} for a new project.
 * @param platformType the platform type as specified by {@link Specification#getName()}
 * @return the preferred {@link JavaPlatform}
 */
@CheckForNull
public static JavaPlatform getPreferredPlatform(@NonNull final String platformType) {
    Parameters.notNull("platformType", platformType);   //NOI18N
    final String platformId = NbPreferences.forModule(PreferredProjectPlatform.class).get(
            MessageFormat.format(PREFERRED_PLATFORM, platformType),
            null);
    final JavaPlatformManager jpm = JavaPlatformManager.getDefault();
    if (platformId != null) {
        for (JavaPlatform jp : jpm.getInstalledPlatforms()) {
            if (platformId.equals(jp.getProperties().get(PLATFORM_ANT_NAME)) &&
                platformType.equals(jp.getSpecification().getName()) &&
                jp.isValid()) {
                return jp;
            }
        }
    }
    final JavaPlatform defaultPlatform = jpm.getDefaultPlatform();
    return platformType.equals(defaultPlatform.getSpecification().getName())?
           defaultPlatform:
           null;
}
项目:incubator-netbeans    文件:OptionsDisplayerImpl.java   
public void windowClosed(WindowEvent e) {
          optionsPanel.storeUserSize();
          // store location of dialog
          NbPreferences.forModule(OptionsDisplayerImpl.class).putInt("OptionsX", originalDialog.getX());//NOI18N
          NbPreferences.forModule(OptionsDisplayerImpl.class).putInt("OptionsY", originalDialog.getY());//NOI18N
   try {
FileUtil.getConfigRoot().getFileSystem().removeFileChangeListener(fcl);
   } catch (FileStateInvalidException ex) {
Exceptions.printStackTrace(ex);
   }
          if (optionsPanel.needsReinit()) {
              synchronized (lookupListener) {
                  descriptorRef = new WeakReference<DialogDescriptor>(null);
              }
          }
          if (this.originalDialog == dialog) {
              dialog = null;            
          }
          log.fine("Options Dialog - windowClosed"); //NOI18N
      }
项目:incubator-netbeans    文件:GoalsPanel.java   
/** Creates new form POMInheritancePanel */
@Messages("HINT_Panel_hide=Click or press {0} to hide/show when the Navigator is active")
public GoalsPanel() {
    initComponents();
    treeView = (BeanTreeView)jScrollPane1;
    preferences = NbPreferences.forModule(GoalsPanel.class).node("goalNavigator");
    filtersPanel = new TapPanel();
    filtersPanel.setOrientation(TapPanel.DOWN);
    // tooltip
    KeyStroke toggleKey = KeyStroke.getKeyStroke(KeyEvent.VK_T,
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask());
    String keyText = Utilities.keyToString(toggleKey);
    filtersPanel.setToolTipText(HINT_Panel_hide(keyText)); //NOI18N

    JComponent buttons = createFilterButtons();
    buttons.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
    filtersPanel.add(buttons);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) {
        filtersPanel.setBackground(UIManager.getColor("NbExplorerView.background"));//NOI18N
    } 

    add(filtersPanel, BorderLayout.SOUTH);

}
项目:incubator-netbeans    文件:CollapsibleSplitPane.java   
public void setDividerLocation(int location) {
    if (!((CustomSplitterUI)getUI()).isCollapsed()) {
        savedDividerLocation = location;
        NbPreferences.forModule(CollapsibleSplitPane.class).
                putInt(PREF_LOCATION, savedDividerLocation);
    }
    super.setDividerLocation(location);
}
项目:incubator-netbeans    文件:CombinationRSSFeed.java   
@Override
protected void clearCache() {
    try {
        NbPreferences.forModule( RSSFeed.class ).remove( url2path( new URL(url1))) ;
        NbPreferences.forModule( RSSFeed.class ).remove( url2path( new URL(url2))) ;
    } catch( MalformedURLException mE ) {
        //ignore
    }
}
项目:Pogamut3    文件:MapRenderer.java   
/**
 * If testedFlags has flag that according to preferences should be drawn,
 * draw it
 * @param flag
 * @return true if at least one of flags in testedFlag is set and preferences says that we should render it
 */
private synchronized boolean includeCanRenderPathFlag(int testedFlag) {
    for (MapFlag flag : MapFlag.values()) {
        // if tested flag has enabled the flag
        if ((flag.getFlag() & testedFlag) != 0) {
            // if it does, does user says we should render such paths
            boolean shouldRender = NbPreferences.forModule(TimelinePanel.class).getBoolean(flag.getPrefKey(), flag.getDefault());
            if (shouldRender) {
                return true;
            }
        }
    }
    return false;
}
项目:incubator-netbeans    文件:ConnectionManager.java   
void storeRecentConnectionsList() {
    Preferences prefs = NbPreferences.forModule(ConnectionManager.class);
    synchronized (recentConnections) {
        for (int i = 0; i < recentConnections.size(); i++) {
            prefs.put(getConnectoinsHistoryKey(i), ExecutionEnvironmentFactory.toUniqueID(recentConnections.get(i)));
        }
    }
}
项目:incubator-netbeans    文件:Model.java   
private Preferences getJavaModulePreferenes() {
    try {
        ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class);
        Class accpClass = cl.loadClass("org.netbeans.modules.editor.java.AbstractCamelCasePosition"); // NOI18N
        if (accpClass == null) {
            return null;
        }
        return NbPreferences.forModule(accpClass);
    } catch (ClassNotFoundException ex) {
        return null;
    }
}
项目:incubator-netbeans    文件:VersioningInfo.java   
/**
 * Shows a dialog listing all given versioning info properties.
 * @param properties
 */
public static void show (HashMap<File, Map<String, String>> properties) {
    PropertySheet ps = new PropertySheet();
    ps.setNodes(new VersioningInfoNode[] {new VersioningInfoNode(properties)});
    DialogDescriptor dd = new DialogDescriptor(ps, NbBundle.getMessage(VersioningInfo.class, "MSG_VersioningInfo_title"), //NOI18N
            true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
    Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
    dialog.addWindowListener(new DialogBoundsPreserver(NbPreferences.forModule(VersioningInfo.class), "versioning.util.versioningInfo")); //NOI18N
    dialog.setVisible(true);
}
项目:incubator-netbeans    文件:AbstractCamelCasePosition.java   
private boolean isUsingCamelCase() {
    Preferences p = NbPreferences.root ();
    if ( p == null ) {
        return false;
    }
    return p.getBoolean("useCamelCaseStyleNavigation", true); // NOI18N
}
项目:incubator-netbeans    文件:RegisterDerby.java   
/**
 * Check whether some non-standard arguments are needed to start JavaDB.
 *
 * @return String containing non-standard arguments, prefixed by a space
 * character (if not empty).
 */
private String startArgs() {

    Preferences prefs = NbPreferences.forModule(RegisterDerby.class);
    if (prefs.getBoolean(DISABLE_SECURITY_MANAGER, false)) {
        return " -noSecurityManager";                               //NOI18N
    } else {
        return "";                                                  //NOI18N
    }
}
项目:incubator-netbeans    文件:PasswordManager.java   
/**
 * Update password in memory. If user selected "remember password" option
 * before password is updated in Keyring.
 *
 * @param execEnv
 * @param password
 */
private void put(ExecutionEnvironment execEnv, char[] password) {
    String key = ExecutionEnvironmentFactory.toUniqueID(execEnv);
    if (keepPasswordsInMemory) {
        char[] old;
        if (password != null) {
            old = cache.put(key, Arrays.copyOf(password, password.length));
            Logger.getInstance().log(Level.FINEST, "PasswordManager.put({0}, non-null) stored password in memory", execEnv); // NOI18N
        } else {
            Logger.getInstance().log(Level.FINEST, "PasswordManager.put({0}, null) cleared password from memory", execEnv); // NOI18N
            old = cache.put(key, null);
        }
        if (old != null) {
            Arrays.fill(old, 'x');
        }
    }
    boolean store = NbPreferences.forModule(PasswordManager.class).getBoolean(STORE_PREFIX + key, false);
    if (store) {
        keyringIsActivated = true;
        if (password == null) {
            Keyring.delete(KEY_PREFIX + key);
        } else {
            Keyring.save(KEY_PREFIX + key, password,
                    NbBundle.getMessage(PasswordManager.class, "PasswordManagerPasswordFor", execEnv.getDisplayName())); // NOI18N
        }
        Logger.getInstance().log(Level.FINEST, "PasswordManager.put({0}, non-null) stored password in keyring", execEnv); // NOI18N
    }
}
项目:incubator-netbeans    文件:Filters.java   
public final void setNaturalSort(final boolean naturalSort) {        
    this.naturalSort = naturalSort;
    NbPreferences.forModule(this.getClass()).putBoolean( PROP_NATURAL_SORT, naturalSort );
    if( null != sortByNameButton ) {
        sortByNameButton.setSelected(!naturalSort);
    }
    if( null != sortByPositionButton ) {
        sortByPositionButton.setSelected(naturalSort);
    }
    sortUpdated();
}
项目:incubator-netbeans    文件:PasswordManager.java   
/**
 * Remove password from memory and Keyring
 *
 * @param execEnv
 */
public void clearPassword(ExecutionEnvironment execEnv) {
    String key = ExecutionEnvironmentFactory.toUniqueID(execEnv);
    if (keepPasswordsInMemory) {
        cache.remove(key);
    }
    NbPreferences.forModule(PasswordManager.class).remove(STORE_PREFIX + key);
    if (keyringIsActivated) {
        Keyring.delete(KEY_PREFIX + key);
    }
    Logger.getInstance().log(Level.FINEST, "PasswordManager.clearPassword({0})", execEnv); // NOI18N
}
项目:chipKIT-importer    文件:ProjectSetupPanel.java   
public ProjectSetupPanel(ProjectSetupStep control) {
    this.control = control;
    setName( NbBundle.getMessage(ProjectSetupPanel.class, "ProjectSetupPanel.title") );
    initComponents();
    encodingCombo.setModel(new EncodingModel(NbPreferences.root().get("DEFAULT_CHARSET", "ISO-8859-1"))); //NOI18N
    encodingCombo.setRenderer( new EncodingRenderer() );
}
项目:incubator-netbeans    文件:NbAuthenticatorPanel.java   
/** Creates new form AuthenticatorPanel */
public NbAuthenticatorPanel(String realmName) {
    this.realmName = realmName;
    initComponents();
    prefs = NbPreferences.forModule(NbAuthenticatorPanel.class).node("authentication"); // NOI18N
    keyringKey = "authentication." + realmName; // NOI18N
    String username = prefs.get(realmName, null);
    if (username != null) {
        userName.setText(username);
        char[] pwd = Keyring.read(keyringKey);
        if (pwd != null) {
            password.setText(new String(pwd));
        }
    }
}
项目:incubator-netbeans    文件:GsfUtilitiesTest.java   
public BaseDocument getDocument(String s) throws Exception {
    // These 3 lines are necessary to avoid BaseDocument's constructor
    // throwing preference-related initialization exceptions
    MockServices.setServices(MockMimeLookup.class);
    Preferences prefs = NbPreferences.root();
    MockMimeLookup.setInstances(MimePath.parse("text/plain"), prefs);

    BaseDocument doc = new BaseDocument(false, "text/plain");
    doc.insertString(0, s, null);
    return doc;
}
项目:incubator-netbeans    文件:ConfigurationsManager.java   
private void init() {
    Preferences prefs = NbPreferences.forModule(this.getClass());
    try {
        for (String kid:prefs.childrenNames()) {
            if (kid.startsWith(RULE_PREFIX)) {
                Preferences p = NbPreferences.forModule(this.getClass()).node(kid);
                String displayName = p.get("display.name", "unknown");
                create(kid.substring(RULE_PREFIX.length()), displayName);
            }
        }
    } catch (BackingStoreException ex) {
        Exceptions.printStackTrace(ex);
    }
    int configurationsVersion = prefs.getInt(KEY_CONFIGURATIONS_VERSION, 0);
    if (configs.isEmpty()) {
        create("default", NbBundle.getMessage(ConfigurationsManager.class, "DN_Default"));
        Configuration jdk7 = create("jdk7", NbBundle.getMessage(ConfigurationsManager.class, "DN_ConvertToJDK7"));
        jdk7.enable("Javac_canUseDiamond");
        jdk7.enable("org.netbeans.modules.java.hints.jdk.ConvertToStringSwitch");
        jdk7.enable("org.netbeans.modules.java.hints.jdk.ConvertToARM");
        jdk7.enable("org.netbeans.modules.java.hints.jdk.JoinCatches");
        // #215546 - requires user inspection
        // jdk7.enable("org.netbeans.modules.java.hints.jdk.UseSpecificCatch");
        //jdk7.enable("java.util.Objects");
    }
    if (configurationsVersion < 1 && !configurationExists("organizeImports")) {
        Configuration organizeImports = create("organizeImports", NbBundle.getMessage(ConfigurationsManager.class, "DN_OrganizeImports"));
        organizeImports.enable("org.netbeans.modules.java.hints.OrganizeImports");
    }
    prefs.putInt(KEY_CONFIGURATIONS_VERSION, CURRENT_CONFIGURATIONS_VERSION);
}
项目:Java-9-Programming-Blueprints    文件:SourceDirectoriesPanel.java   
protected void load() {
    String dirs = NbPreferences.forModule(PhotoManager.class).get("sourceDirs", "");
    if (dirs != null && !dirs.isEmpty()) {
        ensureModel();
        model.clear();
        Set<String> set = new HashSet<>(Arrays.asList(dirs.split(";")));
        set.forEach(i -> model.addElement(i));
    }
}
项目:NBANDROID-V2    文件:StatsCollector.java   
public void setEnabled(boolean enabled) {
    this.enabled = enabled;
    Preferences statsPrefs = NbPreferences.forModule(StatsCollector.class);
    statsPrefs.putBoolean("stats.enabled", enabled);
    try {
        statsPrefs.flush();
    } catch (BackingStoreException ex) {
        LOG.log(Level.FINE, null, ex);
    }
}
项目:NBANDROID-V2    文件:AdbConnectionsNode.java   
public static List<String> getConnections() {
    String connectionsIn = NbPreferences.forModule(AdbConnectionsNode.class).get("CONNECTIONS", "");
    StringTokenizer tokenizer = new StringTokenizer(connectionsIn, ";", false);
    List<String> connections = new ArrayList<>();
    while (tokenizer.hasMoreElements()) {
        connections.add(tokenizer.nextToken());

    }
    return connections;
}
项目:incubator-netbeans    文件:IntroduceHintTest.java   
@Override
protected void setUp() throws Exception {
    SourceUtilsTestUtil.prepareTest(new String[0], new Object[0]);
    super.setUp();
    codeStylePrefs = NbPreferences.root().node("test/java/codestyle");
    IntroduceHint.INSERT_CLASS_MEMBER = new InsertClassMember() {
        @Override public ClassTree insertClassMember(WorkingCopy wc, ClassTree clazz, Tree member, int offset) throws IllegalStateException {
            return GeneratorUtilities.get(wc).insertClassMember(clazz, member);
        }
    };
}
项目:incubator-netbeans    文件:UiOptions.java   
private static synchronized Preferences getNode() {
    if ( node == null ) {                
        Preferences p = NbPreferences.forModule(UiOptions.class);
        node = p.node(GO_TO_SYMBOL_DIALOG);
    }
    return node;
}
项目:incubator-netbeans    文件:PreferredProjectPlatform.java   
/**
 * Sets a preferred {@link JavaPlatform} for a new project.
 * @param platform the preferred {@link JavaPlatform}
 */
public static void setPreferredPlatform(@NonNull final JavaPlatform platform) {
    Parameters.notNull("platform", platform);   //NOI18N
    final String platformId = platform.getProperties().get(PLATFORM_ANT_NAME);
    if (platformId == null) {
        throw new IllegalArgumentException("Invalid platform, the platform has no platform.ant.name");  //NOI18N
    }
    final String platformType = platform.getSpecification().getName();
    NbPreferences.forModule(PreferredProjectPlatform.class).put(
            MessageFormat.format(PREFERRED_PLATFORM, platformType),
            platformId);
}
项目:incubator-netbeans    文件:PasswordManager.java   
/**
 * Store user intention of "remember password"
 *
 * @param execEnv
 * @param rememberPassword
 */
public void setRememberPassword(ExecutionEnvironment execEnv, boolean rememberPassword) {
    String key = ExecutionEnvironmentFactory.toUniqueID(execEnv);
    if (!rememberPassword) {
        if (keyringIsActivated) {
            Keyring.delete(KEY_PREFIX + key);
        }
    }
    NbPreferences.forModule(PasswordManager.class).putBoolean(STORE_PREFIX + key, rememberPassword);
}
项目:Pogamut3    文件:TimelinePanel.java   
void store() {
    Preferences pref = NbPreferences.forModule(TimelinePanel.class);

    // flags
    pref.putBoolean(MapFlag.WALK.getPrefKey(), walkFlagCheckBox.isSelected());
    pref.putBoolean(MapFlag.FLY.getPrefKey(), flyFlagCheckBox.isSelected());

    pref.putBoolean(MapFlag.SWIM.getPrefKey(), swimFlagCheckBox.isSelected());
    pref.putBoolean(MapFlag.JUMP.getPrefKey(), jumpFlagCheckBox.isSelected());

    pref.putBoolean(MapFlag.DOOR.getPrefKey(), doorFlagCheckBox.isSelected());
    pref.putBoolean(MapFlag.SPECIAL.getPrefKey(), specialFlagCheckBox.isSelected());

    pref.putBoolean(MapFlag.LADDER.getPrefKey(), ladderFlagCheckBox.isSelected());
    pref.putBoolean(MapFlag.PROSCRIBED.getPrefKey(), proscribedFlagCheckBox.isSelected());

    pref.putBoolean(MapFlag.FORCED.getPrefKey(), forcedFlagCheckBox.isSelected());
    pref.putBoolean(MapFlag.PLAYER_ONLY.getPrefKey(), playerOnlyFlagCheckBox.isSelected());

    // Low Color
    Color lowColor = this.lowColorArea.getBackground();
    pref.putInt(MapColor.LOW_COLOR_KEY.getPrefKey(), lowColor.getRGB());

    // High Color
    Color highColor = this.highColorArea.getBackground();
    pref.putInt(MapColor.HIGH_COLOR_KEY.getPrefKey(), highColor.getRGB());

    // Waypoints
    Color waypointsColor = this.waypointsColorArea.getBackground();
    pref.putInt(MapColor.WAYPOINTS_COLOR_KEY.getPrefKey(), waypointsColor.getRGB());

    pref.putBoolean(INCLUDE_FLAG_KEY, includeFlagsRadioButton.isSelected());
}
项目:incubator-netbeans    文件:FileAssociationsPanel.java   
void store() {
    newlyAddedExtensions.clear();
    // store file associations
    model.store();
    // store ignored files pattern
    IgnoredFilesPreferences.setIgnoredFiles(txtPattern.getText());
    IgnoredFilesPreferences.setIgnoreHiddenFilesInUserHome(ignoreHiddenInHome.isSelected());

    final Preferences nd = NbPreferences.root().node("org/openide/actions/FileSystemRefreshAction"); // NOI18N
    boolean manual = nd.getBoolean("manual", false);
    if (manual == autoScan.isSelected()) {
        nd.putBoolean("manual", !manual);  // NOI18N
    }
}
项目:incubator-netbeans    文件:RunAnalysisPanel.java   
private static DialogState load() {
    Preferences prefs = NbPreferences.forModule(RunAnalysisPanel.class).node("RunAnalysisPanel");
    return new DialogState(prefs.getBoolean("configurationsSelected", true),
                           prefs.get("selectedAnalyzer", null),
                           prefs.get("selectedConfiguration", null),
                           prefs.get("selectedInspection", null),
                           null);
}
项目:incubator-netbeans    文件:InspectAndRefactorPanel.java   
private void storePrefs() {
    if (prefsLoading)
        return;
    Preferences prefs = NbPreferences.forModule(InspectAndRefactorPanel.class);
    if (hintWrap == null) {
        prefs.putBoolean("InspectAndRefactorPanel.singleRefactorRadio", singleRefactorRadio.isSelected());
        prefs.putInt("InspectAndRefactorPanel.configurationCombo", configurationCombo.getSelectedIndex());
        prefs.putInt("InspectAndRefactorPanel.singleRefactoringCombo", singleRefactoringCombo.getSelectedIndex());
    }
    prefs.putInt("InspectAndRefactorPanel.scopeCombo", scopeCombo.getSelectedIndex());

}
项目:incubator-netbeans    文件:AlwaysEnabledActionTest.java   
@RandomlyFails // NB-Core-Build #3634: Expected to be selected (#2) from testNbPreferences.instance
    public void testPreferencesAction() throws Exception {
//        checkPreferencesAction("testSystemPreferences.instance", Preferences.systemRoot());
        checkPreferencesAction("testUserPreferences.instance", "user:", Preferences.userRoot());
        checkPreferencesAction("testNbPreferences.instance", "", NbPreferences.root());
        checkPreferencesAction("testCustomPreferences.instance", "user:", Preferences.userRoot()); // customPreferences() uses "myNode" subnode
    }
项目:NBANDROID-V2    文件:KeystoreSelector.java   
/**
 * Creates new form KeystoreSelector
 */
public KeystoreSelector(Project project) {
    initComponents();
    hash = "ANDROID_" + project.getProjectDirectory().getPath().hashCode();
    char[] keystorePasswd = Keyring.read(hash + KEY_STORE_PASSWORD);
    char[] keyPasswd = Keyring.read(hash + KEY_PASSWORD);
    if (keystorePasswd != null) {
        keystorePassword.setText(new String(keystorePasswd));
    }
    if (keyPasswd != null) {
        keyPassword.setText(new String(keyPasswd));
    }
    path.setText(NbPreferences.forModule(KeystoreSelector.class).get(hash + KEY_STORE_PATH, ""));
    alias.setText(NbPreferences.forModule(KeystoreSelector.class).get(hash + KEY_ALIAS, ""));
    v1.setSelected(NbPreferences.forModule(KeystoreSelector.class).getBoolean(hash + APK_V1, true));
    v2.setSelected(NbPreferences.forModule(KeystoreSelector.class).getBoolean(hash + APK_V2, true));
    release.setSelected(NbPreferences.forModule(KeystoreSelector.class).getBoolean(hash + APK_RELEASE, true));
    debug.setSelected(NbPreferences.forModule(KeystoreSelector.class).getBoolean(hash + APK_DEBUG, false));
    rememberPasswd.setSelected(NbPreferences.forModule(KeystoreSelector.class).getBoolean(hash + REMEMBER_PASSWORDS, true));
    path.addKeyListener(this);
    alias.addKeyListener(this);
    keystorePassword.addKeyListener(this);
    keyPassword.addKeyListener(this);
    v1.addActionListener(keyEmulatorListener);
    v2.addActionListener(keyEmulatorListener);
    debug.addActionListener(keyEmulatorListener);
    release.addActionListener(keyEmulatorListener);
    keyReleased(null);
}
项目:incubator-netbeans    文件:OthersRootNode.java   
@Override
public void actionPerformed(ActionEvent e) {
    boolean b = showAsPackages();
    Preferences prefs = NbPreferences.root().node(PREF_RESOURCES_UI); //NOI18N
    prefs.putBoolean(SHOW_AS_PACKAGES, !b); //NOI18N
    try {
        prefs.flush();
    } catch (BackingStoreException ex) {
        Exceptions.printStackTrace(ex);
    }
    ((OthersRootChildren)getChildren()).doRefresh();
}
项目:incubator-netbeans    文件:Configuration.java   
public Preferences getPreferences() {
//        Map<String, Preferences> override = HintsSettings.getPreferencesOverride();
//        if (override != null) {
//            Preferences p = override.get(getId());
//            if (p != null) {
//                return p;
//            }
//        }
        return NbPreferences.forModule(this.getClass()).node(getId()); //NOI18N
    }