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

x33g5p2x  于2022-01-23 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(118)

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

Label.setId介绍

暂无

代码示例

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

private Label createLabel() {
  final Label label = new Label(name);
  label.setVisible(visible);
  final StringBuilder style = new StringBuilder(ValoTheme.LABEL_SMALL);
  style.append(' ');
  style.append(ValoTheme.LABEL_BOLD);
  label.addStyleName(style.toString());
  if (id != null) {
    label.setId(id);
  }
  return label;
}

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

private Label createLabel() {
  final Label label = new Label(name);
  label.setVisible(visible);
  final StringBuilder style = new StringBuilder(ValoTheme.LABEL_SMALL);
  style.append(' ');
  style.append(ValoTheme.LABEL_BOLD);
  label.addStyleName(style.toString());
  if (id != null) {
    label.setId(id);
  }
  return label;
}

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

private void setIds() {
  this.setId(ID.getId(Optional.empty(), this));
  label.setId(ID.getId(Optional.empty(), this, label));
}

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

@Override
public void setIds() {
  super.setIds();
  grid.setId(ID.getId(Optional.empty(), this, grid));
  label.setId(ID.getId(Optional.empty(), this, label));
}

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

private void setIds() {
  setId(ID.getId(Optional.empty(), this));
  login_logout_Button.setId(ID.getId(Optional.empty(), this, login_logout_Button));
  usernameLabel.setId(ID.getId(Optional.empty(), this, usernameLabel));
}

代码示例来源:origin: stackoverflow.com

Label label=new Label(msg);
   label.getStylesheets().add("sample/styles/send.css");
   label.setId("send");
   HBox hBox=new HBox();
   hBox.getChildren().add(label);
   hBox.setAlignment(Pos.BASELINE_LEFT);
   vBox.getChildren().add(hBox);
   vBox.setSpacing(10);

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

@Override
protected void setIds() {
  super.setIds();
  submitButton.setId(ID.getId(Optional.empty(), this, submitButton));
  submitButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
  submitButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
  usernameBox.setId(ID.getId(Optional.of("username"), this, usernameBox));
  passwordBox.setId(ID.getId(Optional.of("password"), this, passwordBox));
  statusMsgLabel.setId(ID.getId(Optional.of("status"), this, statusMsgLabel));
  label.setId(ID.getId(Optional.of("label"), this, label));
}

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

protected void updateDescriptionLayout(final String description) {
  descriptionLayout.removeAllComponents();
  final Label descLabel = SPUIComponentProvider.createNameValueLabel("", description == null ? "" : description);
  /**
   * By default text will be truncated based on layout width. So removing
   * it as we need full description.
   */
  descLabel.removeStyleName("label-style");
  descLabel.setId(UIComponentIdProvider.DETAILS_DESCRIPTION_LABEL_ID);
  descriptionLayout.addComponent(descLabel);
}

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

private static Label createStatusIcon() {
  final Label statusIcon = new Label();
  statusIcon.setImmediate(true);
  statusIcon.setContentMode(ContentMode.HTML);
  statusIcon.setSizeFull();
  setInitialStatusIconStyle(statusIcon);
  statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID);
  return statusIcon;
}

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

private void build() {
  HorizontalLayout layout = new HorizontalLayout();
  display = new Label(translate.from(LabelKey.Message_Bar));
  display.setImmediate(true);
  layout.addComponent(display);
  this.setContent(layout);
  display.setId(ID.getId(Optional.empty(), this, display));
}

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

private static Label getStatusCountLabel() {
  final Label countLabel = new Label();
  countLabel.setImmediate(true);
  countLabel.addStyleName("bulk-upload-label");
  countLabel.setVisible(false);
  countLabel.setCaptionAsHtml(true);
  countLabel.setId(UIComponentIdProvider.BULK_UPLOAD_COUNT);
  return countLabel;
}

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

private static Label createStatusIcon() {
  final Label statusIcon = new Label();
  statusIcon.setImmediate(true);
  statusIcon.setContentMode(ContentMode.HTML);
  statusIcon.setSizeFull();
  setInitialStatusIconStyle(statusIcon);
  statusIcon.setId(UIComponentIdProvider.VALIDATION_STATUS_ICON_ID);
  return statusIcon;
}

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

private static Label getStatusCountLabel() {
  final Label countLabel = new Label();
  countLabel.setImmediate(true);
  countLabel.addStyleName("bulk-upload-label");
  countLabel.setVisible(false);
  countLabel.setCaptionAsHtml(true);
  countLabel.setId(UIComponentIdProvider.BULK_UPLOAD_COUNT);
  return countLabel;
}

代码示例来源:origin: org.rapidpm.vaadin/nano-vaadin-v08

public BasicTestUI() {
 label.setId(LABEL_ID);
 label.setValue(valueOf(counter));
 button.setId(BUTTON_ID);
 button.setCaption(BUTTON_ID);
 button.addClickListener(e -> label.setValue(valueOf(++counter)));
 setCompositionRoot(new VerticalLayout(button, label));
}

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

private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) {
  final VerticalLayout verticalLayout = new VerticalLayout();
  final HorizontalLayout horizontalLayout = new HorizontalLayout();
  horizontalLayout.setSizeFull();
  final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
  softwareModule.setValue(softwareModuleName);
  softwareModule.setDescription(softwareModuleName);
  softwareModule.setId(softwareModuleName + "-label");
  horizontalLayout.addComponent(softwareModule);
  horizontalLayout.setExpandRatio(softwareModule, 1F);
  verticalLayout.addComponent(horizontalLayout);
  return verticalLayout;
}

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

private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) {
  final VerticalLayout verticalLayout = new VerticalLayout();
  final HorizontalLayout horizontalLayout = new HorizontalLayout();
  horizontalLayout.setSizeFull();
  final Label softwareModule = HawkbitCommonUtil.getFormatedLabel("");
  softwareModule.setValue(softwareModuleName);
  softwareModule.setDescription(softwareModuleName);
  softwareModule.setId(softwareModuleName + "-label");
  horizontalLayout.addComponent(softwareModule);
  horizontalLayout.setExpandRatio(softwareModule, 1F);
  verticalLayout.addComponent(horizontalLayout);
  return verticalLayout;
}

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

private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
  final VerticalLayout detailsTabLayout = getDetailsLayout();
  detailsTabLayout.removeAllComponents();
  final Label typeLabel = SPUIComponentProvider
      .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
  typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
  detailsTabLayout.addComponent(typeLabel);
  detailsTabLayout.addComponent(
      SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("checkbox.dist.migration.required"),
          getMigrationRequiredValue(isMigrationRequired)));
}

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

private Component buildDisclaimer() {
  final HorizontalLayout fields = new HorizontalLayout();
  fields.setSpacing(true);
  fields.addStyleName("disclaimer");
  final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML);
  disclaimer.setCaption(i18n.getMessage("label.login.disclaimer"));
  disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
  disclaimer.setId("login-disclaimer");
  disclaimer.setWidth("525px");
  fields.addComponent(disclaimer);
  return fields;
}

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

private Component buildDisclaimer() {
  final HorizontalLayout fields = new HorizontalLayout();
  fields.setSpacing(true);
  fields.addStyleName("disclaimer");
  final Label disclaimer = new Label(uiProperties.getDemo().getDisclaimer(), ContentMode.HTML);
  disclaimer.setCaption(i18n.getMessage("label.login.disclaimer"));
  disclaimer.setIcon(FontAwesome.EXCLAMATION_CIRCLE);
  disclaimer.setId("login-disclaimer");
  disclaimer.setWidth("525px");
  fields.addComponent(disclaimer);
  return fields;
}

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

private void updateDistributionSetDetailsLayout(final String type, final Boolean isMigrationRequired) {
  final VerticalLayout detailsTabLayout = getDetailsLayout();
  detailsTabLayout.removeAllComponents();
  final Label typeLabel = SPUIComponentProvider
      .createNameValueLabel(getI18n().getMessage("label.dist.details.type"), type == null ? "" : type);
  typeLabel.setId(UIComponentIdProvider.DETAILS_TYPE_LABEL_ID);
  detailsTabLayout.addComponent(typeLabel);
  detailsTabLayout.addComponent(
      SPUIComponentProvider.createNameValueLabel(getI18n().getMessage("checkbox.dist.migration.required"),
          getMigrationRequiredValue(isMigrationRequired)));
}

相关文章