本文整理汇总了Java中com.vaadin.shared.ui.grid.HeightMode类的典型用法代码示例。如果您正苦于以下问题:Java HeightMode类的具体用法?Java HeightMode怎么用?Java HeightMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HeightMode类属于com.vaadin.shared.ui.grid包,在下文中一共展示了HeightMode类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: init
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@PostConstruct
public void init() {
roleGrid.setWidth("500px");
roleGrid.setHeightMode(HeightMode.UNDEFINED);
roleGrid.addColumn(Role::getId).setCaption("Id").setWidth(50);
roleGrid.addColumn(Role::getName).setCaption("Name");
roleGrid.setSelectionMode(Grid.SelectionMode.NONE);
roleGrid.addStyleName("kumoHandPointer");
addComponents(roleGrid, btnAddNew);
roleGrid.addItemClickListener((ItemClickListener<Role>) itemClick ->
navigateTo(RoleEditView.VIEW_NAME + "/" + itemClick.getItem().getId()));
btnAddNew.addClickListener((Button.ClickListener) clickEvent -> {
handler.addNewRole(this);
});
}
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:18,代码来源:RoleListView.java
示例2: buildLayout
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
private void buildLayout() {
VerticalLayout left = new VerticalLayout(items);
left.setSizeFull();
items.setSizeFull();
left.setExpandRatio(items, 1);
ratings.setHeightMode(HeightMode.CSS);
ratings.setHeight("100%");
HorizontalLayout mainLayout = new HorizontalLayout(left, ratings);
mainLayout.setSizeFull();
mainLayout.setExpandRatio(left, 1);
setContent(mainLayout);
}
开发者ID:xiaojieliu7,项目名称:MicroServiceProject,代码行数:13,代码来源:UserUI.java
示例3: init
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@PostConstruct
public void init() {
badgeGrid.setWidth("800px");
badgeGrid.setHeightMode(HeightMode.ROW);
badgeGrid.setSelectionMode(Grid.SelectionMode.NONE);
badgeGrid.addStyleName("kumoHandPointer");
addComponent(badgeGrid);
addComponent(btnAddNew);
badgeGrid.addItemClickListener((ItemClickListener<Badge>) itemClick -> navigateTo(BadgeEditView.VIEW_NAME + "/" + itemClick.getItem().getId()));
btnAddNew.addClickListener((Button.ClickListener) clickEvent -> {
navigateTo(BadgeEditView.VIEW_NAME + "/");
});
}
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:16,代码来源:BadgeListView.java
示例4: setHeight
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public void setHeight(float height, Unit unit) {
super.setHeight(height, unit);
if (getHeight() < 0) {
grid.setHeightUndefined();
grid.setHeightMode(HeightMode.UNDEFINED);
} else {
grid.setHeight(100, Unit.PERCENTAGE);
grid.setHeightMode(HeightMode.CSS);
}
}
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:WebDataGrid.java
示例5: initGridProperties
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的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
示例6: setDefaultGridProperties
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
/**
* Sets the default properties of grid
*/
protected void setDefaultGridProperties() {
grid.setSelectionMode(SelectionMode.SINGLE);
grid.removeColumn("id");
grid.removeColumn("sales2012.totalSales");
grid.removeColumn("sales2013.totalSales");
grid.removeColumn("sales2014.totalSales");
grid.setImmediate(true);
grid.setHeightMode(HeightMode.CSS);
for (Column column : grid.getColumns()) {
column.setExpandRatio(1);
}
}
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:17,代码来源:AbstractGridView.java
示例7: getTargetComponent
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public Component getTargetComponent() {
final Grid<Person> grid = new Grid(Person.class);
grid.setSizeFull();
grid.setHeightMode(HeightMode.ROW);
grid.setHeightByRows(3);
grid.setItems(Arrays.asList(new Person("Arthur", 12),new Person("Ruben", 30),new Person("Ulises", 109)));
grid.setId("tocopie-grid");
return grid;
}
开发者ID:vaadin4qbanos,项目名称:vaadin-jsclipboard-addon,代码行数:11,代码来源:GridView.java
示例8: heightByContents
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public B heightByContents() {
getInstance().getGrid().setHeightMode(HeightMode.UNDEFINED);
return builder();
}
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:AbstractGridItemListingBuilder.java
示例9: heightByRows
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public B heightByRows(double rows) {
getInstance().getGrid().setHeightMode(HeightMode.ROW);
getInstance().getGrid().setHeightByRows(rows);
return builder();
}
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:7,代码来源:AbstractGridItemListingBuilder.java
示例10: heightByContents
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public B heightByContents() {
getInstance().setHeightMode(HeightMode.UNDEFINED);
return builder();
}
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:6,代码来源:AbstractGridItemListingBuilder.java
示例11: heightByRows
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@Override
public B heightByRows(double rows) {
getInstance().setHeightMode(HeightMode.ROW);
getInstance().setHeightByRows(rows);
return builder();
}
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:7,代码来源:AbstractGridItemListingBuilder.java
示例12: init
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
@PostConstruct
public void init() {
FormLayout form = new FormLayout();
form.setWidth("800px");
form.addComponents(name, badgeType, badgeTypeText, badgeTypeBackgroundColor, waringMessage, requiredRight, visible,
deleteNote);
badgeType.setItems(BadgeType.values());
badgeType.setEmptySelectionAllowed(false);
waringMessage.setWidth("400px");
requiredRight.setWidth("300px");
ageRangeGrid.setHeightMode(HeightMode.ROW);
ageRangeGrid.setHeightByRows(4);
ageRangeGrid.setWidth("800px");
ageRangeGrid.setSelectionMode(Grid.SelectionMode.NONE);
ageRangeGrid.getEditor().setEnabled(true);
ageRangeGrid.addStyleName("kumoHandPointer");
binder.bind(name, Badge::getName, Badge::setName);
binder.bind(badgeType, Badge::getBadgeType, Badge::setBadgeType);
binder.bind(badgeTypeText, Badge::getBadgeTypeText, Badge::setBadgeTypeText);
binder.bind(badgeTypeBackgroundColor, Badge::getBadgeTypeBackgroundColor, Badge::setBadgeTypeBackgroundColor);
binder.bind(waringMessage, Badge::getWarningMessage, Badge::setWarningMessage);
binder.bind(requiredRight, Badge::getRequiredRight, Badge::setRequiredRight);
binder.bind(visible, Badge::isVisible, Badge::setVisible);
VerticalLayout buttons = new VerticalLayout();
btnSave.addClickListener((Button.ClickListener) clickEvent -> {
Badge badge = binder.getBean();
DataProvider<AgeRange, ?> dataProvider = ageRangeGrid.getDataProvider();
Stream<AgeRange> streamEntities = dataProvider.fetch(new Query<>());
List<AgeRange> ageRanges = streamEntities.collect(Collectors.toList());
badge.setAgeRanges(ageRanges);
handler.saveBadge(this, badge);
});
btnCancel.addClickListener((Button.ClickListener) clickEvent -> navigateTo(BadgeListView.VIEW_NAME));
btnSave.setClickShortcut(ShortcutAction.KeyCode.ENTER);
btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
btnCancel.setClickShortcut(ShortcutAction.KeyCode.ESCAPE);
buttons.addComponents(btnSave, btnCancel);
buttons.setWidth("150px");
addComponents(form, buttons, ageRangeGrid);
}
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:46,代码来源:BadgeEditView.java
示例13: DemoContentLayout
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的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
示例14: setHeightMode
import com.vaadin.shared.ui.grid.HeightMode; //导入依赖的package包/类
/**
* Set the height mode of the internal grid.
* @param heightMode the height mode to set
*/
public void setHeightMode(HeightMode heightMode) {
getGrid().setHeightMode(heightMode);
}
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:DefaultItemListing.java
注:本文中的com.vaadin.shared.ui.grid.HeightMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论