- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.github.bordertech.wcomponents.WText
类的一些代码示例,展示了WText
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WText
类的具体详情如下:
包路径:com.github.bordertech.wcomponents.WText
类名称:WText
[英]WText is used to render some basic/raw text.
[中]WText用于呈现一些基本/原始文本。
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* @param margin the margin to include on the panel.
* @return the panel with a margin.
*/
private WPanel createPanel(final Margin margin) {
WText text = new WText(DUMMY_TEXT);
text.setEncodeText(false);
WPanel panel = new WPanel(WPanel.Type.BOX);
panel.add(text);
panel.setMargin(margin);
return panel;
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testSanitizeOnOutput() {
WText text = new WText("<form>content</form>");
text.setSanitizeOnOutput(true);
text.setEncodeText(false);
Assert.assertEquals("Expect output to be sanitized", "content", text.getText());
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* Override of preparePaintComponent to set the dynamic (user specific) text.
*
* @param request the request being responded to.
*/
@Override
public void preparePaintComponent(final Request request) {
String dateStr = "The current date is " + new Date();
dynamicText.setText(dateStr);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* @return a String representation of this component, for debugging purposes.
*/
@Override
public String toString() {
String text = getText();
text = text == null ? "null" : ('"' + text + '"');
return toString(text);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
@Override
public void execute(final ActionEvent event) {
ajaxContent.setText(before.equals(ajaxContent.getText()) ? after : before);
}
});
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* Creates a SimpleListRenderer.
*/
public SimpleListRenderer() {
WText name = new WText();
WText type = new WText();
WText thing = new WText();
name.setBeanProperty("name");
type.setBeanProperty("type");
thing.setBeanProperty("thing");
WFieldLayout fields = new WFieldLayout();
fields.addField("Name", name);
fields.addField("Type", type);
fields.addField("Thing", thing);
add(fields);
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-addons-table
/**
* @param label the column label
*/
public AbstractTableColumn(final String label) {
this(null, label, new WText(), null);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* applySettings creates the WCollapsible, and loads it into the container.
*/
private void applySettings() {
// reset the container.
container.reset();
// create the new collapsible.
WText component1 = new WText("Here is some text that is collapsible via ajax.");
WCollapsible collapsible1 = new WCollapsible(component1, "Collapsible",
(CollapsibleMode) rbCollapsibleSelect.getSelected());
collapsible1.setCollapsed(cbCollapsed.isSelected());
collapsible1.setVisible(cbVisible.isSelected());
if (collapsible1.getMode() == CollapsibleMode.DYNAMIC) {
component1.setText(component1.getText() + "\u00a0Generated on " + new Date());
}
if (drpHeadingLevels.getSelected() != null) {
collapsible1.setHeadingLevel((HeadingLevel) drpHeadingLevels.getSelected());
}
// add the new collapsible to the container.
container.add(collapsible1);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testGetText() {
WText wtf = new WText();
String defaultText = "Dflt";
String myText = "MyText";
wtf.setText(defaultText);
Assert.assertEquals("Incorrect default text", defaultText, wtf.getText());
// Set test for a users session
wtf.setLocked(true);
setActiveContext(createUIContext());
wtf.setText(myText);
Assert.assertEquals("Should have session text", myText, wtf.getText());
resetContext();
Assert.assertEquals("Should have default text", defaultText, wtf.getText());
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testNoSanitizeOnOutput() {
String input = "<form>content</form>";
WText text = new WText(input);
text.setEncodeText(false);
Assert.assertEquals("Expect output to not be sanitized", input, text.getText());
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testEncodeText() throws IOException, SAXException, XpathException {
String value = "T1<b>T2</b>T3";
String encoded = WebUtilities.encode(value);
WText text = new WText();
text.setText(value);
// Encoded (default)
String xml = toXHtml(text);
Assert.assertTrue("XML should have encoded text", xml.contains(encoded));
// Not encoded
text.setEncodeText(false);
xml = toXHtml(text);
Assert.assertTrue("XML should have not encoded text", xml.contains(value));
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
beanBoundText.setBeanProperty("beanAttribute");
beanProviderBoundText.setBeanProperty("innerBean.innerAttribute");
add(button2);
beanProviderBoundText.setBeanProvider(new ExampleBeanProvider());
add(new WText("•"));
add(new WHeading(HeadingLevel.H2, "Unencoded text containing a HTML character entity"));
WText unescapedWithEntity = new WText("•");
unescapedWithEntity.setEncodeText(false);
add(unescapedWithEntity);
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testIsDefaultState() {
String defaultText = "Dflt";
String myText = "MyText";
WText wtf = new WText(defaultText);
wtf.setLocked(true);
setActiveContext(createUIContext());
Assert.assertTrue("Should be in default state by default", wtf.isDefaultState());
wtf.setText(myText);
Assert.assertFalse("Should not be in default state after setting different text", wtf.
isDefaultState());
wtf.setText(defaultText);
Assert.assertTrue("Should be in default state after setting text to default text", wtf.
isDefaultState());
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testConstructor1() {
WText content = new WText();
WFigure figure = new WFigure(content, "label");
WText txt = (WText) figure.getDecoratedLabel().getBody();
Assert.assertEquals("Constructor - Incorrect label", "label", txt.getText());
Assert.assertSame("Constructor - Incorrect content", content, figure.getContent());
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* test remove - child from shared list.
*/
@Test
public void testRemoveCommon() {
AbstractWComponent comp = new MockContainer();
WText text1 = new WText("XYZ");
WText text2 = new WText("ABC");
comp.add(text1);
comp.add(text2);
comp.remove(text1); // from shared list
Assert.assertNull("shared should not contain text1", text1.getParent());
Assert.assertSame("shared should contain text2", text2, comp.getChildAt(0));
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
WText text = new WText();
text.setText(getInvalidCharSequence());
assertSafeContent(text);
text.setText(getMaliciousContent());
assertSafeContent(text);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* {@inheritDoc}
*/
@Override
public String getText() {
return super.getText() + " generated at: " + new Date();
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* Construct example.
*/
public WSessionExample() {
WMessages messages = new WMessages(true);
messages
.info("If \"ui:session\" is supported by the theme, wait 180 seconds to see a warning message and then a session expired message.");
add(messages);
WText txtSession = new WText() {
@Override
public String getText() {
return "<ui:session timeout=\"180\" />";
}
};
txtSession.setEncodeText(false);
add(txtSession);
}
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples
/**
* Creates a WDropdownSubmitOnChangeExample.
*/
public WDropdownSubmitOnChangeExample() {
actMessage.setEncodeText(false);
add(new ExplanatoryText("Any form control component which is not a WButton will show a visible warning in its label if its "
+ "submitOnChange property is set true."));
WFieldLayout flay = new WFieldLayout();
add(flay);
flay.setLabelWidth(25);
flay.setMargin(new Margin(null, null, Size.LARGE, null));
flay.addField("State", stateSelector).getLabel().setHint("Selecting a state will update the available regions.");
flay.addField("Region", regionSelector);
// Used to test control of visibility as part of submit on change.
add(actMessage);
actMessage.setVisible(false);
stateSelector.setOptions(new String[]{null, STATE_ACT, STATE_NSW, STATE_VIC});
//This is the flag which causes accessibility problems. It may be removed completely in future versions of WComponents.
//you should use AJAX instead
stateSelector.setSubmitOnChange(true);
stateSelector.setActionOnChange(new Action() {
@Override
public void execute(final ActionEvent event) {
updateRegion();
regionSelector.resetData();
}
});
regionSelector.setSubmitOnChange(true);
}
代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core
/**
* Paints the given WText.
*
* @param component the WText to paint.
* @param renderContext the RenderContext to paint to.
*/
@Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WText text = (WText) component;
XmlStringBuilder xml = renderContext.getWriter();
String textString = text.getText();
if (textString != null) {
if (text.isEncodeText()) {
xml.print(WebUtilities.encode(textString));
} else {
// If we are outputting unencoded content it must be XML valid.
xml.print(HtmlToXMLUtil.unescapeToXML(textString));
}
}
}
}
这个问题在这里已经有了答案: 关闭 11 年前。 Possible Duplicate: Sample data for IPv6? 除了 wireshark 在其网站上提供的内容之外,是否有可以下
我正在寻找可以集成到现有应用程序中并使用多拖放功能的示例或任何现成的解决方案。我在互联网上找到的大多数解决方案在将多个项目从 ListBox 等控件拖放到另一个 ListBox 时效果不佳。谁能指出我
我是 GATE Embedded 的新手,我尝试了简单的示例并得到了 NoClassDefFoundError。首先我会解释我尝试了什么 在 D:\project\gate-7.0 中下载并提取 Ga
是否有像 Eclipse 中的 SWT 示例那样的多合一 JFace 控件示例?搜索(在 stackoverflow.com 上使用谷歌搜索和搜索)对我没有帮助。 如果它是一个独立的应用程序或 ecl
我找不到任何可以清楚地解释如何通过 .net API(特别是 c#)使用谷歌计算引擎的内容。有没有人可以指点我什么? 附言我知道 API 引用 ( https://developers.google.
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
最近在做公司的一个项目时,客户需要我们定时获取他们矩阵系统的数据。在与客户进行对接时,提到他们的接口使用的目前不常用的BASIC 认证。天呢,它好不安全,容易被不法人监听,咋还在使用呀。但是没办法呀,
我正在尝试为我的应用程序设计配置文件格式并选择了 YAML。但是,这(显然)意味着我需要能够定义、解析和验证正确的 YAML 语法! 在配置文件中,必须有一个名为 widgets 的集合/序列。 .这
你能给我一个使用 pysmb 库连接到一些 samba 服务器的例子吗?我读过有类 smb.SMBConnection.SMBConnection(用户名、密码、my_name、remote_name
linux服务器默认通过22端口用ssh协议登录,这种不安全。今天想做限制,即允许部分来源ip连接服务器。 案例目标:通过iptables规则限制对linux服务器的登录。 处理方法:编
我一直在寻找任何 PostProjectAnalysisTask 工作代码示例,但没有看。 This页面指出 HipChat plugin使用这个钩子(Hook),但在我看来它仍然使用遗留的 Po
我发现了 GWT 的 CustomScrollPanel 以及如何自定义滚动条,但我找不到任何示例或如何设置它。是否有任何示例显示正在使用的自定义滚动条? 最佳答案 这是自定义 native 滚动条的
我正在尝试开发一个 Backbone Marionette 应用程序,我需要知道如何以最佳方式执行 CRUD(创建、读取、更新和销毁)操作。我找不到任何解释这一点的资源(仅适用于 Backbone)。
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题?通过 editing this post 添加详细信息并澄清问题. 去年关闭。 Improve this
我需要一个提交多个单独请求的 django 表单,如果没有大量定制,我找不到如何做到这一点的示例。即,假设有一个汽车维修店使用的表格。该表格将列出商店能够进行的所有可能的维修,并且用户将选择他们想要进
我有一个 Multi-Tenancy 应用程序。然而,这个相同的应用程序有 liquibase。我需要在我的所有数据源中运行 liquibase,但是我不能使用这个 Bean。 我的应用程序.yml
我了解有关单元测试的一般思想,并已在系统中发生复杂交互的场景中使用它,但我仍然对所有这些原则结合在一起有疑问。 我们被警告不要测试框架或数据库。好的 UI 设计不适合非人工测试。 MVC 框架不包括一
我正在使用 docjure并且它的 select-columns 函数需要一个列映射。我想获取所有列而无需手动指定。 如何将以下内容生成为惰性无限向量序列 [:A :B :C :D :E ... :A
$condition使用说明和 $param在 findByAttributes在 Yii 在大多数情况下,这就是我使用 findByAttributes 的方式 Person::model()->f
我在 Ubuntu 11.10 上安装了 qtcreator sudo apt-get install qtcreator 安装的版本有:QT Creator 2.2.1、QT 4.7.3 当我启动
我是一名优秀的程序员,十分优秀!