Skip to content

Commit 969fe64

Browse files
author
jossonsmith
committed
Support net.sf.j2s.ajax.junit.AsyncSWT#waitLayout with native JavaScript.
For more details, please read net.sf.j2s.test.swt/ajaxjunit
1 parent f96ef78 commit 969fe64

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

sources/net.sf.j2s.core/src/net/sf/j2s/core/astvisitors/SWTScriptVisitor.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,19 @@ protected String[] getFilterMethods() {
354354
*/
355355
public boolean visit(MethodInvocation node) {
356356
IMethodBinding methodBinding = node.resolveMethodBinding();
357+
if ("net.sf.j2s.ajax.junit.AsyncSWT".equals(methodBinding.getDeclaringClass().getQualifiedName())
358+
&& "waitLayout".equals(methodBinding.getName())) {
359+
metSWTBlockWhile = true;
360+
node.getExpression().accept(this);
361+
buffer.append(".waitLayout (");
362+
Expression shellExp = (Expression) node.arguments().get(0);
363+
shellExp.accept(this);
364+
buffer.append(", ");
365+
Expression runnableExp = (Expression) node.arguments().get(1);
366+
runnableExp.accept(this);
367+
buffer.append(", this, function () {\r\n//");
368+
return false;
369+
}
357370
String[] filterMethods = getFilterMethods();
358371
for (int i = 0; i < filterMethods.length; i += 2) {
359372
if (isMethodInvoking(methodBinding, filterMethods[i], filterMethods[i + 1])) {

0 commit comments

Comments
 (0)