Package pdfdb.settings

Examples of pdfdb.settings.UserSettingsManager


     * @param doc The document to attempt to decrypt.
     * @return True if successful */
    private boolean getPasswordFromUser(PDDocument doc) {
        boolean carryOn = true;
        boolean decrypted = false;
        UserSettingsManager manager = UserSettingsManager.getInstance();
        boolean savePsw = Boolean.parseBoolean(manager.get("SAVE_PASSWORDS"));
        if (savePsw) {
            while (!decrypted && carryOn) {
                carryOn = showDialog(false);
                decrypted = tryDecrypt(doc, dialog.getPassword());
            }
View Full Code Here


    }

    /** Loads settings from the configuration file.*/
    private void initFromSettings()
    {
        UserSettingsManager manager = UserSettingsManager.getInstance();
        String searchLocation = manager.get("SEARCH_LOCATION");
        String servicesLocation = manager.get("SERVICES_LOCATION");
        boolean savePswd = false;
        savePswd = Boolean.getBoolean(manager.get("SAVE_PASSWORDS"));
        init(searchLocation, savePswd, servicesLocation);
    }
View Full Code Here

        valid = valid && servicesLocation.exists() && servicesLocation.isFile();

        if (valid)
        {
            // Save
            UserSettingsManager manager = UserSettingsManager.getInstance();
            manager.set("SEARCH_LOCATION", searchLocation.getAbsolutePath());
            manager.set("SERVICES_LOCATION", servicesLocation.getAbsolutePath());
            manager.set("SAVE_PASSWORDS", String.valueOf(savePswd));
            manager.save();
            setResult(APPROVED);
            setVisible(false);
        }
        else
        {
View Full Code Here

    }

    /** Initializes the size of the frame from configuration settings. */
    private void initSize()
    {
        UserSettingsManager manager = UserSettingsManager.getInstance();
        String sHeight = manager.get(KEY_HEIGHT);
        String sWidth = manager.get(KEY_WIDTH);
        String sX = manager.get(KEY_X);
        String sY = manager.get(KEY_Y);
        Dimension dim = null;
        Point p = null;
        boolean error = false;

        if (sHeight == null || sWidth == null || sX == null || sY == null)
View Full Code Here

    /** Registers a shutdown and return's the shutdown query. If this is
     * the fifth shutdown, then the database is compacted.
     * @return The shutdown SQL. */
    private static String registerShutdown()
    {
        UserSettingsManager settings = UserSettingsManager.getInstance();
        try
        {
            String command = "SHUTDOWN";
            String compactCommand = " COMPACT";
            String curr = settings.get("SHUTDOWN");
            boolean fifthShutdown = curr == null ? false : curr.equals("5");
            return fifthShutdown ? command + compactCommand : command;
        }
        finally
        {
View Full Code Here

    /** Shuts down the panel when notified of a shutdown */
    public void shutdown()
    {
        try
        {
            UserSettingsManager manager = UserSettingsManager.getInstance();
            Dimension dim = this.getSize();
            String width = String.valueOf(dim.width);
            String height = String.valueOf(dim.height);
            String x = String.valueOf(getX());
            String y = String.valueOf(getY());
            manager.set(KEY_WIDTH, width);
            manager.set(KEY_HEIGHT, height);
            manager.set(KEY_X, x);
            manager.set(KEY_Y, y);
            manager.save();
        }
        catch (IOException ex)
        {
            ex.printStackTrace();
        }
View Full Code Here

TOP

Related Classes of pdfdb.settings.UserSettingsManager

Copyright © 2018 www.massapicom. 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.