本文整理匯總了Java中com.vaadin.ui.Grid.setHeight方法的典型用法代碼示例。如果您正苦於以下問題:Java Grid.setHeight方法的具體用法?Java Grid.setHeight怎麽用?Java Grid.setHeight使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Grid
的用法示例。
在下文中一共展示了Grid.setHeight方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createMetadataGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected Grid createMetadataGrid() {
final Grid metadataGrid = new Grid();
metadataGrid.addStyleName(SPUIStyleDefinitions.METADATA_GRID);
metadataGrid.setImmediate(true);
metadataGrid.setHeight("100%");
metadataGrid.setWidth("100%");
metadataGrid.setId(UIComponentIdProvider.METDATA_TABLE_ID);
metadataGrid.setSelectionMode(SelectionMode.SINGLE);
metadataGrid.setColumnReorderingAllowed(true);
metadataGrid.setContainerDataSource(getMetadataContainer());
metadataGrid.getColumn(KEY).setHeaderCaption(i18n.getMessage("header.key"));
metadataGrid.getColumn(VALUE).setHeaderCaption(i18n.getMessage("header.value"));
metadataGrid.getColumn(VALUE).setHidden(true);
metadataGrid.addSelectionListener(this::onRowClick);
metadataGrid.getColumn(DELETE_BUTTON).setHeaderCaption("");
metadataGrid.getColumn(DELETE_BUTTON).setRenderer(new HtmlButtonRenderer(this::onDelete));
metadataGrid.getColumn(DELETE_BUTTON).setWidth(50);
metadataGrid.getColumn(KEY).setExpandRatio(1);
return metadataGrid;
}
示例2: init
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest request) {
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
Grid grid = new Grid();
initializeGrid(grid);
grid.setWidth("700px");
grid.setHeight("500px");
applyDemoHacks(grid);
layout.addComponent(grid);
}
示例3: createGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid createGrid() {
Grid<Dessert> grid = new Grid<>();
grid.setItems(desserts);
grid.setSelectionMode(Grid.SelectionMode.MULTI);
grid.setWidth(100, Unit.PERCENTAGE);
grid.addColumn(Dessert::getName).setCaption("Dessert (100g serving");
grid.addColumn(Dessert::getCalories).setCaption("Calories");
grid.addColumn(Dessert::getFat).setCaption("Fat (g)");
grid.addColumn(Dessert::getCarbs).setCaption("Carbs (g)");
grid.addColumn(Dessert::getProtein).setCaption("Protein (g)");
grid.addColumn(Dessert::getSodium).setCaption("Sodium (mg)");
grid.addColumn(Dessert::getCalcium).setCaption("Calcium (%)");
grid.addColumn(Dessert::getIron).setCaption("Iron (%)");
grid.setHeight(Metrics.Table.COLUMN_HEADER_HEIGHT + desserts.size() * Metrics.Table.ROW_HEIGHT, Unit.PIXELS);
return grid;
}
示例4: createSelectedGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private void createSelectedGrid()
{
selectedGrid = new Grid();
selectedGrid.setContainerDataSource(createSelectedContainer());
selectedGrid.setWidth(DEFAULT_COLUMN_WIDTH, Unit.PIXELS);
selectedGrid.setHeight(DEFAULT_COLUMN_HEIGHT, Unit.PIXELS);
selectedGrid.addItemClickListener(new ItemClickListener()
{
private static final long serialVersionUID = 1L;
@Override
public void itemClick(ItemClickEvent event)
{
if (event.isDoubleClick())
{
removeButton.click();
}
}
});
createSelectedHeadings().applyToGrid(selectedGrid);
// initialised = true;
}
示例5: createGridForGantt
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid<Step> createGridForGantt() {
dataProvider = new ListDataProvider<>(new ArrayList<>(gantt.getSteps()));
Grid<Step> grid = new Grid<>(dataProvider);
grid.setWidth(400, Unit.PIXELS);
grid.setHeight(100, Unit.PERCENTAGE);
Column<Step, ?> c = grid.addColumn(Step::getCaption);
c.setSortable(false);
c.setResizable(false);
gantt.setVerticalScrollDelegateTarget(grid);
return grid;
}
示例6: setVerticalScrollDelegateTarget
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
/**
* Set target Grid component that will scroll vertically with the Gantt
* component and vice versa.
* <p>
* Grid height is maintained by Gantt after this call. Grid header height is
* changed to match the Gantt header. Grid rows have to have exactly same
* heights as the Gantt steps have.
* <p>
* Component resize events of the Grid and Gantt widgets are handled by this
* component.
* <p>
* Grid's internal column reordering and sorting are not listened by Gantt
* and can be handled explicitly via Grid's server side event listeners.
*
* @param table
* Target Grid component.
*/
public <T> void setVerticalScrollDelegateTarget(Grid<T> grid) {
if (grid != null) {
grid.setHeight(getHeight(), getHeightUnits());
}
if (getState().verticalScrollDelegateTarget != null && getState().verticalScrollDelegateTarget != grid) {
// target has changed. Remove value change listener from the old
// target.
cleanScrollDelegateTargetListeners();
}
getState().verticalScrollDelegateTarget = grid;
if (grid != null) {
addScrollDelegateTargetListeners(grid);
}
}