Package java.util.prefs

Examples of java.util.prefs.Preferences.keys()


    try
    {
      final Properties props = new Properties();
      final Preferences pref = base.node(configPath);
      final String[] keysArray = pref.keys();
      for (int i = 0; i < keysArray.length; i++)
      {
        final String key = keysArray[i];
        final String value = pref.get(key, null);
        if (value != null)
View Full Code Here


            keyPattern = new LabelPattern(KEY_PATTERN);
            Preferences pre = Preferences.userNodeForPackage
                (net.sf.jabref.labelPattern.LabelPattern.class);
            try {
                String[] keys = pre.keys();
            if (keys.length > 0) for (int i=0; i<keys.length; i++)
                keyPattern.addLabelPattern(keys[i], pre.get(keys[i], null));
            } catch (BackingStoreException ex) {
                Globals.logger("BackingStoreException in JabRefPreferences.getKeyPattern");
            }
View Full Code Here

            if (p.nodeExists("currentDataVersion")) {
                log.warn("Migrating database versions from preferences to properties file in "
                                + ContextHolder.getContext().getDBDirectory().getAbsolutePath() + ".");
                versions = new Properties();
                p = p.node("currentDataVersion");
                String[] c = p.keys();
                for (int i = 0; i < c.length; i++) {
                    versions.put(c[i], p.get(c[i], ""));
                }
                FileOutputStream fos = new FileOutputStream(versionsFile);
                try {
View Full Code Here

      System.setProperty("JDBCPreferences.driverName", getManager().getCurrentProperty("Pooka._jdbcWizard.selection.driver", ""));
      System.setProperty("JDBCPreferences.url",  getManager().getCurrentProperty("Pooka._jdbcWizard.selection.url", ""));
      System.setProperty("JDBCPreferences.user",  getManager().getCurrentProperty("Pooka._jdbcWizard.selection.user", ""));
      System.setProperty("JDBCPreferences.password",  net.suberic.util.gui.propedit.PasswordEditorPane.descrambleString(getManager().getCurrentProperty("Pooka._jdbcWizard.selection.password", "")));
      Preferences p = Preferences.userNodeForPackage(this.getClass());
      p.keys();
      System.setProperty("useJdbcConnection", "true");
    } catch (Exception e) {
      throw new PropertyValueVetoException("Pooka._jdbcWizard.selection.driver", getManager().getCurrentProperty("Pooka._jdbcWizard.selection.driver", ""), e.getMessage(), null);
    }
  }
View Full Code Here

            }
            else {
                InitialFrameState = Frame.NORMAL;
            }
            // Restore the RecentFile list:
            String[] keys = prefs.keys();
            Map<Integer, File> recentMap = new HashMap<Integer, File>();
            for (String key : keys) {
                if (key.startsWith(RecentFileTag)) {
                    String indexString = key.substring(RecentFileTag.length());
                    try {
View Full Code Here

                if (file != null) {
                    addToRecentFiles(file);
                }
            }
            // Restore the RecentFolder list:
            keys = prefs.keys();
            recentMap = new HashMap<Integer, File>();
            for (String key : keys) {
                if (key.startsWith(RecentFolderTag)) {
                    String indexString =
                        key.substring(RecentFolderTag.length());
View Full Code Here

        public void restore() {
            Preferences prefs = Preferences.userNodeForPackage(LoggerTableModel.class);
            prefs = prefs.node("loggerTable");

            try {
                for (String loggerName : prefs.keys()) {
                    Level level = Level.parse(prefs.get(loggerName, "WARNING"));
                    Logger createLogger = Logger.getLogger(loggerName);
                    createLogger.setLevel(level);

                    // OWF issue #130: hold a strong reference to the created
View Full Code Here

        assertEquals("8value", mock1.get("/K/E\\Y\\abc~@!#$%^&*(\\", null));
        assertNull(mock1.get("/k/e/y", null));
        assertEquals("7value", mock1.get("/K/E/Y", null));
        assertEquals("1value", mock1.get("key", null));

        String[] keys = mock1.keys();
        assertEquals(4, keys.length);
        for (int i = 0; i < keys.length; i++) {
            String key = keys[i];
            assertTrue("key".equals(key) || "KEY".equals(key)
                    || "/K/E/Y".equals(key)
View Full Code Here

        continue;
      }

      final long authTime = authNode.getLong(VERSION_KEY, 0);
      final DataHolder<T> data = new DataHolder<T>(create(url, authTime));
      final String[] options = authNode.keys();
      for (int j = 0; j < options.length; j++)
      {
        final String option = options[j];
        if (option.startsWith("#"))
        {
View Full Code Here

    try
    {
      final Properties props = new Properties();
      final Preferences pref = base.node(configPath);
      final String[] keysArray = pref.keys();
      for (int i = 0; i < keysArray.length; i++)
      {
        final String key = keysArray[i];
        final String value = pref.get(key, null);
        if (value != null)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.