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


Java AbstractOrderedLayout.addComponent方法代码示例

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


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

示例1: addToLayout

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Add a spacer to the given layout that will expand automatically.
 *
 * @param layout
 *     The layout to add the spacer to
 */
public static Spacer addToLayout(AbstractOrderedLayout layout) {
  Objects.requireNonNull(layout, "Layout may not be null");

  Spacer spacer = new Spacer();
  layout.addComponent(spacer);
  layout.setExpandRatio(spacer, 1);
  return spacer;
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:15,代码来源:Spacer.java

示例2: addChart

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Adds the chart.
 *
 * @param content
 *            the content
 * @param caption
 *            the caption
 * @param chart
 *            the chart
 * @param fullPage
 *            the full page
 */
protected final void addChart(final AbstractOrderedLayout content,final String caption, final DCharts chart, final boolean fullPage) {
	final HorizontalLayout horizontalLayout = new HorizontalLayout();

	final int browserWindowWidth = getChartWindowWidth();

	final int browserWindowHeight = getChartWindowHeight(fullPage);

	horizontalLayout.setWidth(browserWindowWidth, Unit.PIXELS);
	horizontalLayout.setHeight(browserWindowHeight, Unit.PIXELS);
	horizontalLayout.setMargin(true);
	horizontalLayout.setSpacing(false);
	horizontalLayout.addStyleName("v-layout-content-overview-panel-level1");

	final Panel formPanel = new Panel();
	formPanel.setSizeFull();
	formPanel.setContent(horizontalLayout);
	formPanel.setCaption(caption);

	content.addComponent(formPanel);
	content.setExpandRatio(formPanel, ContentRatio.LARGE);


	chart.setWidth(100, Unit.PERCENTAGE);
	chart.setHeight(100, Unit.PERCENTAGE);
	chart.setMarginRight(CHART_RIGHT_MARGIN);
	chart.setMarginLeft(CHART_LEFT_MARGIN);
	chart.setMarginBottom(CHART_BOTTOM_MARGIN_SIZE);
	chart.setMarginTop(CHART_TOP_MARGIN_SIZE);

	horizontalLayout.addComponent(chart);
	chart.setCaption(caption);
}
 
开发者ID:Hack23,项目名称:cia,代码行数:45,代码来源:AbstractChartDataManagerImpl.java

示例3: addHorizontalGlue

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Try to imitate a HorizalGlue of Swing BoxLayout.
 * A invisible component that get all extra space.
 * @param layout layout to add glue
 */
public static void addHorizontalGlue(AbstractOrderedLayout layout) {
	Label label = new Label();
	label.setWidth("100%");
	layout.addComponent(label);
	layout.setExpandRatio(label, 1.0f);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:12,代码来源:Box.java

示例4: addVerticalGlue

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Try to imitate a VerticalGlue of Swing BoxLayout
 */
public static void addVerticalGlue(AbstractOrderedLayout layout) {
	Label label = new Label(" ");
	label.setHeight("100%");
	layout.addComponent(label);
	layout.setExpandRatio(label, 1.0f);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:10,代码来源:Box.java

示例5: addHorizontalStruct

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Try to imitate HorizontalStruct on Swing BoxLayout
 * @param layout Layout to add the struct
 * @param width struct withd
 */
public static void addHorizontalStruct(AbstractOrderedLayout layout, int width) {
	Label label = new Label();
	label.setWidth(width + "px");
	layout.addComponent(label);
	layout.setExpandRatio(label, 0f);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:12,代码来源:Box.java

示例6: addVerticalStruct

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Try to imitate VerticalStruct of Swing BoxLayout
 * @param layout  layout to add struct
 * @param height struct height
 */
public static void addVerticalStruct(AbstractOrderedLayout layout, int height) {
	Label label = new Label();
	label.setHeight(height + "px");
	layout.addComponent(label);
	layout.setExpandRatio(label, 0f);
}
 
开发者ID:chelu,项目名称:jdal,代码行数:12,代码来源:Box.java

示例7: createPagingControls

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Creates the paging controls.
 *
 * @param content
 *            the content
 * @param name
 *            the name
 * @param pageId
 *            the page id
 * @param size
 *            the size
 * @param pageNr
 *            the page nr
 * @param resultPerPage
 *            the result per page
 */
protected final void createPagingControls(final AbstractOrderedLayout content, final String name, final String pageId, final int size, final int pageNr,
		final int resultPerPage) {
			final HorizontalLayout pagingControls = new HorizontalLayout();
			pagingControls.setSpacing(true);
			pagingControls.setMargin(true);

			final int maxPages = (size +resultPerPage-1) / resultPerPage;

			final StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.append(PAGE_HEADER)
			.append(pageNr)
			.append(PAGE_SEPARATOR)
			.append(maxPages)
			.append(PAGES_TOTAL_RESULTS)
			.append(size)
			.append(RESULTS_PER_PAGE)
			.append(resultPerPage)
			.append(SHOW);
			final Label pageInfo = new Label(stringBuilder.toString());
			pagingControls.addComponent(pageInfo);
			pagingControls.setExpandRatio(pageInfo, ContentRatio.SMALL);


			if (pageNr > PAGE_ONE) {
				addPagingLink(PREVIOUS_PAGE,name, pageId, pageNr -1,pagingControls);
			}

			if (maxPages > PAGE_ONE && pageNr < maxPages) {
				addPagingLink(NEXT_PAGE,name, pageId, pageNr +1,pagingControls);
			}

			if (maxPages > LIMIT_FOR_DISPLAYING_START_END_LINKS && pageNr > PAGE_ONE) {
				addPagingLink(FIRST_PAGE,name, pageId, 1,pagingControls);
			}

			if (maxPages > LIMIT_FOR_DISPLAYING_START_END_LINKS && pageNr < maxPages) {
				addPagingLink(LAST_PAGE,name, pageId, maxPages,pagingControls);
			}

			content.addComponent(pagingControls);
			content.setExpandRatio(pagingControls, ContentRatio.SMALL2);

		}
 
开发者ID:Hack23,项目名称:cia,代码行数:60,代码来源:AbstractPageModContentFactoryImpl.java

示例8: createHeader2Label

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
/**
 * Creates a new Label object.
 *
 * @param panel
 *            the panel
 * @param content
 *            the content
 */
public static void createHeader2Label(final AbstractOrderedLayout panel,final String content) {
	final Label label = new Label(content);
	label.setStyleName("Level2Header");

	panel.addComponent(label);
	panel.setExpandRatio(label,ContentRatio.SMALL);
}
 
开发者ID:Hack23,项目名称:cia,代码行数:16,代码来源:LabelFactory.java

示例9: createBasicBeanItemNestedPropertiesGrid

import com.vaadin.ui.AbstractOrderedLayout; //导入方法依赖的package包/类
@Override
public <T extends Serializable> void createBasicBeanItemNestedPropertiesGrid(final AbstractOrderedLayout panelContent,final Class<T> dataType, final List<T> datasource, final String caption, final String[] nestedProperties,
		final String[] columnOrder, final String[] hideColumns, final AbstractPageItemRendererClickListener<?> listener,
		final String actionId, final ListPropertyConverter[] collectionPropertyConverters) {

	final Grid<T> grid = new Grid<T>(caption).withPropertySet(BeanPropertySet.get(dataType));
			
	grid.setItems(datasource.stream().filter(Objects::nonNull) 
       .collect(Collectors.toList()));
		
	grid.setSelectionMode(SelectionMode.SINGLE);

	createNestedProperties(grid, nestedProperties);

	configureColumnOrdersAndHiddenFields(columnOrder, hideColumns, grid);

	configureListeners(listener, grid);

	setColumnConverters(collectionPropertyConverters, grid);

	grid.setSizeFull();

	grid.setStyleName("Level2Header");

	createGridCellFilter(columnOrder, grid,dataType);

	grid.setResponsive(true);

	panelContent.addComponent(grid);
	panelContent.setExpandRatio(grid, ContentRatio.GRID);
}
 
开发者ID:Hack23,项目名称:cia,代码行数:32,代码来源:GridFactoryImpl.java


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