當前位置: 首頁>>代碼示例>>Java>>正文


Java Grid.setSizeFull方法代碼示例

本文整理匯總了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);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:27,代碼來源:ReleasesView.java

示例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;
	}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:26,代碼來源:TracePage.java

示例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);
}
 
開發者ID:RosesTheN00b,項目名稱:MetricsToGo,代碼行數:27,代碼來源:UIRulePage.java

示例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);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:22,代碼來源:EditExcelReaderPanel.java

示例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);

}
 
開發者ID:rlsutton1,項目名稱:VaadinUtils,代碼行數:26,代碼來源:SearchableGrid.java

示例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;
}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:30,代碼來源:MetricsPage.java

示例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);
}
 
開發者ID:amahdy,項目名稱:java-pwa,代碼行數:14,代碼來源:MyUI.java

示例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();
  }
 
開發者ID:TatuLund,項目名稱:GridFastNavigation,代碼行數:40,代碼來源:DemoUI.java

示例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;
 	}
 
開發者ID:vaadin,項目名稱:grid-renderers-collection-addon,代碼行數:28,代碼來源:DemoUI.java

示例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;
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:10,代碼來源:UploadStatusInfoWindow.java

示例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();
}
 
開發者ID:KrishnaPhani,項目名稱:KrishnasSpace,代碼行數:13,代碼來源:AbstractGridView.java

示例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);
}
 
開發者ID:xyfreemind,項目名稱:trader,代碼行數:12,代碼來源:UsersView.java

示例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;
}
 
開發者ID:vaadin4qbanos,項目名稱:vaadin-jsclipboard-addon,代碼行數:11,代碼來源:GridView.java

示例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);        
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:15,代碼來源:ValidateFlowDeploymentPanel.java

示例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);
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:30,代碼來源:EditXmlFormatPanel.java


注:本文中的com.vaadin.ui.Grid.setSizeFull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。