Synchronous calls inside the UIThread are made by invoking the execInsideUISync{}
method. This method is equivalent to calling edt{}
in Swing.Example:class MyController {
def model def action1 = {
// will be invoked inside the UI thread by default (pre 0.9.2)
def value = model.value
Thread.start {
// do some calculations
execInsideUISync {
// back inside the UI thread
model.result = …
}
}
} def action2 = {
// will be invoked outside of the UI thread by default (post 0.9.2)
def value = model.value
// do some calculations
execInsideUISync {
// back inside the UI thread
model.result = …
}
}
}