SWT on JavaFX still worked on? [message #1738833] |
Mon, 25 July 2016 06:13  |
Eclipse User |
|
|
|
Hello,
SWT on JavaFX looks quite dead in the git repository. It looks like it is in prototype status and no one is working on it. Is it true? If so I would be interested in the reasons. Some blocker items in implementation? Scope grown much more then anticipiated? Lack of time/interest from developers?
Kind regards,
Arne
|
|
|
|
|
|
|
|
Re: SWT on JavaFX still worked on? [message #1739250 is a reply to message #1739244] |
Thu, 28 July 2016 18:30  |
Eclipse User |
|
|
|
One SWT feature I would quite like is BusyIndicator. My app is client-server, so I have quite a few situations where a user action is going to take a couple of seconds, long enough that I want to provide feedback to the user that something is happening, but not long enough that you really want to go asynchronous with a background task and a callback. Think of check-out/check-in operations in a version control system. The SWT BusyIndicator is very useful for this scenario, just updating the cursor until the Runnable finishes. I came up with the following as a JavaFX equivalent, but it doesn't seem to be all that reliable - quite often the wait cursor doesn't show at all, or only briefly at the end. I'm not sure if this is just a limitation of JavaFX or if there is a better way to do it.
public static void showWhile(Scene scene, Runnable runnable) {
Cursor cache = scene.getCursor();
scene.setCursor(Cursor.WAIT);
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
try {
Platform.runLater(runnable);
} finally {
Platform.runLater(() -> scene.setCursor(cache != null ? cache : Cursor.DEFAULT));
}
return null;
}
};
new Thread(task).start();
}
|
|
|
Powered by
FUDForum. Page generated in 0.03821 seconds