当前位置: 首页>>代码示例>>Java>>正文


Java CellStyleGenerator类代码示例

本文整理汇总了Java中com.vaadin.ui.Table.CellStyleGenerator的典型用法代码示例。如果您正苦于以下问题:Java CellStyleGenerator类的具体用法?Java CellStyleGenerator怎么用?Java CellStyleGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CellStyleGenerator类属于com.vaadin.ui.Table包,在下文中一共展示了CellStyleGenerator类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initSelectionTable

import com.vaadin.ui.Table.CellStyleGenerator; //导入依赖的package包/类
protected void initSelectionTable() {
  selectionTable = new Table();
  selectionTable.setSizeUndefined();
  selectionTable.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
  selectionTable.setSelectable(true);
  selectionTable.setImmediate(true);
  selectionTable.setNullSelectionAllowed(false);
  selectionTable.setWidth(150, UNITS_PIXELS);
  selectionTable.setHeight(100, UNITS_PERCENTAGE);

  selectionTable.setCellStyleGenerator(new CellStyleGenerator() {
    private static final long serialVersionUID = 1L;
    public String getStyle(Object itemId, Object propertyId) {
      if("name".equals(propertyId)) {
        return ExplorerLayout.STYLE_RELATED_CONTENT_CREATE_LIST_LAST_COLUMN;
      }
      return null;
    }
  });

  selectionTable.addStyleName(ExplorerLayout.STYLE_RELATED_CONTENT_CREATE_LIST);

  selectionTable.addContainerProperty("type", Embedded.class, null);
  selectionTable.setColumnWidth("type", 22);
  selectionTable.addContainerProperty("name", String.class, null);

  // Listener to switch to the selected component
  selectionTable.addListener(new ValueChangeListener() {
    private static final long serialVersionUID = 1L;
    public void valueChange(ValueChangeEvent event) {
      String name = (String) event.getProperty().getValue();
      if (name != null) {
        currentSelection = name;
        currentComponent = components.get(name);
        selectedComponentLayout.removeComponent(selectedComponentLayout.getComponent(0, 0));
        if (currentComponent != null) {
          currentComponent.setSizeFull();
          selectedComponentLayout.addComponent(currentComponent, 0, 0);
          okButton.setEnabled(true);
        } else {
          okButton.setEnabled(false);
        }
      } 
    }
  });
  windowLayout.addComponent(selectionTable);
}
 
开发者ID:logicalhacking,项目名称:SecureBPMN,代码行数:48,代码来源:TabbedSelectionWindow.java


注:本文中的com.vaadin.ui.Table.CellStyleGenerator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。