com.vaadin.v7.ui.Label.getValue()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(133)

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

Label.getValue介绍

[英]Gets the value of the label.

The value of the label is the text that is shown to the end user. Depending on the ContentMode it is plain text or markup.
[中]获取标签的值。
标签的值是显示给最终用户的文本。根据内容模式,它是纯文本或标记。

代码示例

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

private String getComparableValue() {
  String stringValue = getValue();
  if (stringValue == null) {
    stringValue = "";
  }
  if (getContentMode() == ContentMode.HTML
      || getContentMode() == ContentMode.XML) {
    return stripTags(stringValue);
  } else {
    return stringValue;
  }
}

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

@Override
public void writeDesign(Element design, DesignContext designContext) {
  super.writeDesign(design, designContext);
  String content = getValue();
  if (content != null) {
    switch (getContentMode()) {

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void displayFileNameWithoutExtension() throws IOException {
  // GIVEN
  BasicUploadField<UploadReceiver> uploadField = new BasicUploadField<UploadReceiver>(null, null, new BasicUploadFieldDefinition(), simpleTranslator);
  receiver.setFileName("me.jpg");
  Property<UploadReceiver> property = new ObjectProperty<UploadReceiver>(receiver);
  // WHEN
  uploadField.setPropertyDataSource(property);
  // THEN
  Label label = (Label) uploadField.getFileDetailFileName();
  assertEquals("me", label.getValue());
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void testAddComponent() {
  // GIVEN
  Label firstLeft = new Label("M");
  Label secondLeft = new Label("A");
  Label firstCentered = new Label("G");
  Label secondCentered = new Label("N");
  Label thirdLeftThenRight = new Label("O");
  Label secondRight = new Label("L");
  Label firstRight = new Label("IA");
  final StringBuilder result = new StringBuilder();
  // WHEN
  view.addComponent(firstLeft, Alignment.MIDDLE_LEFT); // M
  view.addComponent(firstRight, Alignment.MIDDLE_RIGHT); // M IA
  view.addComponent(firstCentered, Alignment.MIDDLE_CENTER); // M G IA
  view.addComponent(secondLeft, Alignment.MIDDLE_LEFT); // M A G IA
  view.addComponent(secondCentered, Alignment.MIDDLE_CENTER); // M A G N IA
  view.addComponent(secondRight, Alignment.MIDDLE_RIGHT); // M A G N L IA
  view.addComponent(thirdLeftThenRight, Alignment.MIDDLE_LEFT); // M A O G N L IA
  view.addComponent(thirdLeftThenRight, Alignment.MIDDLE_RIGHT); // M A G N O L IA
  Iterator<Component> it = view.getComponentIterator();
  while (it.hasNext()) {
    result.append(((Label) it.next()).getValue());
  }
  // THEN
  assertEquals(7, view.getComponentCount());
  assertNotNull(result);
  assertEquals("MAGNOLIA", result.toString());
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void testVerificationPassword() {
  // GIVEN
  definition.setVerification(true);
  // WHEN
  PasswordFields field = (PasswordFields) passwordFieldFactory.createField();
  // THEN
  assertEquals(true, field.getVerticalLayout().getComponent(1) instanceof PasswordField);
  assertEquals(true, field.getVerticalLayout().getComponent(2) instanceof Label);
  assertEquals("Please confirm", ((Label) field.getVerticalLayout().getComponent(2)).getValue().toString());
  assertEquals(true, field.getVerticalLayout().getComponent(3) instanceof PasswordField);
}

相关文章