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

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

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

Label.setWidth介绍

暂无

代码示例

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Label label(String message, int width) {
  Label l = new Label(message);
  l.setWidth(width, Sizeable.UNITS_PIXELS);
  return l;
}

代码示例来源:origin: org.aperteworkflow/gui-commons

public static Label htmlLabel(String message, int width) {
   Label l = new Label(message, Label.CONTENT_XHTML);
   l.setWidth(width, Sizeable.UNITS_PIXELS);
   return l;
 }

代码示例来源:origin: org.aperteworkflow/base-widgets

public static Label label(String message, int width) {
  Label l = new Label(message, Label.CONTENT_XHTML);
  l.setWidth(width +"px");
  return l;
}

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

protected void adjustWidth() {
  if (getWidth() < 0) {
    if (userNameLabel != null) {
      userNameLabel.setWidth(-1, Unit.PIXELS);
    } else if (userComboBox != null) {
      userComboBox.setWidthUndefined();
    }
  } else {
    if (userNameLabel != null) {
      userNameLabel.setWidth(100, Unit.PERCENTAGE);
    } else if (userComboBox != null) {
      userComboBox.setWidth(100, Unit.PERCENTAGE);
    }
  }
}

代码示例来源:origin: org.activiti/activiti-explorer

protected Label createProfileHeader(VerticalLayout infoLayout, String headerName) {
 Label label = new Label(headerName);
 label.setWidth(100, UNITS_PERCENTAGE);
 label.addStyleName(ExplorerLayout.STYLE_H3);
 return label;
}

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

/**
 * Build label.
 * 
 * @return Label
 */
public Label buildLabel() {
  final Label label = createLabel();
  label.setImmediate(false);
  label.setWidth("-1px");
  label.setHeight("-1px");
  if (StringUtils.hasText(caption)) {
    label.setCaption(caption);
  }
  return label;
}

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

/**
 * Build label.
 * 
 * @return Label
 */
public Label buildLabel() {
  final Label label = createLabel();
  label.setImmediate(false);
  label.setWidth("-1px");
  label.setHeight("-1px");
  if (StringUtils.hasText(caption)) {
    label.setCaption(caption);
  }
  return label;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initSubTaskTitle() {
 Label title = new Label(i18nManager.getMessage(Messages.TASK_SUBTASKS));
 title.addStyleName(ExplorerLayout.STYLE_H3);
 title.setWidth(100, UNITS_PERCENTAGE);
 subTasksLayout.addComponent(title);
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initPeopleTitle() {
 Label title = new Label(i18nManager.getMessage(Messages.TASK_PEOPLE));
 title.addStyleName(ExplorerLayout.STYLE_H3);
 title.setWidth(100, UNITS_PERCENTAGE);
 peopleLayout.addComponent(title);
}

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

private void refreshInfoArea() {
  removeAllComponents();
  if (expanded) {
    staticComponents.forEach(this::addComponent);
    dynamicComponents.forEach(this::addComponent);
    // Add an empty component with width = 350px to always force the max length
    // This is required as otherwise the left area of the info panel would be empty, even if the info panel
    // is not shown.
    Label label = new Label();
    label.setWidth(350, Unit.PIXELS);
    addComponent(label);
    // Add a graph container to trigger backshift graph renderings on each update
    addComponent(new InlineGraphContainer());
    
  } else {
    addComponent(toggleButton);
  }
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initTitle(HorizontalLayout headerLayout) {
 title = new Label(i18nManager.getMessage(Messages.TASK_PEOPLE));
 title.addStyleName(ExplorerLayout.STYLE_H3);
 title.setWidth(100, UNITS_PERCENTAGE);
 headerLayout.addComponent(title);
 headerLayout.setExpandRatio(title, 1.0f);
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initTitle(HorizontalLayout headerLayout) {
 title = new Label(i18nManager.getMessage(Messages.TASK_SUBTASKS));
 title.addStyleName(ExplorerLayout.STYLE_H3);
 title.setWidth(100, UNITS_PERCENTAGE);
 headerLayout.addComponent(title);
 headerLayout.setExpandRatio(title, 1.0f);
}

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

private Layout createMainArea(final String description) {
  HorizontalLayout layout = new HorizontalLayout();
  layout.setSpacing(true);
  layout.setMargin(true);
  layout.setWidth(100, Unit.PERCENTAGE);
  Label label = new Label(description, ContentMode.PREFORMATTED);
  label.setWidth(100, Unit.PERCENTAGE);
  layout.addComponent(label);
  return layout;
}

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

private Layout createMainArea(final String description) {
  HorizontalLayout layout = new HorizontalLayout();
  layout.setSpacing(true);
  layout.setMargin(true);
  layout.setWidth(100, Unit.PERCENTAGE);
  Label label = new Label(description, ContentMode.PREFORMATTED);
  label.setWidth(100, Unit.PERCENTAGE);
  layout.addComponent(label);
  return layout;
}

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

private HorizontalLayout buildViewTitle() {
  final HorizontalLayout viewHeadercontent = new HorizontalLayout();
  viewHeadercontent.setWidth("100%");
  viewHeadercontent.addStyleName("view-header-layout");
  viewTitle = new Label();
  viewTitle.setWidth("100%");
  viewTitle.setStyleName("header-content");
  viewHeadercontent.addComponent(viewTitle);
  viewHeadercontent.addComponent(notificationUnreadButton);
  viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT);
  return viewHeadercontent;
}

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

private HorizontalLayout buildViewTitle() {
  final HorizontalLayout viewHeadercontent = new HorizontalLayout();
  viewHeadercontent.setWidth("100%");
  viewHeadercontent.addStyleName("view-header-layout");
  viewTitle = new Label();
  viewTitle.setWidth("100%");
  viewTitle.setStyleName("header-content");
  viewHeadercontent.addComponent(viewTitle);
  viewHeadercontent.addComponent(notificationUnreadButton);
  viewHeadercontent.setComponentAlignment(notificationUnreadButton, Alignment.MIDDLE_RIGHT);
  return viewHeadercontent;
}

代码示例来源:origin: org.activiti/activiti-explorer

protected void initFooter() {
 footer = new CssLayout();
 footer.setWidth(100, UNITS_PERCENTAGE);
 footer.addStyleName(ExplorerLayout.STYLE_MAIN_FOOTER);
 addComponent(footer);
 
 Label footerLabel = new Label();
 footerLabel.setContentMode(Label.CONTENT_XHTML);
 footerLabel.setValue(i18nManager.getMessage(Messages.FOOTER_MESSAGE));
 footerLabel.setWidth(100, UNITS_PERCENTAGE);
 footer.addComponent(footerLabel);
}

代码示例来源: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.activiti/activiti-explorer

protected void addTaskEventText(final org.activiti.engine.task.Event taskEvent, final GridLayout eventGrid) {
 VerticalLayout layout = new VerticalLayout();
 layout.addStyleName(ExplorerLayout.STYLE_TASK_EVENT);
 layout.setWidth("100%");
 eventGrid.addComponent(layout);
 
 // Actual text
 Label text = taskEventTextResolver.resolveText(taskEvent);
 text.setWidth("100%");
 layout.addComponent(text);
 
 // Time
 Label time = new Label(new HumanTime(i18nManager).format(taskEvent.getTime()));
 time.setSizeUndefined();
 time.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_TIME);
 layout.addComponent(time);
 
}

相关文章