📄 modalinterceptioncheckerhandler.java
字号:
package org.uispec4j.interception.handlers;
import junit.framework.Assert;
import org.uispec4j.Window;
public class ModalInterceptionCheckerHandler extends AbstractInterceptionHandlerDecorator {
private boolean shouldBeModal;
public ModalInterceptionCheckerHandler(InterceptionHandler innerHandler, boolean shouldBeModal) {
super(innerHandler);
this.shouldBeModal = shouldBeModal;
}
public void process(Window window) {
if (!shouldBeModal) {
if (window.isModal().isTrue()) {
Assert.fail("Window '" + window.getTitle() + "' is modal, it must be intercepted with a WindowHandler");
}
}
else {
if (!window.isModal().isTrue()) {
Assert.fail("Window '" + window.getTitle() + "' is non-modal, it must be intercepted with WindowInterceptor.run(Trigger)");
}
}
super.process(window);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -