Package uk.gov.nationalarchives.droid.gui.action

Examples of uk.gov.nationalarchives.droid.gui.action.CloseProfileAction


    /**
     * Closes a profile.
     */
    public void closeProfile() {
        CloseProfileAction closeAction = new CloseProfileAction(droidMainUi.getProfileManager(), context, this);
        JOptionPaneProxy dialog = new JOptionPaneProxy() {
            @Override
            public int getResponse() {
                int result = JOptionPane.showConfirmDialog(ProfileForm.this, "Save this profile?", "Warning",
                        JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);

                int response = JOptionPaneProxy.CANCEL;
                if (result == JOptionPane.YES_OPTION) {
                    response = JOptionPaneProxy.YES;
                } else if (result == JOptionPane.NO_OPTION) {
                    response = JOptionPaneProxy.NO;
                }

                return response;
            }
        };

        closeAction.setUserOptionDialog(dialog);
        final JFileChooser fileChooser = context.getProfileFileChooser();
        FileChooserProxy chooserProxy = new FileChooserProxyImpl(this, fileChooser);
        closeAction.setSaveAction(new SaveProfileWorker(droidMainUi.getProfileManager(), this, chooserProxy));
        closeAction.start();
    }
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.gui.action.CloseProfileAction

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.