Package frost.util.gui

Examples of frost.util.gui.FrostSwingWorker


    public void startDialog() {

        startProgressMonitor(3);

        // disables mainframe
        final FrostSwingWorker worker = new FrostSwingWorker(parent) {
            @Override
            protected void doNonUILogic() throws RuntimeException {

                progressMonitor.setProgress(1);
                if( progressMonitor.isCanceled() ) {
                    return;
                }

                // query ALL data for all identities, each InnerTableMember gets its values from the complete list
                Hashtable<String,IdentitiesStorage.IdentityMsgAndFileCount> idDatas;
                if( !IdentitiesStorage.inst().beginExclusiveThreadTransaction() ) {
                    return;
                }

                idDatas = IdentitiesStorage.inst().retrieveMsgAndFileCountPerIdentity();

                IdentitiesStorage.inst().endThreadTransaction();

                progressMonitor.setProgress(2);
                if( progressMonitor.isCanceled() ) {
                    return;
                }

                allTableMembers = new LinkedList<InnerTableMember>(); // remember all table data for filter
                final List<Identity> allIdentities = Core.getIdentities().getIdentities();
                // show own identities also
                allIdentities.addAll(Core.getIdentities().getLocalIdentities());
                for( final Identity identity : allIdentities ) {
                    final InnerTableMember memb = new InnerTableMember(identity, idDatas);
                    tableModel.addRow(memb);
                    allTableMembers.add(memb);
                }

                progressMonitor.setProgress(3);

                idDatas.clear();
            }
            @Override
            protected void doUIUpdateLogic() throws RuntimeException {
                updateTitle();
                showDialog();
            }
        };
        worker.start();
    }
View Full Code Here

TOP

Related Classes of frost.util.gui.FrostSwingWorker

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.