本文整理匯總了Java中com.vaadin.ui.Grid.setSizeFull方法的典型用法代碼示例。如果您正苦於以下問題:Java Grid.setSizeFull方法的具體用法?Java Grid.setSizeFull怎麽用?Java Grid.setSizeFull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Grid
的用法示例。
在下文中一共展示了Grid.setSizeFull方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ReleasesView
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
public ReleasesView() {
setSizeFull();
setMargin(false);
ButtonBar buttonBar = new ButtonBar();
addButton = buttonBar.addButton("Add", FontAwesome.PLUS, e -> add());
editButton = buttonBar.addButton("Edit", FontAwesome.EDIT, e -> edit());
exportButton = buttonBar.addButton("Export", FontAwesome.DOWNLOAD, e -> export());
archiveButton = buttonBar.addButton("Archive", FontAwesome.ARCHIVE, e -> archive());
// TODO add support for the archive button
archiveButton.setVisible(false);
finalizeButton = buttonBar.addButton("Finalize", FontAwesome.CUBE, e -> finalize());
addComponent(buttonBar);
enableDisableButtonsForSelectionSize(0);
grid = new Grid();
grid.setSizeFull();
grid.setSelectionMode(SelectionMode.MULTI);
grid.addItemClickListener(e->rowClicked(e));
grid.addSelectionListener((e) -> rowSelected(e));
container = new BeanItemContainer<>(ReleasePackage.class);
grid.setContainerDataSource(container);
grid.setColumns("name", "versionLabel", "releaseDate", "released");
grid.sort("releaseDate", SortDirection.DESCENDING);
addComponent(grid);
setExpandRatio(grid, 1);
progressBar = new ProgressBar(0.0f);
}
示例2: getTracesGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid<TraceGridRow> getTracesGrid(List<Trace> traces) {
List<TraceGridRow> tracesInfos = traces.stream()
.map(TraceGridRow::new)
.collect(Collectors.toList());
Grid<TraceGridRow> grid = new Grid<>(TraceGridRow.class);
grid.removeAllColumns();
grid.addColumn(TraceGridRow::getTimestamp).setCaption("Date");
grid.addColumn(t -> t.getMethod() + " " + t.getPath()).setCaption("HTTP Request").setExpandRatio(1);
grid.addColumn(t -> {
if(t.getResponseHttp().isPresent()) {
return t.getResponseHttp().get() + " " + t.getResponseHttp().get().getReasonPhrase();
}
return "";
}).setCaption("HTTP Response");
grid.addColumn(t -> t.getTimeTaken().isPresent() ? t.getTimeTaken().get().toMillis() : -1).setCaption("Time taken (ms)");
this.requestDetailsPopup(grid);
grid.setItems(tracesInfos);
grid.setSizeFull();
return grid;
}
示例3: presentTableData
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
@Override
public void presentTableData(RootResult rootrResult) {
ResultToListConverter resultToListConverter = new ResultToListConverter();
List<Result> resultList = resultToListConverter.apply(rootrResult);
Collections.sort(resultList, new Inverter<>(new ResultComparator()));
Grid<Result> grid = new Grid<>(TABLE_TITLE);
grid.addColumn(result -> result.getName()).setCaption(TABLE_COLUMN_METHOD_NAME).setId(TABLE_COLUMN_METHOD_NAME);
grid.addColumn(result -> result.getValue() + NONE).setCaption(TABLE_COLUMN_VALUE_NAME)
.setId(TABLE_COLUMN_VALUE_NAME);
grid.setColumnOrder(TABLE_COLUMN_METHOD_NAME, TABLE_COLUMN_VALUE_NAME);
grid.setStyleGenerator(result -> {
if (result.getValue() > MAX_ALLOWED_VALUES)
return ERROR_STYLE;
return NONE;
});
grid.setItems(resultList);
grid.setSizeFull();
grid.setWidth(70, Unit.REM);
mainPanel.addComponent(grid);
mainPanel.setComponentAlignment(grid, Alignment.MIDDLE_CENTER);
}
示例4: buildGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
grid = new Grid();
grid.setSelectionMode(SelectionMode.NONE);
grid.setSizeFull();
grid.setEditorEnabled(!readOnly);
container = new BeanItemContainer<Record>(Record.class);
grid.setContainerDataSource(container);
grid.setColumnOrder("entityName", "attributeName", "excelMapping");
HeaderRow filterRow = grid.appendHeaderRow();
addColumn("entityName", filterRow);
addColumn("attributeName", filterRow);
TextField tfExcelMapping = new TextField();
tfExcelMapping.addBlurListener(e->saveExcelMappingSettings());
tfExcelMapping.setWidth(100, Unit.PERCENTAGE);
tfExcelMapping.setImmediate(true);
grid.getColumn("excelMapping").setEditorField(tfExcelMapping).setExpandRatio(1);
addShowPopulatedFilter("excelMapping", filterRow);
grid.setEditorBuffered(false);
addComponent(grid);
setExpandRatio(grid, 1);
}
示例5: init
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
public void init(String uniqueId, Class<E> entityClazz)
{
if (!getSecurityManager().canUserView())
{
this.setSizeFull();
this.setCompositionRoot(new Label("Sorry, you do not have permission to access " + getTitle()));
return;
}
container = getContainer();
grid = new Grid(new GeneratedPropertyContainer(container));
grid.setSizeFull();
searchBar = buildSearchBar();
mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
addTitle(mainLayout);
mainLayout.addComponent(searchBar);
mainLayout.addComponent(grid);
mainLayout.setExpandRatio(grid, 1);
this.setCompositionRoot(mainLayout);
headingPropertySet = getHeadingPropertySet();
headingPropertySet.setDeferLoadSettings(true);
headingPropertySet.applyToGrid(entityClazz, grid, uniqueId);
}
示例6: getAllMetricsGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid<MetricsGridRow> getAllMetricsGrid(Map<String, Number> metrics) {
allMetricsRows = metrics.entrySet().stream()
.map(MetricsGridRow::new)
.collect(Collectors.toList());
Grid<MetricsGridRow> grid = new Grid<>(MetricsGridRow.class);
grid.removeAllColumns();
Column<MetricsGridRow, String> nameColumn = grid.addColumn(MetricsGridRow::getName)
.setCaption("Name")
.setExpandRatio(1);
grid.addColumn(MetricsGridRow::getValue).setCaption("Value");
grid.setItems(allMetricsRows);
grid.sort(nameColumn);
grid.setSizeFull();
grid.setRowHeight(40);
TextField filterInput = new TextField();
filterInput.setPlaceholder("filter by metric...");
filterInput.addValueChangeListener(e -> updateMetrics(e.getValue()));
filterInput.setValueChangeMode(ValueChangeMode.LAZY);
filterInput.setSizeFull();
// Header row
HeaderRow filterRow = grid.addHeaderRowAt(grid.getHeaderRowCount());
filterRow.getCell(nameColumn).setComponent(filterInput);
return grid;
}
示例7: init
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
@Override
protected void init(VaadinRequest vaadinRequest) {
BeanItemContainer<Workout> container = new BeanItemContainer<>(
Workout.class, new WorkoutDataReader().run());
Grid grid = new Grid();
grid.setContainerDataSource(container);
grid.getColumn("sport").setRenderer(new ImageRenderer());
grid.setSizeFull();
setContent(grid);
}
示例8: initGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private void initGrid(final Grid grid) {
// Add some columns
DeleteButtonRenderer deleteButton = new DeleteButtonRenderer(new DeleteRendererClickListener() {
@Override
public void click(DeleteRendererClickEvent event) {
grid.getContainerDataSource().removeItem(event.getItem());
}
},FontAwesome.TRASH.getHtml()+" Delete",FontAwesome.CHECK.getHtml()+" Confirm");
deleteButton.setHtmlContentAllowed(true);
grid.addColumn("action", Boolean.class);
grid.getColumn("action").setEditable(false);
grid.getColumn("action").setRenderer(deleteButton);
grid.addColumn("col1", String.class);
grid.addColumn("col2", String.class);
for (int i = 0; i < 5; ++i) {
grid.addColumn("col" + (i + 3), Integer.class);
}
grid.addColumn("col8", Date.class);
grid.addColumn("col10", Boolean.class);
grid.addColumn("col11", String.class);
ComboBox comboBox = new ComboBox();
comboBox.addItems("Soft","Medium","Hard");
grid.getColumn("col11").setEditorField(comboBox);
// Make column 2 read only to test statically read only columns
grid.getColumn("col2").setEditable(false);
Random rand = new Random();
for (int i = 0; i < 100; ++i) {
grid.addRow(true,"string 1 " + i, "string 2 " + i, rand.nextInt(i + 10),
rand.nextInt(i + 10), rand.nextInt(i + 10),
rand.nextInt(i + 10), rand.nextInt(i + 10), new Date(), false, "Medium");
}
grid.setSelectionMode(SelectionMode.SINGLE);
grid.setSizeFull();
}
示例9: createGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid createGrid(SparklineRenderer sparkline) {
BeanItemContainer<MyPojo> container = new BeanItemContainer<MyPojo>(MyPojo.class);
for (int i = 0; i < 1000; ++i) {
container.addBean(new MyPojo(i));
}
Grid grid = new Grid();
grid.setSizeFull();
RowIndexRenderer rowIndex = new RowIndexRenderer();
GeneratedPropertyContainer gpc = rowIndex.addGeneratedProperty("index", container);
grid.setContainerDataSource(gpc);
grid.getColumn("index").setRenderer(rowIndex);
grid.getColumn("numbers").setRenderer(sparkline);
grid.getColumn("stars").setRenderer(new RatingStarsRenderer(5));
grid.getColumn("stars").setEditable(false);
HtmlButtonRenderer htmlButtonRenderer = new HtmlButtonRenderer(new HtmlButtonRendererClickListener() {
@Override
public void click(HtmlButtonRendererClickEvent event) {
Notification.show("Java button was clicked");
}
});
htmlButtonRenderer.setHtmlContentAllowed(true);
grid.getColumn("foo").setRenderer(htmlButtonRenderer);
grid.getColumn("foo").setEditable(false);
grid.setColumns("index", "id", "foo", "bar", "stars", "numbers");
return grid;
}
示例10: createGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
private Grid createGrid() {
final Grid statusGrid = new Grid(uploads);
statusGrid.addStyleName(SPUIStyleDefinitions.UPLOAD_STATUS_GRID);
statusGrid.setSelectionMode(SelectionMode.NONE);
statusGrid.setHeaderVisible(true);
statusGrid.setImmediate(true);
statusGrid.setSizeFull();
return statusGrid;
}
示例11: initGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
/**
* Initializes the grid
*/
protected void initGrid() {
// Init the grid with Caption, alternatively can initialize the same
// with passing the datasource
grid = new Grid();
grid.setContainerDataSource(getDatasource());
grid.setSizeFull();
grid.setImmediate(true);
setDefaultGridProperties();
}
示例12: initialize
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
@PostConstruct
protected void initialize() {
setSizeFull();
grid = new Grid();
grid.setSizeFull();
grid.addColumn("firstName", String.class);
grid.addColumn("lastName", String.class);
addComponent(grid);
}
示例13: getTargetComponent
import com.vaadin.ui.Grid; //導入方法依賴的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;
}
示例14: buildGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
grid = new Grid();
grid.setEditorEnabled(true);
grid.setSizeFull();
grid.setSelectionMode(SelectionMode.SINGLE);
grid.setColumns("projectName","newDeployName","newDeployVersion",
"newDeployType","existingDeployName","existingDeployVersion",
"existingDeployType","upgrade");
container = new BeanItemContainer<>(DeploymentLine.class);
buildContainer();
grid.setContainerDataSource(container);
grid.sort("projectName", SortDirection.DESCENDING);
}
示例15: buildGrid
import com.vaadin.ui.Grid; //導入方法依賴的package包/類
protected void buildGrid() {
grid = new Grid();
grid.setSelectionMode(SelectionMode.NONE);
grid.setSizeFull();
grid.setEditorEnabled(!readOnly);
container = new BeanItemContainer<Record>(Record.class);
grid.setContainerDataSource(container);
grid.setColumns("entityName", "attributeName", "xpath");
HeaderRow filterRow = grid.appendHeaderRow();
addColumn("entityName", filterRow);
addColumn("attributeName", filterRow);
ComboBox combo = new ComboBox();
combo.addValueChangeListener(e->saveXPathSettings());
combo.setWidth(100, Unit.PERCENTAGE);
combo.setImmediate(true);
combo.setNewItemsAllowed(true);
combo.setInvalidAllowed(true);
combo.setTextInputAllowed(true);
combo.setScrollToSelectedItem(true);
combo.setFilteringMode(FilteringMode.CONTAINS);
grid.getColumn("xpath").setEditorField(combo).setExpandRatio(1);
addShowPopulatedFilter("xpath", filterRow);
grid.setEditorBuffered(false);
addComponent(grid);
setExpandRatio(grid, 1);
}