• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java TableFieldFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vaadin.ui.TableFieldFactory的典型用法代码示例。如果您正苦于以下问题:Java TableFieldFactory类的具体用法?Java TableFieldFactory怎么用?Java TableFieldFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TableFieldFactory类属于com.vaadin.ui包,在下文中一共展示了TableFieldFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeTable

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initializeTable() {
	//
	// Add the current enumeration values into the
	// bean container.
	//
	for (ConstraintValue value : this.attribute.getConstraintValues()) {
		if (value.getProperty().equals("Enumeration")) {
			this.beanContainer.addBean(value);
		}
	}
	//
	// Now hook the bean container to the table
	//
	this.tableEnumerations.setContainerDataSource(beanContainer);
	//
	// We have to manually create the text field because we need
	// to set a validator.
	//
	this.tableEnumerations.setTableFieldFactory(new TableFieldFactory() {
		private static final long serialVersionUID = 1L;

		@Override
		public Field<?> createField(Container container, Object itemId,
				Object propertyId, Component uiContext) {
			if (propertyId.toString().equals("value")) {
				final TextField text = new TextField();
				text.setImmediate(true);
				text.setNullRepresentation("");
				text.setNullSettingAllowed(false);
				text.setRequired(true);
				text.setRequiredError("Cannot have empty enumeration values.");
				text.addValidator(self);
				return text;
			}
			return null;
		}
	});
	//
	// Finish setting up the table.
	//
	this.tableEnumerations.setVisibleColumns(new Object[] {"value"});
	this.tableEnumerations.setColumnHeaders(new String[] {"Enumeration Value"});
	this.tableEnumerations.setSelectable(true);
	this.tableEnumerations.setEditable(true);
	this.tableEnumerations.setImmediate(true);
	if (this.tableEnumerations.size() == 0) {
		this.tableEnumerations.setPageLength(3);
	} else {
		this.tableEnumerations.setPageLength(this.tableEnumerations.size() + 1);
	}
	//
	// As the user select items, enable/disable buttons
	//
	this.tableEnumerations.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			self.buttonRemove.setEnabled(self.tableEnumerations.getValue() != null);
		}
		
	});
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:64,代码来源:EnumerationEditorComponent.java


示例2: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgCalendar.setImmediate(true);		
	
	refreshBindindSource();
	
	// STEP 01: create grid view for slide Organization View
	try {
		dgCalendar.setBindingSource(bsCalendar);
		dgCalendar.setVisibleColumns(new String[] { "name", "description", "calendarType.description", "calendarFromDate", "calendarToDate", "observation", "active" } );       
		dgCalendar.setColumnHeaders(new String[] { "Nombre", "Descripción", "Tipo", "Fecha Inicio", "Fecha Fin", "Observaciones", "Activo" } );
		dgCalendar.setEditable(true);
		dgCalendar.setTableFieldFactory(new TableFieldFactory() {					
			@Override
			public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
				if("active".equals(propertyId)) {						
					CheckBox field = new CheckBox();
					field.setReadOnly(true);						
					return field;
				}
				
				return null;
			}
		});
		
		dgCalendar.setColumnCollapsed("observation", true);
	}
	catch(Exception ex) {
		ex.getMessage();
	}
		
	// STEP 02: create toolbar for slide Organization View
	navigationToolbar = new NavigationToolbar(0, bsCalendar, viewContainer);
	editionToolbar = new EditionToolbar(1, bsCalendar);
	boxToolbar = new BoxToolbar(2, bsCalendar);
	
	navigationToolbar.addListenerDownButton(this);
	navigationToolbar.addListenerRefreshButton(this);		
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);
	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);
	
	removeAllToolbar();
	
	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);

}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:55,代码来源:CalendarView.java


示例3: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgJob.setImmediate(true);

	refreshBindindSource();

	// STEP 01: create grid view for slide Organization View
	try {
		dgJob.setBindingSource(bsJob);
		dgJob.addGeneratedColumn(JobNameColumn.JOB_NAME_COLUMN_ID, new JobNameColumn());
		dgJob.addGeneratedColumn(JobTriggerTypeColumn.JOB_TRIGGER_TYPE_DESCRIPTION_COLUMN_ID, new JobTriggerTypeColumn());
		dgJob.setVisibleColumns(new String[] {JobNameColumn.JOB_NAME_COLUMN_ID, "jobName", "jobGroup", "description", JobTriggerTypeColumn.JOB_TRIGGER_TYPE_DESCRIPTION_COLUMN_ID, "jobTriggerPriority",
				"startTime", "endTime", "jobInterval", "repeatCount", "jobCalendar", "future", "future_time", "cronExpression", "lastExecution", "error", "active" });
		dgJob.setColumnHeaders(new String[] { "Ubicación", "Nombre", "Grupo", "Descripción", "Tipo Disparador", "Prioridad Disparador", "Fecha Comienzo", "Fecha Fin",
				"Intervalo [s]", "Repetición", "Calendario", "Futuro", "Fecha Futuro", "Expresión Cron", "Ultima Ejecución", "Error", "Activa"});			
		dgJob.setEditable(true);
		
		dgJob.setColumnCollapsed("jobTriggerType.description", true);
		dgJob.setColumnCollapsed("jobTriggerPriority", true);
		//dgJob.setColumnCollapsed("startTime", true);
		//dgJob.setColumnCollapsed("endTime", true);
		dgJob.setColumnCollapsed("jobInterval", true);
		dgJob.setColumnCollapsed("repeatCount", true);
		dgJob.setColumnCollapsed("jobCalendar", true);
		dgJob.setColumnCollapsed("future", true);
		dgJob.setColumnCollapsed("future_time", true);
		dgJob.setColumnCollapsed("cronExpression", true);
		
		dgJob.setTableFieldFactory(new TableFieldFactory() {					
			@Override
			public Field createField(Container container, Object itemId,
					Object propertyId, Component uiContext) {
				if("active".equals(propertyId) || "error".equals(propertyId) || "future".equals(propertyId)) {						
					CheckBox field = new CheckBox();
					field.setReadOnly(true);						
					return field;
				}
				
				return null;
			}
		});
		
	} catch (Exception ex) {
		ex.getMessage();
	}

	// STEP 02: create toolbar for slide Employee Agent View
	navigationToolbar = new NavigationToolbar(0, bsJob, viewContainer);
	editionToolbar = new EditionToolbar(1, bsJob);
	boxToolbar = new BoxToolbar(2, bsJob);		
	jobToolbar = new JobToolbar(3, bsJob, viewContainer);
	
	navigationToolbar.addListenerRefreshButton(this);
	navigationToolbar.addListenerUpButton(this);
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);
	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);

	jobToolbar.addListenerStartJobButton(this);
	jobToolbar.addListenerStopJobButton(this);
	
	dgJob.addListenerAddButton(this);
	dgJob.addListenerEditButton(this);
	dgJob.addListenerDeleteButton(this);
	
	removeAllToolbar();

	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);
	addToolbar(jobToolbar);

}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:79,代码来源:JobView.java


示例4: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgClient.setImmediate(true);
	dgClient.setSelectable(true);
	
	refreshBindindSource();

	// STEP 01: create grid view for slide Organization View
	try {
		// add nested columns
		bsClient.addNestedContainerProperty("address.street");
		
		// bind datasource
		dgClient.setBindingSource(bsClient);
		
		// add visible and collapsed columns
		dgClient.setVisibleColumns(new String[] { "agentId", "code", "name", "description", "vat", "comment", "clientType.description", "clientGroup.description", "address.street", "active" });
		dgClient.setColumnHeaders(new String[] { "Id", "Código", "Nombre", "Descripción", "VAT", "Comentarios", "Tipo", "Grupo", "Dirección", "Activo" });				
		dgClient.setEditable(true);
		dgClient.setTableFieldFactory(new TableFieldFactory() {
			@Override
			public Field createField(Container container, Object itemId,
					Object propertyId, Component uiContext) {
				if ("active".equals(propertyId)) {
					CheckBox field = new CheckBox();
					field.setReadOnly(true);
					return field;
				}

				return null;
			}
		});

		dgClient.setColumnCollapsed("agentId", true);
		dgClient.setColumnCollapsed("address.street", true);
	} catch (Exception ex) {
		ex.getMessage();
	}

	// STEP 02: create toolbar for slide Employee Agent View
	navigationToolbar = new NavigationToolbar(0, bsClient, viewContainer);
	editionToolbar = new EditionToolbar(1, bsClient);
	boxToolbar = new BoxToolbar(2, bsClient);

	navigationToolbar.addListenerRefreshButton(this);
	navigationToolbar.setUpButton(false);
	navigationToolbar.setDownButton(false);
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);
	
	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.setImportButton(true);
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);	
	boxToolbar.addListenerImportButton(this);		
	
	dgClient.addListenerAddButton(this);
	dgClient.addListenerEditButton(this);
	dgClient.addListenerDeleteButton(this);
	
	removeAllToolbar();

	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);

}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:72,代码来源:ClientView.java


示例5: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgReport.setImmediate(true);
	dgReport.setSelectable(true);
	
	refreshBindindSource();
	
	try {
		bsReport.addNestedContainerProperty("organization.description");
		
		dgReport.setBindingSource(bsReport);
		dgReport.setVisibleColumns(new String[] { "reportId", "organization.description", "code", "description", "active" });
		dgReport.setColumnHeaders(new String[] { "Id", "Organización", "Codigo", "Descripción", "Activo" });				
		dgReport.setEditable(true);
		dgReport.setTableFieldFactory(new TableFieldFactory() {
			@Override
			public Field createField(Container container, Object itemId,
					Object propertyId, Component uiContext) {
				if ("active".equals(propertyId)) {
					CheckBox field = new CheckBox();
					field.setReadOnly(true);
					return field;
				}

				return null;
			}
		});

		dgReport.setColumnCollapsed("reportId", true);
	} catch (Exception ex) {
		ex.getMessage();
	}

	// STEP 02: create toolbar for slide Employee Agent View
	navigationToolbar = new NavigationToolbar(0, bsReport, viewContainer);
	editionToolbar = new EditionToolbar(1, bsReport);
	boxToolbar = new BoxToolbar(2, bsReport);
	reportToolbar = new ReportToolbar(3, bsReport);
	
	navigationToolbar.addListenerRefreshButton(this);
	navigationToolbar.setUpButton(false);
	navigationToolbar.setDownButton(false);
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);
	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);		
	
	reportToolbar.addListenerExecuteReportButton(this);
	
	dgReport.addListenerAddButton(this);
	dgReport.addListenerEditButton(this);
	dgReport.addListenerDeleteButton(this);
	
	removeAllToolbar();

	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);
	//addToolbar(reportToolbar);
	
}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:66,代码来源:ReportView.java


示例6: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgProduct.setImmediate(true);
	
	refreshBindindSource();
	
	// STEP 01: create grid view for slide Organization View
	try {			
		bsProduct.addNestedContainerProperty("supplier.name");
		
		dgProduct.setBindingSource(bsProduct);
					
		dgProduct.setVisibleColumns(new String[] { "code", "name", "description", "hasLote", "hasSerialNumber", "hasExpeditionDate", "averagePrice", "productType.description", "supplier.name", "productActive" } );       
		dgProduct.setColumnHeaders(new String[] { "Código", "Nombre", "Descripción", "Con Lote", "Con Númnero Serie", "Con Fecha Caducidad", "Precio Medio", "Tipo", "Proveedor", "Activo" } );
		dgProduct.setEditable(true);
		dgProduct.setTableFieldFactory(new TableFieldFactory() {					
			@Override
			public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
				if("hasLote".equals(propertyId) || "hasSerialNumber".equals(propertyId) || "hasExpeditionDate".equals(propertyId) || "productActive".equals(propertyId)) {
					
					CheckBox field = new CheckBox();
					field.setReadOnly(true);
					return field;
				}
				
				return null;
			}
		});
		
		dgProduct.setColumnCollapsed("code", true);
	}
	catch(Exception ex) {
		ex.getMessage();
	}
		
	// STEP 02: create toolbar for slide Employee Agent View
	navigationToolbar = new NavigationToolbar(0, bsProduct, viewContainer);
	editionToolbar = new EditionToolbar(1, bsProduct);
	boxToolbar = new BoxToolbar(2, bsProduct);
	
	navigationToolbar.addListenerRefreshButton(this);
	navigationToolbar.setUpButton(false);
	navigationToolbar.setDownButton(false);
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);
	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);
	boxToolbar.addListenerImportButton(this);
	
	boxToolbar.setImportButton(true);
	
	dgProduct.addListenerAddButton(this);
	dgProduct.addListenerEditButton(this);
	dgProduct.addListenerDeleteButton(this);
	
	removeAllToolbar();
	
	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);

}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:67,代码来源:ProductView.java


示例7: initView

import com.vaadin.ui.TableFieldFactory; //导入依赖的package包/类
private void initView() {
	// initialize Slide View Organization View
	dgSupplier.setImmediate(true);

	refreshBindindSource();

	// STEP 01: create grid view for slide Organization View
	try {
		// add nested columns
		bsSupplier.addNestedContainerProperty("address.street");
		
		// bind datasource
		dgSupplier.setBindingSource(bsSupplier);
		
		// add visible and collapsed columns
		dgSupplier.setVisibleColumns(new String[] { "agentId", "code", "name", "description", "vat", "comment", "supplierType.description", "supplierGroup.description", "address.street", "active" });
		dgSupplier.setColumnHeaders(new String[] { "Id", "Código", "Nombre", "Descripción", "VAT", "Comentarios", "Tipo", "Grupo", "Dirección", "Activo" });		
		dgSupplier.setEditable(true);
		dgSupplier.setTableFieldFactory(new TableFieldFactory() {
			@Override
			public Field createField(Container container, Object itemId,
					Object propertyId, Component uiContext) {
				if ("active".equals(propertyId)) {
					CheckBox field = new CheckBox();
					field.setReadOnly(true);
					return field;
				}

				return null;
			}
		});

		dgSupplier.setColumnCollapsed("agentId", true);
		dgSupplier.setColumnCollapsed("address.street", true);
		
	} catch (Exception ex) {
		ex.getMessage();
	}

	// STEP 02: create toolbar for slide Employee Agent View
	navigationToolbar = new NavigationToolbar(0, bsSupplier, viewContainer);
	editionToolbar = new EditionToolbar(1, bsSupplier);
	boxToolbar = new BoxToolbar(2, bsSupplier);
	
	navigationToolbar.addListenerRefreshButton(this);
	navigationToolbar.setUpButton(false);
	navigationToolbar.setDownButton(false);
	
	editionToolbar.addListenerAddButton(this);
	editionToolbar.addListenerEditButton(this);
	editionToolbar.addListenerDeleteButton(this);

	editionToolbar.setPermission(context.getUser(), viewContainer.getModule().getSymbolicName(), viewContainer.getModule().getVersion());
	
	boxToolbar.addListenerFilterButton(this);
	boxToolbar.addListenerPrintButton(this);
	boxToolbar.addListenerImportButton(this);
	
	boxToolbar.setImportButton(true);
	
	dgSupplier.addListenerAddButton(this);
	dgSupplier.addListenerEditButton(this);
	dgSupplier.addListenerDeleteButton(this);
	
	removeAllToolbar();

	addToolbar(navigationToolbar);
	addToolbar(editionToolbar);
	addToolbar(boxToolbar);

}
 
开发者ID:thingtrack,项目名称:konekti,代码行数:72,代码来源:SupplierView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Theory类代码示例发布时间:2022-05-22
下一篇:
Java SpanishStemmer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap