Java 类com.intellij.ui.treeStructure.treetable.TreeColumnInfo 实例源码

项目:intellij-ce-playground    文件:PlatformComponentsPanel.java   
private void createUIComponents() {
  UpdaterTreeNode.Renderer renderer = new SummaryTreeNode.Renderer();

  myPlatformLoadingIcon = new AsyncProcessIcon("Loading...");
  myPlatformSummaryRootNode = new RootNode();
  myPlatformDetailsRootNode = new RootNode();
  ColumnInfo[] platformSummaryColumns =
    new ColumnInfo[]{new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new ApiLevelColumnInfo(), new RevisionColumnInfo(),
      new StatusColumnInfo()};
  myPlatformSummaryTable = new TreeTableView(new ListTreeTableModelOnColumns(myPlatformSummaryRootNode, platformSummaryColumns));
  SdkUpdaterConfigPanel.setTreeTableProperties(myPlatformSummaryTable, renderer);
  MouseListener modificationListener = new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      refreshModified();
    }
  };
  myPlatformSummaryTable.addMouseListener(modificationListener);

  ColumnInfo[] platformDetailColumns =
    new ColumnInfo[]{new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new ApiLevelColumnInfo(), new RevisionColumnInfo(),
      new StatusColumnInfo()};
  myPlatformDetailTable = new TreeTableView(new ListTreeTableModelOnColumns(myPlatformDetailsRootNode, platformDetailColumns));
  SdkUpdaterConfigPanel.setTreeTableProperties(myPlatformDetailTable, renderer);
  myPlatformDetailTable.addMouseListener(modificationListener);
}
项目:intellij-ce-playground    文件:ToolComponentsPanel.java   
private void createUIComponents() {
  myToolsLoadingIcon = new AsyncProcessIcon("Loading...");

  myToolsSummaryRootNode = new RootNode();
  myToolsDetailsRootNode = new RootNode();

  UpdaterTreeNode.Renderer renderer = new SummaryTreeNode.Renderer();

  ColumnInfo[] toolsSummaryColumns =
    new ColumnInfo[]{new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new VersionColumnInfo(), new StatusColumnInfo()};
  myToolsSummaryTable = new TreeTableView(new ListTreeTableModelOnColumns(myToolsSummaryRootNode, toolsSummaryColumns));

  SdkUpdaterConfigPanel.setTreeTableProperties(myToolsSummaryTable, renderer);

  ColumnInfo[] toolsDetailColumns =
    new ColumnInfo[]{new DownloadStatusColumnInfo(), new TreeColumnInfo("Name"), new VersionColumnInfo(), new StatusColumnInfo()};
  myToolsDetailTable = new TreeTableView(new ListTreeTableModelOnColumns(myToolsDetailsRootNode, toolsDetailColumns));
  SdkUpdaterConfigPanel.setTreeTableProperties(myToolsDetailTable, renderer);

  MouseListener modificationListener = new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      refreshModified();
    }
  };
  myToolsDetailTable.addMouseListener(modificationListener);
  myToolsSummaryTable.addMouseListener(modificationListener);
}
项目:vso-intellij    文件:CustomTreeTable.java   
private static <T> TreeTableModel createModel(final Collection<? extends TreeTableColumn<T>> columns,
                                              final ContentProvider<T> contentProvider) {
    final Collection<ColumnInfo> columnsInfos = new ArrayList<ColumnInfo>(columns.size());
    boolean first = true;
    for (final TreeTableColumn<T> column : columns) {
        if (first) {
            columnsInfos.add(new TreeColumnInfo(column.getCaption()));
        } else {
            columnsInfos.add(new ColumnInfo(column.getCaption()) {
                public Object valueOf(final Object o) {
                    return o;
                }

                public Class getColumnClass() {
                    return TableColumnMarker.class;
                }
            });
        }
        first = false;
    }

    final DefaultMutableTreeNode root;
    final Collection<? extends T> rootObjects = contentProvider.getRoots();
    if (!rootObjects.isEmpty()) {
        if (rootObjects.size() == 1) {
            root = new DefaultMutableTreeNode(rootObjects.iterator().next());
            addChildren(root, contentProvider);
        } else {
            root = new DefaultMutableTreeNode(HIDDEN_ROOT);
            for (final T rootObject : rootObjects) {
                final DefaultMutableTreeNode subRoot = new DefaultMutableTreeNode(rootObject);
                addChildren(subRoot, contentProvider);
                root.add(subRoot);
            }
        }
    } else {
        root = null;
    }
    return new ListTreeTableModelOnColumns(root, columnsInfos.toArray(new ColumnInfo[columnsInfos.size()]));
}