com.vaadin.v7.ui.Table.setColumnWidth()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(314)

本文整理了Java中com.vaadin.v7.ui.Table.setColumnWidth()方法的一些代码示例,展示了Table.setColumnWidth()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.setColumnWidth()方法的具体详情如下:
包路径:com.vaadin.v7.ui.Table
类名称:Table
方法名:setColumnWidth

Table.setColumnWidth介绍

[英]Sets columns width (in pixels). Theme may not necessarily respect very small or very big values. Setting width to -1 (default) means that theme will make decision of width.

Column can either have a fixed width or expand ratio. The latter one set is used. See @link #setColumnExpandRatio(Object,float).
[中]设置列宽(以像素为单位)。主题不一定尊重非常小或非常大的价值观。将宽度设置为-1(默认值)意味着主题将决定宽度。
列可以具有固定的宽度或展开比。使用后一套。参见@link#setColumnExpandRatio(对象,浮点)。

代码示例

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. @Override
  2. public void setRowHeaderWidth(int width) {
  3. component.setColumnWidth(ROW_HEADER_PROPERTY_ID, width);
  4. }

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

  1. private void handleColumnWidthUpdates(Map<String, Object> variables) {
  2. if (variables.containsKey("columnWidthUpdates")) {
  3. String[] events = (String[]) variables.get("columnWidthUpdates");
  4. for (String str : events) {
  5. String[] eventDetails = str.split(":");
  6. Object propertyId = columnIdMap.get(eventDetails[0]);
  7. if (propertyId == null) {
  8. propertyId = ROW_HEADER_FAKE_PROPERTY_ID;
  9. }
  10. int width = Integer.valueOf(eventDetails[1]);
  11. setColumnWidth(propertyId, width);
  12. }
  13. }
  14. }

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

  1. private void fireColumnResizeEvent(Object propertyId, int previousWidth,
  2. int currentWidth) {
  3. /*
  4. * Update the sizes on the server side. If a column previously had a
  5. * expand ratio and the user resized the column then the expand ratio
  6. * will be turned into a static pixel size.
  7. */
  8. setColumnWidth(propertyId, currentWidth);
  9. fireEvent(new ColumnResizeEvent(this, propertyId, previousWidth,
  10. currentWidth));
  11. }

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. component.setColumnWidth(column, Integer.parseInt(width));
  2. } else {
  3. component.setColumnWidth(column, -1);

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. @Override
  2. public void setColumnWidth(Column column, int width) {
  3. checkNotNullArgument(column, "column must be non null");
  4. if (column.getWidth() == null || column.getWidth() != width) {
  5. column.setWidth(width);
  6. }
  7. component.setColumnWidth(column.getId(), width);
  8. }

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

  1. setColumnWidth(id, DesignAttributeHandler.readAttribute(
  2. "width", col.attributes(), Integer.class));

代码示例来源:origin: OpenNMS/opennms

  1. table.setColumnWidth("Key", 100);
  2. table.setColumnWidth("Value", -1);
  3. table.setSizeFull();
  4. verticalLayout.addComponent(table);

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. columnsOrder.add(column);
  2. if (column.getWidth() != null) {
  3. component.setColumnWidth(columnId, column.getWidth());

代码示例来源:origin: com.haulmont.cuba/cuba-web

  1. component.setColumnWidth(ROW_HEADER_PROPERTY_ID, defaultRowHeaderWidth);

相关文章

Table类方法