com.vaadin.ui.Button.getCaption()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(10.5k)|赞(0)|评价(0)|浏览(111)

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

Button.getCaption介绍

暂无

代码示例

代码示例来源:origin: uk.q3c.krail/krail

@Override
public String getActionLabel() {
  return login_logout_Button.getCaption();
}

代码示例来源:origin: viritin/viritin

public String getNewEntityCaption() {
  return newInstanceBtn.getCaption();
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

public String getClearButtonCaption() {
  return clearButton.getCaption();
}

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

@Override
  public void writeDesign(Element design, DesignContext designContext) {
    super.writeDesign(design, designContext);
    Attributes attr = design.attributes();
    Button def = designContext.getDefaultInstance(this);
    String content = getCaption();
    if (content != null) {
      design.html(content);
    }
    // plain-text (default is html)
    if (!isHtmlContentAllowed()) {
      design.attr(DESIGN_ATTR_PLAIN_TEXT, true);
      // encode HTML entities
      if (content != null) {
        design.html(DesignFormatter.encodeForTextNode(content));
      }
    }
    // icon-alt
    DesignAttributeHandler.writeAttribute("icon-alt", attr,
        getIconAlternateText(), def.getIconAlternateText(),
        String.class, designContext);
    // click-shortcut
    if (clickShortcut != null) {
      DesignAttributeHandler.writeAttribute("click-shortcut", attr,
          clickShortcut, null, ShortcutAction.class, designContext);
    }
  }
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

@Override
public void buttonClick(final ClickEvent event) {
  buttonClicked = event.getButton();
  if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.UNKNOWN.toString())) {
    processUnknownFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.IN_SYNC.toString())) {
    processInSyncFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.PENDING.toString())) {
    processPendingFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.ERROR.toString())) {
    processErrorFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.REGISTERED.toString())) {
    processRegisteredFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(OVERDUE_CAPTION)) {
    processOverdueFilterStatus();
  }
}

代码示例来源:origin: eclipse/hawkbit

@Override
public void buttonClick(final ClickEvent event) {
  buttonClicked = event.getButton();
  if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.UNKNOWN.toString())) {
    processUnknownFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.IN_SYNC.toString())) {
    processInSyncFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.PENDING.toString())) {
    processPendingFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.ERROR.toString())) {
    processErrorFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(TargetUpdateStatus.REGISTERED.toString())) {
    processRegisteredFilterStatus();
  } else if (event.getButton().getCaption().equalsIgnoreCase(OVERDUE_CAPTION)) {
    processOverdueFilterStatus();
  }
}

代码示例来源:origin: org.opennms.features.topology/org.opennms.features.topology.app

private static Button createButton(GraphContainer container, Breadcrumb breadcrumb) {
  final Button button = new Button();
  final String layerName = getLayerName(container, breadcrumb.getTargetNamespace());
  if (breadcrumb.getSourceVertices().isEmpty()) {
    button.setCaption(layerName);
  } else {
    String sourceLayerName = getLayerName(container, breadcrumb.getSourceVertices().get(0).getNamespace());
    if (breadcrumb.getSourceVertices().size() > 2) {
      button.setCaption("Multiple " + layerName);
      button.setDescription(String.format("Multiple vertices from %s", sourceLayerName));
    } else {
      button.setCaption(breadcrumb.getSourceVertices().stream().map(VertexRef::getLabel).collect(Collectors.joining(", ")));
      button.setDescription(String.format("%s from %s", button.getCaption(), sourceLayerName));
    }
  }
  button.addStyleName(BaseTheme.BUTTON_LINK);
  button.addClickListener((event) -> breadcrumb.clicked(container));
  return button;
}

代码示例来源:origin: OpenNMS/opennms

private static Button createButton(GraphContainer container, Breadcrumb breadcrumb) {
  final Button button = new Button();
  final String layerName = getLayerName(container, breadcrumb.getTargetNamespace());
  if (breadcrumb.getSourceVertices().isEmpty()) {
    button.setCaption(layerName);
  } else {
    String sourceLayerName = getLayerName(container, breadcrumb.getSourceVertices().get(0).getNamespace());
    if (breadcrumb.getSourceVertices().size() > 2) {
      button.setCaption("Multiple " + layerName);
      button.setDescription(String.format("Multiple vertices from %s", sourceLayerName));
    } else {
      button.setCaption(breadcrumb.getSourceVertices().stream().map(VertexRef::getLabel).collect(Collectors.joining(", ")));
      button.setDescription(String.format("%s from %s", button.getCaption(), sourceLayerName));
    }
  }
  button.addStyleName(BaseTheme.BUTTON_LINK);
  button.addClickListener((event) -> breadcrumb.clicked(container));
  return button;
}

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

String caption1 = ((Button) o1).getCaption().toLowerCase();
String caption2 = ((Button) o2).getCaption().toLowerCase();
return caption1.compareTo(caption2);

代码示例来源:origin: nz.co.senanque/madura-vaadin

public void register(final Button field, ButtonPainter painter)
{
  MaduraPropertyWrapper property = painter.getProperty();        
  ButtonProperty bp = new ButtonProperty(painter,field.getCaption(),m_messageSource);
  field.setData(bp);
  if (property != null)
  {
    Hints hints = getHints();
    hints.setCommonProperties(field, property,m_messageSource);
    setPermissions(property, field);
  }
  registerWidget(field);
}

代码示例来源:origin: nz.co.senanque/madura-vaadinsupport

public void register(final Button field, ButtonPainter painter)
{
  MaduraPropertyWrapper property = painter.getProperty();        
  ButtonProperty bp = new ButtonProperty(painter,field.getCaption(),m_messageSource);
  field.setPropertyDataSource(bp);
  if (property != null)
  {
    Hints hints = getHints();
    hints.setCommonProperties(field, property,m_messageSource);
    setPermissions(property, field);
  }
  registerWidget(field);
}

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

private Button createFilterButton(final Long id, final String name, final String description, final String color,
    final Object itemId) {
  /**
   * No icon displayed for "NO TAG" button.
   */
  final Button button = SPUIComponentProvider.getButton("", name, description, "", false, null,
      SPUITagButtonStyle.class);
  button.setId(createButtonId(name));
  button.setCaptionAsHtml(true);
  if (id != null) {
    // Use button.getCaption() since the caption name is modified
    // according to the length
    // available in UI.
    button.setCaption(prepareFilterButtonCaption(button.getCaption(), color));
  }
  if (!StringUtils.isEmpty(description)) {
    button.setDescription(description);
  } else {
    button.setDescription(name);
  }
  button.setData(id == null ? SPUIDefinitions.NO_TAG_BUTTON_ID : itemId);
  return button;
}

代码示例来源:origin: eclipse/hawkbit

private Button createFilterButton(final Long id, final String name, final String description, final String color,
    final Object itemId) {
  /**
   * No icon displayed for "NO TAG" button.
   */
  final Button button = SPUIComponentProvider.getButton("", name, description, "", false, null,
      SPUITagButtonStyle.class);
  button.setId(createButtonId(name));
  button.setCaptionAsHtml(true);
  if (id != null) {
    // Use button.getCaption() since the caption name is modified
    // according to the length
    // available in UI.
    button.setCaption(prepareFilterButtonCaption(button.getCaption(), color));
  }
  if (!StringUtils.isEmpty(description)) {
    button.setDescription(description);
  } else {
    button.setDescription(name);
  }
  button.setData(id == null ? SPUIDefinitions.NO_TAG_BUTTON_ID : itemId);
  return button;
}

代码示例来源:origin: KrailOrg/krail

@Test
public void interpret_de() {
  String confirmValueOk = "Bestätigen Sie, dass dieser Wert in Ordnung ist";
  // given
  currentLocale.setLocale(Locale.GERMANY);
  // when
  processor.translate(testObject);
  // then
  assertThat(testObject.getButtonWithAnnotation()
      .getCaption()).isEqualTo("OK");
  assertThat(testObject.getButtonWithAnnotation()
      .getDescription()).isEqualTo(confirmValueOk);
  assertThat(testObject.getButtonWithAnnotation()
      .getLocale()).isEqualTo(Locale.GERMANY);
  assertThat(testObject.getLabel()
      .getCaption()).isEqualTo("OK");
  assertThat(testObject.getLabel()
      .getDescription()).isEqualTo(confirmValueOk);
  // assertThat(testObject.getLabel().getValue()).isEqualTo("Ok");
  assertThat(testObject.getButtonWithAnnotation()
      .getLocale()).isEqualTo(Locale.GERMANY);
}

代码示例来源:origin: KrailOrg/krail

.getCaption()).isEqualTo("Authentication");
    .getCaption()).isEqualTo("Ok");
assertThat(testObject.getButtonWithAnnotation()
    .getDescription()).isEqualTo("Confirm this Value is Ok");
assertThat(specificLocale.getCaption()).isEqualTo("Ja");

代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor

private void 캐시_갯수에_따라_메뉴가_생성되는가_CASE_2(String cache1, String cache2) {
    Menu menu = new Menu(this.navigator, this.cacheManager);

    Component component = menu.getComponent(0);
    assertTrue(component instanceof CssLayout);
    CssLayout menuPart = (CssLayout) component;

    Component component2 = menuPart.getComponent(2);
    assertTrue(component2 instanceof CssLayout);
    CssLayout menuItemsLayout = (CssLayout) component2;

    assertEquals(3, menuItemsLayout.getComponentCount());

    Component component3 = menuItemsLayout.getComponent(0);
    assertTrue(component3 instanceof Button);
    Button allButton = (Button) component3;
    assertEquals("전체", allButton.getCaption());

    Component component4 = menuItemsLayout.getComponent(1);
    assertTrue(component4 instanceof Button);
    Button cacheButton1 = (Button) component4;
    assertEquals(cache1, cacheButton1.getCaption());

    Component component5 = menuItemsLayout.getComponent(2);
    assertTrue(component5 instanceof Button);
    Button cacheButton2 = (Button) component5;
    assertEquals(cache2, cacheButton2.getCaption());
  }
}

代码示例来源:origin: kingbbode/spring-boot-ehcache-monitor

private void 캐시_갯수에_따라_메뉴가_생성되는가_CASE_1(String cache1) {
  Menu menu = new Menu(this.navigator, this.cacheManager);
  Component component = menu.getComponent(0);
  assertTrue(component instanceof CssLayout);
  CssLayout menuPart = (CssLayout) component;
  Component component2 = menuPart.getComponent(2);
  assertTrue(component2 instanceof CssLayout);
  CssLayout menuItemsLayout = (CssLayout) component2;
  assertEquals(2, menuItemsLayout.getComponentCount());
  Component component3 = menuItemsLayout.getComponent(0);
  assertTrue(component3 instanceof Button);
  Button allButton = (Button) component3;
  assertEquals("전체", allButton.getCaption());
  Component component4 = menuItemsLayout.getComponent(1);
  assertTrue(component4 instanceof Button);
  Button cacheButton1 = (Button) component4;
  assertEquals(cache1, cacheButton1.getCaption());
}

相关文章