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


Java Table.setColumnReorderingAllowed方法代碼示例

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


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

示例1: createTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing email table with empty values
    table.addItem(new Object[] { "Outgoing Mail Server (SMTP): ", "" }, new Integer(1));
    table.addItem(new Object[] { "Port: ", "" }, new Integer(2));
    table.addItem(new Object[] { "Email Id: ", "" }, new Integer(3));

    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:21,代碼來源:EmailLayout.java

示例2: createNetworkTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createNetworkTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "IPv4 Address: ", "" }, new Integer(1));
    table.addItem(new Object[] { "Netmask:", "" }, new Integer(2));
    table.addItem(new Object[] { "Default Gateway: ", "" }, new Integer(3));
    table.addItem(new Object[] { "Primary DNS Server: ", "" }, new Integer(4));
    table.addItem(new Object[] { "Secondary DNS Server: ", "" }, new Integer(5));
    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:22,代碼來源:NetworkLayout.java

示例3: createNATTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createNATTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Value", String.class, null);

    // initializing network table with empty values
    table.addItem(new Object[] { "Public IPv4 Address: ", "" }, new Integer(1));
    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:18,代碼來源:NetworkLayout.java

示例4: addTableData

import com.vaadin.ui.Table; //導入方法依賴的package包/類
protected void addTableData() {
  LazyLoadingQuery lazyLoadingQuery = new TableDataQuery(tableName, managementService);
  LazyLoadingContainer lazyLoadingContainer = new LazyLoadingContainer(lazyLoadingQuery, 10);
  
  if (lazyLoadingContainer.size() > 0) {
    
    Table data = new Table();
    data.setContainerDataSource(lazyLoadingContainer);
    data.setEditable(false);
    data.setSelectable(true);
    data.setColumnReorderingAllowed(true);
    if (lazyLoadingQuery.size() < 10) {
      data.setPageLength(0);
    } else {
      data.setPageLength(10);
    }
    addDetailComponent(data);
    
    data.setWidth(100, UNITS_PERCENTAGE);
    data.setHeight(100, UNITS_PERCENTAGE);
    data.addStyleName(ExplorerLayout.STYLE_DATABASE_TABLE);
    setDetailExpandRatio(data, 1.0f);
    
    // Create column headers
    TableMetaData metaData = managementService.getTableMetaData(tableName);
    for (String columnName : metaData.getColumnNames()) {
      data.addContainerProperty(columnName, String.class, null);
    }
    
  } else {
    Label noDataLabel = new Label(i18nManager.getMessage(Messages.DATABASE_NO_ROWS));
    noDataLabel.addStyleName(Reindeer.LABEL_SMALL);
    addDetailComponent(noDataLabel);
    setDetailExpandRatio(noDataLabel, 1.0f);
  }
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:37,代碼來源:DatabaseDetailPanel.java

示例5: createTable

import com.vaadin.ui.Table; //導入方法依賴的package包/類
private Table createTable() {
    Table table = new Table();
    table.setSizeFull();
    table.setPageLength(0);
    table.setSelectable(false);
    table.setColumnCollapsingAllowed(true);
    table.setColumnReorderingAllowed(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.addContainerProperty("Name", String.class, null);
    table.addContainerProperty("Status", String.class, null);
    table.setColumnHeaderMode(Table.ColumnHeaderMode.HIDDEN);
    return table;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:15,代碼來源:SummaryLayout.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.setColumnReorderingAllowed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。