wtorek, 17 marca 2015

How to run a long operation with a spinner/hourglass indicator within eclipse plugin (swt application) ?

From time to time there is a need to run some relatively long operation synchronously. In such a case will be good to indicate the fact to the user. There is very simple way of doing this with BusyIndicator class. Just replace syncExec with BusyIndicator.showWhile.
Display.getCurrent().syncExec(new Runnable() {
    @Override
    public void run() {
           // long operation
    }
});
with the following:
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
    @Override
    public void run() {
           // long operation
    }
});

Brak komentarzy:

Prześlij komentarz