gpt4 book ai didi

com.github.bordertech.wcomponents.WText.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 18:37:05 26 4
gpt4 key购买 nike

本文整理了Java中com.github.bordertech.wcomponents.WText.<init>()方法的一些代码示例,展示了WText.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WText.<init>()方法的具体详情如下:
包路径:com.github.bordertech.wcomponents.WText
类名称:WText
方法名:<init>

WText.<init>介绍

[英]Creates an empty WText.
[中]

代码示例

代码示例来源: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-core

/**
 * Creates a decorated label with a WText as the body content, containing the given text.
 *
 * @param text the label's text, using {@link MessageFormat} syntax.
 * @param args optional arguments for the message format string.
 */
public WDecoratedLabel(final String text, final Serializable... args) {
  this(null, new WText(text, args), null);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-examples

/**
   * Creates a BoxComponent with the specified text.
   *
   * @param text the text to display in the box.
   */
  BoxComponent(final String text) {
    super(WPanel.Type.BOX);
    add(new WText(text));
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * Creates a new WMenuItem with the specified text.
 *
 * @param text the menu item's text.
 */
public WMenuItem(final String text) {
  this(new WDecoratedLabel());
  label.setBody(new WText(text));
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testRendererCorrectlyConfigured() {
  WText text = new WText();
  Assert.assertTrue("Incorrect renderer supplied",
      getWebXmlRenderer(text) instanceof WTextRenderer);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test(expected = IllegalArgumentException.class)
public void testAddComponentTagAlreadyAdded() {
  WTemplate template = new WTemplate();
  template.addTaggedComponent("tag", new WText());
  template.addTaggedComponent("tag", new WText());
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
   * @param content the test content
   */
  public TestComp(final String content) {
    WText text = new WText(content);
    text.setEncodeText(false);
    add(text);
  }
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
  WCollapsible collapsible = new WCollapsible(new WText("dummy"), getMaliciousContent(),
      WCollapsible.CollapsibleMode.CLIENT);
  assertSafeContent(collapsible);
}

代码示例来源: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(expected = SystemException.class)
public void testRenderToHtmlWithPlainText() {
  String msg = "Test error message";
  WText text = new WText(msg);
  // Text will fail as it is not valid XML
  String output = WebUtilities.renderWithTransformToHTML(new MockRequest(), text, false);
  Assert.assertEquals("Invalid html output returned", msg, output);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testDoRenderDynamicCollapse() throws IOException, SAXException, XpathException {
  WCollapsible collapsible = new WCollapsible(new WText(COLLAPSIBLE_CONTENT),
      COLLAPSIBLE_HEADING, WCollapsible.CollapsibleMode.DYNAMIC);
  assertSchemaMatch(collapsible);
  assertXpathEvaluatesTo("dynamic", "//ui:collapsible/@mode", collapsible);
  assertRenderContentCorrectly(collapsible, false, true);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testMarginAccessors() {
  WCollapsible collapsible = new WCollapsible(new WText(""), "",
      WCollapsible.CollapsibleMode.CLIENT);
  assertAccessorsCorrect(collapsible, "margin", null, new Margin(1), new Margin(2));
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testXssEscaping() throws IOException, SAXException, XpathException {
  WFigure figure = new WFigure(new WText(getMaliciousContent()), getMaliciousContent());
  assertSafeContent(figure);
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testConstructor2() {
  WText wText = new WText("sample text");
  WButton trigger = new WButton("trigger");
  WDialog dialog = new WDialog(wText, trigger);
  Assert.assertEquals("Content should be set", wText, dialog.getContent());
  Assert.assertEquals("Trigger should be set", trigger, dialog.getTrigger());
  Assert.assertTrue("Has trigger should be true", dialog.hasLegacyTriggerButton());
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * Creates a new tabset with all the tab types.
 *
 * @return a new tabset with content.
 */
private static WTabSet createTabSet() {
  WTabSet tabSet = new WTabSet();
  for (WTabSet.TabMode mode : WTabSet.TabMode.values()) {
    tabSet.addTab(new WText(mode + " content"), mode + " tab", mode);
  }
  return tabSet;
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testRenderToHtmlWithXML() {
  WText text = new WText(TransformXMLTestHelper.TEST_XML);
  text.setEncodeText(false);
  // Dont use PageShell as it wraps the XML with ui:root and test xslt does not pass the other tags
  String output = WebUtilities.renderWithTransformToHTML(new MockRequest(), text, false);
  Assert.assertEquals("Invalid html output with XML", TransformXMLTestHelper.EXPECTED, output);
}
@Test

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testGetGroupName() {
  WCollapsible collapsible = new WCollapsible(new WText(""), "");
  Assert.assertEquals("Incorrect group name", collapsible.getId(), collapsible.getGroupName());
  CollapsibleGroup group = new CollapsibleGroup();
  collapsible.setGroup(group);
  Assert.
      assertEquals("Incorrect group name", group.getGroupName(), collapsible.
          getGroupName());
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

@Test
public void testGetTabLabel() {
  final String labelText = "this is a label";
  WContainer component = new WContainer();
  component.add(new WText("this is some text"));
  WDecoratedLabel label = new WDecoratedLabel(labelText);
  WTab tab = new WTab(component, label, WTabSet.TabMode.CLIENT);
  Assert.assertEquals("should get decorated label set in constructor", label, tab.
      getTabLabel());
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * @return a simple WList for use in this test.
 */
private static WList createSampleWList() {
  WText nameRenderer = new WText();
  nameRenderer.setBeanProperty("name");
  WList list = new WList(WList.Type.STACKED);
  list.setSeparator(WList.Separator.DOT);
  list.setRenderBorder(false);
  list.setRepeatedComponent(nameRenderer);
  return list;
}

代码示例来源:origin: com.github.bordertech.wcomponents/wcomponents-core

/**
 * @param template the template to setup
 */
private void setupTemplate(final WTemplate template) {
  template.setIdName(TEST_ID);
  template.addTaggedComponent("child1", new WText(CHILD_TEXT));
  template.addParameter("mytest", PARAMETER_TEXT);
  template.setBean(new TestBean(FIRST_NAME, LAST_NAME));
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com