Package org.jdesktop.application

Examples of org.jdesktop.application.ApplicationContext


        findDialog.pack();
        if (location == null) {
            // the first time creation in this app's life-cycle
            findDialog.setLocationRelativeTo(owner);
            Application application = Application.getInstance(Application.class);
            ApplicationContext appContext = application.getContext();
            try {
                if (application instanceof SingleXFrameApplication) {
                    ((SingleXFrameApplication) application).prepareDialog(findDialog, false);
                } else {
                    appContext.getSessionStorage().restore(findDialog, "findDialog.session.xml");
                }
            }
            catch (IOException e) {
                LOG.log(Level.WARNING, "couldn't restore sesssion", e);
            } catch (SecurityException e) {
View Full Code Here


        }
        // Restore session state
        String filename = sessionFilename(root);
        if (filename != null) {
            try {
                ApplicationContext ac = getContext();
                ac.getSessionStorage().restore(root, filename);
            } catch (Exception e) {
                logger.log(Level.WARNING, "couldn't restore sesssion", e);
            }
        }
        root.addWindowListener(getDialogListener());
View Full Code Here

    }

    private void saveSession(Window window) {
        String filename = sessionFilename(window);
        if (filename != null) {
            ApplicationContext appContext = getContext();
            try {
                appContext.getSessionStorage().save(window, filename);
            }
            catch (IOException e) {
                logger.log(Level.WARNING, "couldn't save sesssion", e);
            } catch (SecurityException e) {
                logger.log(Level.WARNING, "couldn't save sesssion", e);
View Full Code Here

     * Deletes the session state by deleting the file. Useful during development
     * when restoring to old state is not always the desired behaviour.
     * Pending: this is incomplete, deletes the mainframe state only.
     */
    protected void deleteSessionState() {
        ApplicationContext context = getContext();
        try {
            context.getLocalStorage().deleteFile("mainFrame.session.xml");
        } catch (IOException e) {
            logger.log(Level.WARNING, "couldn't delete sesssion", e);
        } catch (SecurityException e) {
            logger.log(Level.WARNING, "couldn't delete sesssion", e);
        }
View Full Code Here

TOP

Related Classes of org.jdesktop.application.ApplicationContext

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.