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();
}