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


Java Table.setVisibleColumns方法代碼示例

本文整理匯總了Java中com.vaadin.ui.Table.setVisibleColumns方法的典型用法代碼示例。如果您正苦於以下問題:Java Table.setVisibleColumns方法的具體用法?Java Table.setVisibleColumns怎麽用?Java Table.setVisibleColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.Table的用法示例。


在下文中一共展示了Table.setVisibleColumns方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setTableColumnDetails

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private void setTableColumnDetails(final Table table) {

        table.setColumnHeader(PROVIDED_FILE_NAME, i18n.getMessage("upload.file.name"));
        table.setColumnHeader(SIZE, i18n.getMessage("upload.size"));
        if (fullWindowMode) {
            table.setColumnHeader(SHA1HASH, i18n.getMessage("upload.sha1"));
            table.setColumnHeader(MD5HASH, i18n.getMessage("upload.md5"));
        }
        table.setColumnHeader(CREATE_MODIFIED_DATE_UPLOAD, i18n.getMessage("upload.last.modified.date"));
        if (!readOnly) {
            table.setColumnHeader(ACTION, i18n.getMessage("upload.action"));
        }

        table.setColumnExpandRatio(PROVIDED_FILE_NAME, 3.5F);
        table.setColumnExpandRatio(SIZE, 2F);
        if (fullWindowMode) {
            table.setColumnExpandRatio(SHA1HASH, 2.8F);
            table.setColumnExpandRatio(MD5HASH, 2.4F);
        }
        table.setColumnExpandRatio(CREATE_MODIFIED_DATE_UPLOAD, 3F);
        if (!readOnly) {
            table.setColumnExpandRatio(ACTION, 2.5F);
        }

        table.setVisibleColumns(getVisbleColumns().toArray());
    }
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:27,代碼來源:ArtifactDetailsLayout.java

示例2: buildSelectedTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private void buildSelectedTable() {

        selectedTable = new Table();
        selectedTable.setId(SPUIDefinitions.TWIN_TABLE_SELECTED_ID);
        selectedTable.setSelectable(true);
        selectedTable.setMultiSelect(true);
        selectedTable.setSortEnabled(false);
        selectedTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
        selectedTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
        selectedTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
        selectedTable.addStyleName(ValoTheme.TABLE_SMALL);
        selectedTable.addStyleName("dist_type_twin-table");
        selectedTable.setSizeFull();
        createSelectedTableContainer();
        selectedTable.setContainerDataSource(selectedTableContainer);
        addTooltTipToSelectedTable();
        selectedTable.setImmediate(true);
        selectedTable.setVisibleColumns(DIST_TYPE_NAME, DIST_TYPE_MANDATORY);
        selectedTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.selected"), STAR);
        selectedTable.setColumnExpandRatio(DIST_TYPE_NAME, 0.75F);
        selectedTable.setColumnExpandRatio(DIST_TYPE_MANDATORY, 0.25F);
        selectedTable.setRequired(true);
    }
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:24,代碼來源:CreateUpdateDistSetTypeLayout.java

示例3: applyTo

import com.vaadin.ui.Table; //導入方法依賴的package包/類
public void applyTo(Table t) {
	final Object[] saved;
	saved = t.getVisibleColumns();

	if (saved.length != visibleColumns.length)
		return;

	try {
		t.setVisibleColumns(visibleColumns);
	} catch (IllegalArgumentException nothing) {
		t.setVisibleColumns(saved);
		return;
	}

	for (int i = 0; i < visibleColumns.length; i++) {
		t.setColumnWidth(visibleColumns[i], widths[i]);
		t.setColumnCollapsed(visibleColumns[i], collapsed[i]);
	}
}
 
開發者ID:mi9rom,項目名稱:VaadHL,代碼行數:20,代碼來源:TableState.java

示例4: buildSourceTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
/**
*
*/
private void buildSourceTable() {

    sourceTable = new Table();
    sourceTable.setId(SPUIDefinitions.TWIN_TABLE_SOURCE_ID);
    sourceTable.setSelectable(true);
    sourceTable.setMultiSelect(true);
    sourceTable.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    sourceTable.addStyleName(ValoTheme.TABLE_NO_STRIPES);
    sourceTable.addStyleName(ValoTheme.TABLE_NO_VERTICAL_LINES);
    sourceTable.addStyleName(ValoTheme.TABLE_SMALL);
    sourceTable.setImmediate(true);
    sourceTable.setSizeFull();
    sourceTable.addStyleName("dist_type_twin-table");
    sourceTable.setSortEnabled(false);
    sourceTableContainer = new IndexedContainer();
    sourceTableContainer.addContainerProperty(DIST_TYPE_NAME, String.class, "");
    sourceTableContainer.addContainerProperty(DIST_TYPE_DESCRIPTION, String.class, "");
    sourceTable.setContainerDataSource(sourceTableContainer);

    sourceTable.setVisibleColumns(DIST_TYPE_NAME);
    sourceTable.setColumnHeaders(i18n.getMessage("header.dist.twintable.available"));
    sourceTable.setColumnExpandRatio(DIST_TYPE_NAME, 1.0F);
    getSourceTableData();
    addTooltip();
    sourceTable.select(sourceTable.firstItemId());
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:30,代碼來源:CreateUpdateDistSetTypeLayout.java

示例5: setPropertyColumns

import com.vaadin.ui.Table; //導入方法依賴的package包/類
public void setPropertyColumns(Iterable<P> columns) {
	ObjectUtils.argumentNotNull(columns, "Property columns must be not null");

	final Object[] columnsArray = ConversionUtils.iterableAsList(columns).toArray();

	switch (getRenderingMode()) {
	case GRID: {
		final Grid grid = getGrid();
		// set columns
		grid.setColumns(columnsArray);
		// setup columns
		for (P column : columns) {
			Column c = grid.getColumn(column);
			// setup column
			setupGridPropertyColumn(column, c);
			// setup renderer and converter
			setupRendererAndConverter(column, c);
		}
	}
		break;
	case TABLE: {
		final Table table = getTable();
		try {
			duringSetup = true;
			// Setup columns and check Component generated columns
			for (P property : columns) {
				// column settings
				setupTablePropertyColumn(property, table);
				// generated columns
				Class<?> type = getPropertyColumnType(property);
				if (type != null && Component.class.isAssignableFrom(type)) {
					if (table.getColumnGenerator(property) == null) {
						table.addGeneratedColumn(property, new VirtualPropertyGenerator());
					}
				}
			}
		} finally {
			duringSetup = false;
		}
		// set columns
		table.setVisibleColumns(columnsArray);
	}
		break;
	default:
		break;
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:48,代碼來源:DefaultItemListing.java

示例6: buildTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table buildTable() {
    final Table table = new Table() {
        @Override
        protected String formatPropertyValue(final Object rowId,
                final Object colId, final Property<?> property) {
            String result = super.formatPropertyValue(rowId, colId,
                    property);
            if (colId.equals("time")) {
                result = DATEFORMAT.format(((Date) property.getValue()));
            } else if (colId.equals("price")) {
                if (property != null && property.getValue() != null) {
                    return "$" + DECIMALFORMAT.format(property.getValue());
                } else {
                    return "";
                }
            }
            return result;
        }
    };
    table.setSizeFull();
    table.addStyleName(ValoTheme.TABLE_BORDERLESS);
    table.addStyleName(ValoTheme.TABLE_NO_HORIZONTAL_LINES);
    table.addStyleName(ValoTheme.TABLE_COMPACT);
    table.setSelectable(true);

    table.setColumnCollapsingAllowed(true);
    table.setColumnCollapsible("time", false);
    table.setColumnCollapsible("price", false);

    table.setColumnReorderingAllowed(true);
    table.setContainerDataSource(new TempTransactionsContainer(DashboardUI
            .getDataProvider().getRecentTransactions(200)));
    table.setSortContainerPropertyId("time");
    table.setSortAscending(false);

    table.setColumnAlignment("seats", Align.RIGHT);
    table.setColumnAlignment("price", Align.RIGHT);

    table.setVisibleColumns("time", "country", "city", "theater", "room",
            "title", "seats", "price");
    table.setColumnHeaders("Time", "Country", "City", "Theater", "Room",
            "Title", "Seats", "Price");

    table.setFooterVisible(true);
    table.setColumnFooter("time", "Total");

    table.setColumnFooter(
            "price",
            "$"
                    + DECIMALFORMAT.format(DashboardUI.getDataProvider()
                            .getTotalSum()));

    // Allow dragging items to the reports menu
    table.setDragMode(TableDragMode.MULTIROW);
    table.setMultiSelect(true);

    table.addActionHandler(new TransactionsActionHandler());

    table.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(final ValueChangeEvent event) {
            if (table.getValue() instanceof Set) {
                Set<Object> val = (Set<Object>) table.getValue();
                createReport.setEnabled(val.size() > 0);
            }
        }
    });
    table.setImmediate(true);

    return table;
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:72,代碼來源:TransactionsView.java


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