Package org.pocui.core.actions.progress

Examples of org.pocui.core.actions.progress.ProgressMonitor


        buttonFinish.addActionListener(buttonFinishActionListener = new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                try {
                    final ProgressMonitorDialog lvProgressMonitorDialog = new ProgressMonitorDialog();
                    final ProgressMonitor lvProgressMonitor = new ProgressMonitor();
                    lvProgressMonitor.addDialog(lvProgressMonitorDialog);

                    // Get and initialize the finish-action.
                    AbsAction<S, VoidSelection> lvFinishAction = getActionConfiguration().getPerformFinishAction();
                    lvFinishAction.setInSelection(getMask().getSelection());
                    final ActionWorker<VoidSelection> lvWorker = new ActionWorker<VoidSelection>(lvFinishAction, lvProgressMonitor);

                    //Listen for thread to finish, to be able to remove listener:
                    lvWorker.addPropertyChangeListener(new PropertyChangeListener() {

                        public void propertyChange(PropertyChangeEvent pvEvt) {
                            if (ActionWorker.StateValue.DONE.equals(pvEvt.getNewValue())) {
                                //Removing Listener(Dialog) from Monitor, if Action finished:
                                lvProgressMonitor.removeDialog(lvProgressMonitorDialog);
                                lvWorker.removePropertyChangeListener(this);

                                if (lvProgressMonitor.isCanceled()) {
                                    handlePerformFinishActionException(lvProgressMonitor.getCancelThrowable());
                                }

                                closeDialog();
                            }
                        }
View Full Code Here


        buttonFinish.addActionListener(buttonFinishActionListener = new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                try {
                    final ProgressMonitorDialog lvProgressMonitorDialog = new ProgressMonitorDialog(AbsSimpleDialog.this);
                    final ProgressMonitor lvProgressMonitor = new ProgressMonitor();
                    lvProgressMonitor.addDialog(lvProgressMonitorDialog);

                    // Get and initialize the finish-action.
                    AbsAction<S, VoidSelection> lvFinishAction = getActionConfiguration().getPerformFinishAction();
                    lvFinishAction.setInSelection(getMask().getSelection());
                    final ActionWorker<VoidSelection> lvWorker = new ActionWorker<VoidSelection>(lvFinishAction, lvProgressMonitor);

                    //Listen for thread to finish, to be able to remove listener:
                    lvWorker.addPropertyChangeListener(new PropertyChangeListener() {

                        public void propertyChange(PropertyChangeEvent pvEvt) {
                            if (ActionWorker.StateValue.DONE.equals(pvEvt.getNewValue())) {
                                //Removing Listener(Dialog) from Monitor, if Action finished:
                                lvProgressMonitor.removeDialog(lvProgressMonitorDialog);
                                lvWorker.removePropertyChangeListener(this);

                                if (lvProgressMonitor.isCanceled()) {
                                    handlePerformFinishActionException(lvProgressMonitor.getCancelThrowable());
                                }

                                closeDialog();
                            }
                        }
View Full Code Here

TOP

Related Classes of org.pocui.core.actions.progress.ProgressMonitor

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.