Package java.util.prefs

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


        boolean resizable = true;
        boolean fullScreen = false;

        try {
            Preferences preferences = Preferences.userNodeForPackage(DesktopApplicationContext.class);
            preferences = preferences.node(applicationClassName);

            x = preferences.getInt(X_ARGUMENT, x);
            y = preferences.getInt(Y_ARGUMENT, y);
            width = preferences.getInt(WIDTH_ARGUMENT, width);
            height = preferences.getInt(HEIGHT_ARGUMENT, height);
View Full Code Here


        if (!cancelShutdown) {
            if (windowedHostFrame.getExtendedState() == 0) {
                try {
                    Preferences preferences = Preferences.userNodeForPackage(DesktopApplicationContext.class);
                    preferences = preferences.node(applicationClassName);

                    preferences.putInt(X_ARGUMENT, windowedHostFrame.getX());
                    preferences.putInt(Y_ARGUMENT, windowedHostFrame.getY());
                    preferences.putInt(WIDTH_ARGUMENT, windowedHostFrame.getWidth());
                    preferences.putInt(HEIGHT_ARGUMENT, windowedHostFrame.getHeight());
View Full Code Here

                prefsBase = (Preferences) pathElem;
            } else {
                if (pathElem instanceof Class)
                    pathElem = ((Class) pathElem).getName().replace('.', '/');
                if (pathElem != null)
                    prefsBase = prefsBase.node(pathElem.toString());
            }
        }
        this.prefsBase = prefsBase;

        // initialize the list of registered items
View Full Code Here

        if ((args.length == 2) && args[1].equals("all")) {
            System.out.println("Performing a full clean - will attempt to scrub everything...");
            Preferences topNode = Preferences.userRoot().node(PREFERENCE_NODE_PARENT);
            for (String childNode : topNode.childrenNames()) {
                if (childNode.startsWith("spawn")) {
                    topNode.node(childNode).removeNode();
                }
            }

            purge(getSpawnDirectory(), true);
        }
View Full Code Here

        }
        Preferences node = getPreferences().node(PROPERTY_WINDOW);
        if (!node.nodeExists(window.getName())) {
          return;
        }
        node = node.node(window.getName());
        window.setLocation(
            node.getInt(PROPERTY_WINDOW_X, 0),
            node.getInt(PROPERTY_WINDOW_Y, 0));
        boolean restoreSize = true;
        if (window instanceof Versionned) {
View Full Code Here

  public void saveWindowPosition(Window window) {
    if (getBoolean(null, ConfigurationValueBoolean.SAVE_WINDOW) &&
        (window != null) &&
        (getPreferences() != null)) {
      Preferences node = getPreferences().node(PROPERTY_WINDOW);
      node = node.node(window.getName());
      node.putInt(PROPERTY_WINDOW_X, window.getX());
      node.putInt(PROPERTY_WINDOW_Y, window.getY());
      node.putInt(PROPERTY_WINDOW_W, window.getWidth());
      node.putInt(PROPERTY_WINDOW_H, window.getHeight());
      Integer version = null;
View Full Code Here

    // update preference values with values from file
    try {
      String[] children = prefs.childrenNames();
      for (int i = 0; i < children.length; i++) {
        processPref (em, prefs.node (children [i]), null, categories);
      }
    }
    catch (BackingStoreException exc) {
      myLog.error ("importPrefs", exc);
    }
View Full Code Here

  private Preferences getForId(Preferences root, String id) {
    Assert.notNull(root);
    Preferences result = root;
    String[] idParts = id.split("\\.");
    for (int i = 0; i < idParts.length; i++) {
      result = result.node(idParts[i]);
    }
    return result;
  }

  public Settings createSettings(String name) {
View Full Code Here

        }

        if (!cancelShutdown) {
            try {
                Preferences preferences = Preferences.userNodeForPackage(DesktopApplicationContext.class);
                preferences = preferences.node(applicationClassName);

                boolean maximized = (windowedHostFrame.getExtendedState()
                    & java.awt.Frame.MAXIMIZED_BOTH) == java.awt.Frame.MAXIMIZED_BOTH;
                if (!maximized) {
                    preferences.putInt(X_ARGUMENT, windowedHostFrame.getX());
View Full Code Here

        boolean fullScreen = false;
        boolean preserveSplashScreen = false;

        try {
            Preferences preferences = Preferences.userNodeForPackage(DesktopApplicationContext.class);
            preferences = preferences.node(applicationClassName);

            x = preferences.getInt(X_ARGUMENT, x);
            y = preferences.getInt(Y_ARGUMENT, y);
            width = preferences.getInt(WIDTH_ARGUMENT, width);
            height = preferences.getInt(HEIGHT_ARGUMENT, height);
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.