I am unable to update my UI even after wrapping all SWT code in "Display.getDefault().asyncExec
".
Let's assume I have listener which is called clicking on one button.
Listener enterlisner = new Listener() {
@Override
public void handleEvent(Event event)
{
Display.getDefault().asyncExec(new Runnable()
{
public void run()
{
try
{
if((event.keyCode == SWT.CR || event.keyCode == 13 || event.type == SWT.Selection) && btnAdd.isEnabled())
{
new ProgressMonitorDialog(shell).run(true, true, new IRunnableWithProgress()
{
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException,
InterruptedException
{
// method1()
// method2() {method2.1() , method2.2()}
// method3() {method3.1() , method3.2()}
// ....
// ...
// method10
}
});
}
}
catch (InvocationTargetException | InterruptedException e)
{
e.printStackTrace();
}
}
});
}
};
Could anyone please refer think link and let me know where I am wrong ?
How to bifurcate piece of methods that runs in a background thread ?