本文整理汇总了Java中com.vaadin.ui.renderers.NumberRenderer类的典型用法代码示例。如果您正苦于以下问题:Java NumberRenderer类的具体用法?Java NumberRenderer怎么用?Java NumberRenderer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NumberRenderer类属于com.vaadin.ui.renderers包,在下文中一共展示了NumberRenderer类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: listing5
import com.vaadin.ui.renderers.NumberRenderer; //导入依赖的package包/类
public void listing5() {
// tag::listing5[]
PropertyListing listing = Components.listing.properties(PROPERTIES) //
.render(ID, new NumberRenderer(Locale.US)) // <1>
.render(ID, value -> String.valueOf(value), new TextRenderer()) // <2>
.build();
// end::listing5[]
}
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:9,代码来源:ExampleListing.java
示例2: getRenderer
import com.vaadin.ui.renderers.NumberRenderer; //导入依赖的package包/类
@Override
public NumberRenderer getRenderer(ColumnDefinition definition) {
if (definition.getFormat().isPresent()) {
return new NumberRenderer(new DecimalFormat(definition.getFormat().get()));
}
return new NumberRenderer();
}
开发者ID:peterl1084,项目名称:bean-grid,代码行数:9,代码来源:BeanGridNumberValueProvider.java
示例3: createImplementation
import com.vaadin.ui.renderers.NumberRenderer; //导入依赖的package包/类
@Override
protected Renderer<Number> createImplementation() {
if (numberFormat != null) {
return new NumberRenderer(numberFormat, getNullRepresentation());
} else {
checkNotNullArgument(formatString, "Format string may not be null");
checkNotNullArgument(locale, "Locale may not be null");
return new NumberRenderer(formatString, locale, getNullRepresentation());
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:WebNumberRenderer.java
示例4: getImplementation
import com.vaadin.ui.renderers.NumberRenderer; //导入依赖的package包/类
@Override
public NumberRenderer getImplementation() {
return (NumberRenderer) super.getImplementation();
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:5,代码来源:WebNumberRenderer.java
示例5: DemoContentLayout
import com.vaadin.ui.renderers.NumberRenderer; //导入依赖的package包/类
public DemoContentLayout() {
final SelectGrid<TestObject> grid = new SelectGrid<>();
grid.addColumn(TestObject::getFoo).setCaption("Foo");
grid.addColumn(TestObject::getBar, new NumberRenderer()).setCaption("Bar");
grid.addColumn(TestObject::getKm, new NumberRenderer()).setCaption("KM");
grid.setHeightByRows(10);
grid.setHeightMode(HeightMode.ROW);
// Show it in the middle of the screen
setStyleName("demoContentLayout");
setSizeFull();
addComponent(grid);
setComponentAlignment(grid, Alignment.MIDDLE_CENTER);
final TableSelectionModel<TestObject> tableSelect = new TableSelectionModel<>();
grid.setSelectionModel(tableSelect);
tableSelect.setMode(TableSelectionMode.CTRL);
HorizontalLayout tableSelectionControls = new HorizontalLayout();
tableSelectionControls.setCaption("Table Selection Controls");
// Controls for testing different TableSelectionModes
for (final TableSelectionMode t : TableSelectionMode.values()) {
tableSelectionControls.addComponent(new Button(t.toString(), e -> tableSelect.setMode(t)));
}
addComponent(tableSelectionControls);
// TODO: PagingDataProvider
PagedDataProvider<TestObject, SerializablePredicate<TestObject>> dataProvider = new PagedDataProvider<>(
DataProvider.ofCollection(TestObject.generateTestData(995)));
grid.setDataProvider(dataProvider);
PagingControls pagingControls = dataProvider.getPagingControls();
HorizontalLayout pages = new HorizontalLayout();
pages.setCaption("Paging controls");
pages.addComponent(new Button("First", e -> pagingControls.setPageNumber(0)));
pages.addComponent(new Button("Previous", e -> pagingControls.previousPage()));
pages.addComponent(new Button("Next", e -> pagingControls.nextPage()));
pages.addComponent(new Button("Last", e -> pagingControls.setPageNumber(pagingControls.getPageCount() - 1)));
VerticalLayout controls = new VerticalLayout();
controls.addComponents(tableSelectionControls, pages);
controls.setWidth("100%");
controls.setHeightUndefined();
controls.setComponentAlignment(tableSelectionControls, Alignment.MIDDLE_CENTER);
controls.setComponentAlignment(pages, Alignment.BOTTOM_CENTER);
addComponent(controls);
setComponentAlignment(controls, Alignment.MIDDLE_CENTER);
grid.getEditor().setEnabled(true);
for (Column<TestObject, ?> c : grid.getColumns()) {
c.setHidable(true);
}
}
开发者ID:tsuoanttila,项目名称:GridExtensionPack,代码行数:56,代码来源:DemoContentLayout.java
注:本文中的com.vaadin.ui.renderers.NumberRenderer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论