📄 textboxhandlerforrawtextcomponent.java
字号:
package org.uispec4j;
import junit.framework.Assert;
import org.uispec4j.assertion.Assertion;
import javax.swing.text.JTextComponent;
class TextBoxHandlerForRawTextComponent extends AbstractTextBoxHandlerForTextComponent {
public TextBoxHandlerForRawTextComponent(JTextComponent textComponent) {
super(textComponent);
}
public Assertion textIsEmpty() {
return new Assertion() {
public void check() {
String actualText = jTextComponent.getText();
Assert.assertTrue("Text should be empty but contains: " + actualText,
actualText.length() == 0);
}
};
}
public Assertion textEquals(final String text) {
return "".equals(text) ? textIsEmpty() :
new Assertion() {
public void check() {
Assert.assertEquals(text, jTextComponent.getText());
}
};
}
public void clickOnHyperlink(String link) {
Assert.fail("This component does not support hyperlinks.");
}
public Assertion htmlEquals(String html) {
return new Assertion() {
public void check() {
Assert.fail("This component does not support html.");
}
};
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -