Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ public abstract class TreeView extends JScrollPane {
/** Minimum height of this component. */
private static final int MIN_TREEVIEW_HEIGHT = 400;

private static final int WAIT_CURSOR_DELAY = 500;
private static final RequestProcessor WAIT_CURSOR_RP = new RequestProcessor("TreeView WaitCursor");

//
// components
//
Expand Down Expand Up @@ -962,17 +965,16 @@ private void prepareWaitCursor(final Node node) {
return;
}

showWaitCursor(true);
RequestProcessor.Task task = WAIT_CURSOR_RP.post(() -> showWaitCursor(true), WAIT_CURSOR_DELAY);
// not sure whenter throughput 1 is OK...
ViewUtil.uiProcessor().post(new Runnable() {
@Override
public void run() {
try {
node.getChildren().getNodesCount(true);
} catch (Exception e) {
// log a exception
LOG.log(Level.WARNING, null, e);
} finally {
ViewUtil.uiProcessor().post(() -> {
try {
node.getChildren().getNodesCount(true);
} catch (Exception e) {
// log a exception
LOG.log(Level.WARNING, null, e);
} finally {
if (!task.cancel()) {
// show normal cursor above all
showWaitCursor(false);
}
Expand Down