use of com.googlecode.gwt.test.patchers.PatchMethod in project gwt-test-utils by gwt-test-utils.
the class XMLParserImplPatcher method setAttribute.
@PatchMethod
static void setAttribute(JavaScriptObject o, String name, String value) {
PropertyContainer properties = JsoUtils.getDomProperties(o.<Element>cast());
properties.put(name, value);
}
use of com.googlecode.gwt.test.patchers.PatchMethod in project gwt-test-utils by gwt-test-utils.
the class AutomaticPatcher method findPatchMethod.
private CtMethod findPatchMethod(CtMethod m) throws Exception {
for (CtMethod patchMethod : patchMethods) {
PatchMethod annotation = (PatchMethod) patchMethod.getAnnotation(PatchMethod.class);
String methodName = (annotation.value().length() > 0) ? annotation.value() : patchMethod.getName();
if (m.getName().equals(methodName) && hasCompatibleSignature(m, patchMethod)) {
return patchMethod;
}
}
return null;
}
use of com.googlecode.gwt.test.patchers.PatchMethod in project gwt-test-utils by gwt-test-utils.
the class FormPanelPatcher method submit.
@PatchMethod
static void submit(FormPanel formPanel) {
FormPanel.SubmitEvent event = new FormPanel.SubmitEvent();
formPanel.fireEvent(event);
if (!event.isCanceled()) {
FormPanelImpl impl = GwtReflectionUtils.getPrivateFieldValue(formPanel, "impl");
Element synthesizedFrame = GwtReflectionUtils.getPrivateFieldValue(formPanel, "synthesizedFrame");
FormPanel.SubmitCompleteEvent completeEvent = createCompleteSubmitEvent(getResultsHtml(impl, synthesizedFrame));
formPanel.fireEvent(completeEvent);
}
}
use of com.googlecode.gwt.test.patchers.PatchMethod in project gwt-test-utils by gwt-test-utils.
the class TimerPatcher method scheduleRepeating.
@PatchMethod
static void scheduleRepeating(final Timer timer, int periodMillis) throws Exception {
if (periodMillis <= 0) {
throw new IllegalArgumentException("must be positive");
}
TIMER_HOLDER.cancel(timer);
java.util.Timer impl = new java.util.Timer();
TIMER_HOLDER.hold(timer, impl);
impl.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
timer.run();
}
}, periodMillis, periodMillis);
}
use of com.googlecode.gwt.test.patchers.PatchMethod in project gwt-test-utils by gwt-test-utils.
the class TimerPatcher method schedule.
@PatchMethod
static void schedule(final Timer timer, int delayMillis) throws Exception {
if (delayMillis <= 0) {
throw new IllegalArgumentException("must be positive");
}
TIMER_HOLDER.cancel(timer);
java.util.Timer impl = new java.util.Timer();
TIMER_HOLDER.hold(timer, impl);
impl.schedule(new TimerTask() {
@Override
public void run() {
timer.run();
}
}, delayMillis);
}
Aggregations