}
});
return;
}
// XXX attach Cancelable hook
final ProgressHandle ph = ProgressHandleFactory.createHandle(NbBundle.getMessage(VersioningPanel.class, "MSG_Refreshing_Versioning_View")); // NOI18N
try {
refreshViewThread = Thread.currentThread();
Thread.interrupted(); // clear interupted status
ph.start();
final SyncFileNode[] nodes = getNodes(context, displayStatuses); // takes long
if (nodes == null) {
return;
}
final String[] tableColumns;
final String branchTitle;
File[] files = context.getRootFiles().toArray(new File[context.getRootFiles().size()]);
if (files == null || files.length == 0) {
return;
/* #126311: begin Optimize UI for Large repos */
}
File root = git.getTopmostManagedParent(files[0]);
String[] info = getRepositoryBranchInfo(root);
if (info != null) {
branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_BranchTitle", info[0]);
} else {
branchTitle = NbBundle.getMessage(VersioningPanel.class, "CTL_VersioningView_UnnamedBranchTitle");
/* #126311: end */
}
if (nodes.length > 0) {
boolean stickyCommon = false;
for (int i = 1; i < nodes.length; i++) {
if (Thread.interrupted()) // TODO set model that displays that fact to user
{
return;
}
}
tableColumns = new String[]{SyncFileNode.COLUMN_NAME_NAME, SyncFileNode.COLUMN_NAME_STATUS, SyncFileNode.COLUMN_NAME_PATH};
} else {
tableColumns = null;
/* #126311: Optimize UI for Large repos */
}
setRepositoryBranchInfo(info != null ? info[1] : null);
/* end */
SwingUtilities.invokeLater(new Runnable() {
public void run() {
/* #126311: Optimize UI for Large repos */
parentTopComponent.setBranchTitle(branchTitle);
/* end */
if (nodes.length > 0) {
syncTable.setColumns(tableColumns);
setVersioningComponent(syncTable.getComponent());
} else {
setVersioningComponent(noContentComponent);
}
syncTable.setTableModel(nodes);
// finally section, it's enqueued after this request
}
});
} finally {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
ph.finish();
}
});
}
}