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


Java Column.setWidth方法代码示例

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


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

示例1: hackDateColumnWidth

import com.vaadin.ui.Grid.Column; //导入方法依赖的package包/类
private void hackDateColumnWidth(Grid grid) {
    List<Column> columns = grid.getColumns();
    if (columns.isEmpty()) {
        return;
    }

    Column lastCol = columns.get(columns.size() - 1);
    if (!"orderTime".equals(lastCol.getPropertyId())) {
        return;
    }

    lastCol.setWidth(174);
}
 
开发者ID:Legioth,项目名称:AllAboutGridWebinar,代码行数:14,代码来源:AllAboutGridUI.java

示例2: addActionColumn

import com.vaadin.ui.Grid.Column; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private void addActionColumn()
{
	((GeneratedPropertyListContainer<E>) grid.getContainerDataSource())
			.addGeneratedProperty(ACTION_MENU_PROPERTY_ID, getActionMenuColumnGenerator());
	final Column actionMenuColumn = grid.addColumn(ACTION_MENU_PROPERTY_ID);
	grid.setFrozenColumnCount(1);
	actionMenuColumn.setHeaderCaption("");
	actionMenuColumn.setRenderer(new ComponentRenderer());
	actionMenuColumn.setWidth(40);
	actionMenuColumn.setResizable(false);
	grid.setCellStyleGenerator(new CellStyleGenerator()
	{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		@Override
		public String getStyle(CellReference event)
		{
			String style = "";
			if (event.getPropertyId().equals(ACTION_MENU_PROPERTY_ID))
			{
				style = "grid-actionmenu";
			}

			return style;
		}
	});
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:32,代码来源:GridHeadingV2PropertySet.java

示例3: setupGridPropertyColumn

import com.vaadin.ui.Grid.Column; //导入方法依赖的package包/类
/**
 * Setup column configuration for given <code>property</code> using its {@link PropertyColumn} definition.
 * @param property Property to which the column is bound
 * @param column Column to setup
 */
protected void setupGridPropertyColumn(P property, Column column) {
	PropertyColumn<T, P> propertyColumn = getPropertyColumn(property);
	if (propertyColumn != null) {
		// header
		if (propertyColumn.getCaption() != null) {
			String header = LocalizationContext.translate(propertyColumn.getCaption(), true);
			if (header != null) {
				column.setHeaderCaption(header);
			}
		}
		// sortable
		column.setSortable(requireDataSource().getConfiguration().isPropertySortable(property));
		// width
		if (propertyColumn.getWidth() > -1) {
			column.setWidth(propertyColumn.getWidth());
		}
		if (propertyColumn.getMinWidth() > -1) {
			column.setMinimumWidth(propertyColumn.getMinWidth());
		}
		if (propertyColumn.getMaxWidth() > -1) {
			column.setMaximumWidth(propertyColumn.getMinWidth());
		}
		// expand
		if (propertyColumn.getGridExpandRatio() > -1) {
			column.setExpandRatio(propertyColumn.getGridExpandRatio());
		}
		// editing
		if (requireDataSource().getConfiguration().isPropertyReadOnly(property)) {
			column.setEditable(false);
		} else {
			column.setEditable(propertyColumn.isEditable());
			if (propertyColumn.isEditable()) {
				propertyColumn.getEditor().ifPresent(e -> column.setEditorField(e));
			}
		}
		// hiding
		if (columnHidingAllowed && propertyColumn.isHidable()) {
			column.setHidable(true);
			if (propertyColumn.isHidden()) {
				column.setHidden(true);
			}
			if (propertyColumn.getHidingToggleCaption() != null) {
				column.setHidingToggleCaption(
						LocalizationContext.translate(propertyColumn.getHidingToggleCaption()));
			}
		} else {
			column.setHidable(false);
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:56,代码来源:DefaultItemListing.java

示例4: setColumnWidth

import com.vaadin.ui.Grid.Column; //导入方法依赖的package包/类
private void setColumnWidth(final Column column, final double width)
{
	// Avoid IllegalArgumentException if proposed width ends up being < 0
	column.setWidth(width > 0 ? width : 0);
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:6,代码来源:GridHeadingV2PropertySet.java


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