X

Geertjan's Blog

  • March 24, 2016

Skeleton Node Hierarchy with Progress Handling on GitHub

Geertjan Wielenga
Product Manager

The same as yesterday, a skeleton node hierarchy, though this time different progress handling solutions are included:

https://github.com/GeertjanWielenga/SkeletonNodeHierarchyWithProgress

In Level1ChildFactory, keys are created like this, which causes the application to grey out and the application becomes modal during the processing:

@Override
protected boolean createKeys(final List list) {
BaseProgressUtils.showProgressDialogAndRun(new Runnable() {
@Override
public void run() { during
try {
Thread.sleep(10000);
list.add("one");
} catch (InterruptedException ex) {
Exceptions.printStackTrace(ex);
}
}
}, "Processing Level 1...");
return true;
}

In Level2ChildFactory, a different approach is provided, which kicks off the progress bar:

@Override
protected boolean createKeys(List list) {
String msg = "Processing Level 2...";
ProgressHandle handle = ProgressHandleFactory.createSystemHandle(msg);
handle.start();
try {
Thread.sleep(10000);
list.add("two");
} catch (InterruptedException ex) {
Exceptions.printStackTrace(ex);
}
handle.finish();
return true;
}

In Level3ChildFactory, the default behavior, when "true" is passed into the ChildFactory call, is that the cursor turns into a spinning busy icon, while no progress bar of any kind is shown:

@Override
protected boolean createKeys(List list) {
try {
Thread.sleep(10000);
list.add("three");
} catch (InterruptedException ex) {
Exceptions.printStackTrace(ex);
}
return true;
}

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.