本文整理汇总了Java中com.vaadin.ui.renderers.DateRenderer类的典型用法代码示例。如果您正苦于以下问题:Java DateRenderer类的具体用法?Java DateRenderer怎么用?Java DateRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DateRenderer类属于com.vaadin.ui.renderers包,在下文中一共展示了DateRenderer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRenderer
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
@Override
public DateRenderer getRenderer(ColumnDefinition definition) {
if (definition.getFormat().isPresent()) {
return new DateRenderer(new SimpleDateFormat(definition.getFormat().get()));
}
if (configurationProvider.getDateFormatPattern().isPresent()) {
return new DateRenderer(new SimpleDateFormat(configurationProvider.getDateFormatPattern().get()));
}
return new DateRenderer(configurationProvider.getLocale());
}
开发者ID:peterl1084,项目名称:bean-grid,代码行数:13,代码来源:BeanGridDateValueProvider.java
示例2: createImplementation
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
@Override
protected DateRenderer createImplementation() {
if (dateFormat == null) {
checkNotNullArgument(formatString, "Format string may not be null");
checkNotNullArgument(locale, "Locale may not be null");
dateFormat = new SimpleDateFormat(formatString, locale);
}
return new DateRenderer(dateFormat, getNullRepresentation());
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:10,代码来源:WebDateRenderer.java
示例3: initGridProperties
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
/**
* Initializes basic properties of the grid
*/
private void initGridProperties() {
grid.setHeightMode(HeightMode.ROW);
grid.setWidth(100, Unit.PERCENTAGE);
grid.setColumnOrder(new Object[] { "customerName", "city", "pincode",
"gender" });
// Hiding is not supported by Grid, in order to remove/hide a column use
// this API
grid.removeColumn("customerID");
Column dob = grid.getColumn("dob");
dob.setRenderer(new DateRenderer(DateFormat
.getDateInstance(DateFormat.MEDIUM)));
}
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:16,代码来源:BasicGridView.java
示例4: setColumnRenderes
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
private void setColumnRenderes(final Grid grid) {
grid.getColumn("id")
.setRenderer(
new EditDeleteButtonValueRenderer<Inhabitants>(edit -> {
Notification.show(edit.getItem()
.toString() + " want's to get edited", Type.HUMANIZED_MESSAGE);
}, delete -> {
Notification.show(delete.getItem()
.toString() + " want's to get deleted", Type.WARNING_MESSAGE);
}))
.setWidth(160);
grid.getColumn("bodySize")
.setRenderer(new IndicatorRenderer(1.8, 1.1))
.setWidth(150);
grid.getColumn("birthday")
.setRenderer(new DateRenderer(DateFormat.getDateInstance()))
.setWidth(210);
grid.getColumn("onFacebook")
.setRenderer(new BooleanRenderer())
.setWidth(130);
/*
* the icon of the editButton will get overwritten below by css styling @see DemoUI.initColumnAlignments
*/
grid.addColumn((ValueProvider<Inhabitants, String>) value -> String.format("%s <i>(%d)</i>",
value.getCountry()
.getName(),
value.getCountry()
.getPopulation()), new EditButtonValueRenderer<Inhabitants>(e -> {
Notification.show("Goto Link for " + e.getItem()
.getCountry()
.getName(), Type.HUMANIZED_MESSAGE);
}));
}
开发者ID:melistik,项目名称:vaadin-grid-util,代码行数:37,代码来源:DemoUI.java
示例5: init
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
mainWindow = new Window("Test Vaadin application");
mainWindow.setWidth(800, Unit.PIXELS);
mainWindow.setHeight(600, Unit.PIXELS);
mainWindow.center();
grid.setWidth("100%");
grid.setHeight(300, Unit.PIXELS);
grid.setSelectionMode(Grid.SelectionMode.SINGLE);
grid.setContainerDataSource(new BeanItemContainer<Person>(Person.class, DaoImpl.getAllPersons()));
grid.setColumns("name", "birth");
Grid.Column bornColumn = grid.getColumn("birth");
bornColumn.setRenderer(new DateRenderer("%1$td-%1$tm-%1$tY"));
grid.addSelectionListener(event -> {
Set<Object> selected = event.getSelected();
Person o = (Person) selected.toArray()[0];
BeanFieldGroup.bindFieldsUnbuffered(o, formLayout);
formLayout.id.setEnabled(true);
formLayout.name.setEnabled(true);
formLayout.birth.setEnabled(true);
});
formLayout.id.setEnabled(false);
formLayout.name.setEnabled(false);
formLayout.birth.setEnabled(false);
verticalLayout.setMargin(true);
verticalLayout.addComponent(grid);
verticalLayout.addComponent(formLayout);
mainWindow.setContent(verticalLayout);
addWindow(mainWindow);
}
开发者ID:java-course-ee,项目名称:java-course-ee,代码行数:39,代码来源:MyWindow.java
示例6: getImplementation
import com.vaadin.ui.renderers.DateRenderer; //导入依赖的package包/类
@Override
public DateRenderer getImplementation() {
return (DateRenderer) super.getImplementation();
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:WebDateRenderer.java
注:本文中的com.vaadin.ui.renderers.DateRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论