当前位置: 首页>>代码示例>>Java>>正文


Java HorizontalLayout.setMargin方法代码示例

本文整理汇总了Java中com.vaadin.ui.HorizontalLayout.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout.setMargin方法的具体用法?Java HorizontalLayout.setMargin怎么用?Java HorizontalLayout.setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.HorizontalLayout的用法示例。


在下文中一共展示了HorizontalLayout.setMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RowLayout

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
private RowLayout(Step step) {
  this.step = step;

  label = getLabelProvider().getStepLabel(step);

  divider = new CssLayout();
  divider.addStyleName(STYLE_DIVIDER);
  divider.setHeight(100, Unit.PERCENTAGE);

  contentContainer = new Panel();
  contentContainer.addStyleName(STYLE_CONTENT_CONTAINER);
  contentContainer.addStyleName(ValoTheme.PANEL_BORDERLESS);
  contentContainer.setSizeFull();

  buttonBar = new HorizontalLayout();
  buttonBar.addStyleName(STYLE_BUTTON_BAR);
  buttonBar.setMargin(false);
  buttonBar.setSpacing(true);
  buttonBar.setWidth(100, Unit.PERCENTAGE);
  buttonBar.setMargin(new MarginInfo(false, false, !isLastStep(step), false));

  rootLayout = new GridLayout(2, 3);
  rootLayout.setSizeFull();
  rootLayout.setMargin(false);
  rootLayout.setSpacing(false);
  rootLayout.setColumnExpandRatio(1, 1);
  rootLayout.setRowExpandRatio(1, 1);
  rootLayout.addComponent(label, 0, 0, 1, 0);
  rootLayout.addComponent(divider, 0, 1, 0, 2);
  rootLayout.addComponent(contentContainer, 1, 1, 1, 1);
  rootLayout.addComponent(buttonBar, 1, 2, 1, 2);

  setCompositionRoot(rootLayout);
  addStyleName(STYLE_COMPONENT);
  setWidth(100, Unit.PERCENTAGE);
  setActive(false);
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:38,代码来源:VerticalStepper.java

示例2: StepLabel

import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
/**
 * Construct a new label with the given caption, description and icon.
 *
 * @param caption
 *     The caption to show
 * @param description
 *     The description to show
 * @param icon
 *     The icon to show
 */
public StepLabel(String caption, String description, FontIcon icon) {
  active = false;
  nexted = false;
  skipped = false;
  editable = false;
  clickable = false;

  iconLabel = new Label();
  iconLabel.setWidthUndefined();
  iconLabel.setContentMode(ContentMode.HTML);
  iconLabel.addStyleName(STYLE_STEP_ICON);

  captionLabel = new Label();
  captionLabel.setWidth(100, Unit.PERCENTAGE);
  captionLabel.addStyleName(STYLE_STEP_CAPTION);

  descriptionLabel = new Label();
  descriptionLabel.setWidth(100, Unit.PERCENTAGE);
  descriptionLabel.addStyleName(ValoTheme.LABEL_LIGHT);
  descriptionLabel.addStyleName(ValoTheme.LABEL_SMALL);
  descriptionLabel.addStyleName(STYLE_STEP_DESCRIPTION);

  captionWrapper = new VerticalLayout();
  captionWrapper.setSpacing(false);
  captionWrapper.setMargin(false);
  captionWrapper.setSizeFull();
  captionWrapper.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
  captionWrapper.addComponent(captionLabel);
  captionWrapper.addComponent(descriptionLabel);

  rootLayout = new HorizontalLayout();
  rootLayout.setSpacing(false);
  rootLayout.setMargin(false);
  rootLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
  rootLayout.setWidth(100, Unit.PERCENTAGE);
  rootLayout.addComponent(iconLabel);
  rootLayout.addComponent(captionWrapper);
  rootLayout.setExpandRatio(captionWrapper, 1);

  setCompositionRoot(rootLayout);
  addStyleName(STYLE_ROOT_LAYOUT);
  setIcon(icon);
  setCaption(caption);
  setDescription(description);

  setIconNexted(DEFAULT_ICON_NEXTED);
  setIconSkipped(DEFAULT_ICON_SKIPPED);
  setIconEditable(DEFAULT_ICON_EDITABLE);
  setIconError(DEFAULT_ICON_ERROR);
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:61,代码来源:StepLabel.java


注:本文中的com.vaadin.ui.HorizontalLayout.setMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。