All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.internal.patchers.GwtPatcher Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
package com.googlecode.gwt.test.internal.patchers;

import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.googlecode.gwt.test.internal.handlers.GwtTestGWTBridge;
import com.googlecode.gwt.test.patchers.InitMethod;
import com.googlecode.gwt.test.patchers.PatchClass;
import com.googlecode.gwt.test.patchers.PatchMethod;
import javassist.CannotCompileException;
import javassist.CtClass;
import javassist.CtConstructor;

@PatchClass(GWT.class)
class GwtPatcher {

    @InitMethod
    static void init(CtClass ctClass) throws CannotCompileException {

        CtConstructor staticInitializer = ctClass.makeClassInitializer();

        staticInitializer.insertAfter("setBridge(" + GwtTestGWTBridge.class.getName() + ".get());");
    }

    @PatchMethod
    static void runAsyncImpl(final RunAsyncCallback callback) {
        callback.onSuccess();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy