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


Java Column.setHeaderCaption方法代码示例

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


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

示例1: initGridColumns

import com.vaadin.ui.Grid.Column; //导入方法依赖的package包/类
private void initGridColumns() {

		Column customerName = grid.getColumn("customerName");
		Column city = grid.getColumn("city");
		Column pincode = grid.getColumn("pincode");
		Column gender = grid.getColumn("gender");
		Column dob = grid.getColumn("dob");
		customerName.setHeaderCaption("Customer Name");
		city.setHeaderCaption("City");
		pincode.setHeaderCaption("Pin Code");
		gender.setHeaderCaption("Gender");
		dob.setHeaderCaption("Date of Birth");
		// Set Column order of Grid
		grid.setColumnOrder("customerName", "dob", "city", "gender", "pincode");
	}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:16,代码来源:BasicGridView.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


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