Package com.intellij.util.ui

Examples of com.intellij.util.ui.ColumnInfo


        }
      }

      public void setValueAt(final Object aValue, Object node, int column) {
        try {
          final ColumnInfo columnInfo = getColumnInfos()[column];
          final JamNodeDescriptor descriptor = getJamNodeDescriptor(node);
          getCachedColumnValues(((DefaultMutableTreeNode) node).getUserObjectPath()).set(column, aValue);
          JamTreeTableView.this.setValueAt(columnInfo, descriptor, aValue);
        }
        catch (LoadingNodeException e) {
View Full Code Here


    final JTableHeader header = myTreeTableView.getTableHeader();
    final FontMetrics fontMetrics = header.getFontMetrics(header.getFont());
    int maxPreferredWidth = 0;
    TableColumn treeColumn = null;
    for (int i = 0; i < columnInfos.length; i++) {
      final ColumnInfo columnInfo = columnInfos[i];
      final TableColumn column = columnModel.getColumn(i);
      final String name = columnInfo.getName();
      final int minWidth = StringUtil.isNotEmpty(name.trim()) ? fontMetrics.stringWidth(name) + 15 : 0;
      column.setMinWidth(minWidth);
      if (TreeTableModel.class.isAssignableFrom(columnInfo.getColumnClass())) {
        treeColumn = column;
        final int preferredWidth = myTreeTableView.getTree().getSize().width;
        column.setPreferredWidth(preferredWidth);
        if (preferredWidth > minWidth) {
          column.setMinWidth(preferredWidth);
        }
      }
      else if (!(columnInfo instanceof JamSpacerColumnInfo)) {
        final int fixedWidth = columnInfo.getWidth(myTreeTableView);
        if (fixedWidth > 0) {
          final int realWidth = Math.max(minWidth, fixedWidth);
          column.setMaxWidth(realWidth);
          column.setMinWidth(realWidth);
          column.setPreferredWidth(realWidth);
        }
        else {
          int preferredWidth = minWidth;
          final String preferredValue = columnInfo.getPreferredStringValue();
          if (preferredValue != null) {
            preferredWidth = Math.max(preferredWidth, fontMetrics.stringWidth(preferredValue));
          }
          column.setPreferredWidth(preferredWidth + columnInfo.getAdditionalWidth());
          final String maxValue = columnInfo.getMaxStringValue();
          if (maxValue != null) {
            column.setMaxWidth(fontMetrics.stringWidth(preferredValue) + columnInfo.getAdditionalWidth());
          }
        }
      }
      maxPreferredWidth = Math.max(maxPreferredWidth, column.getPreferredWidth());
    }
View Full Code Here

    myCache.clear();
  }

  protected void recacheColumn(final int columnIndex) {
    assert columnIndex >= 0 && columnIndex < getColumnInfos().length;
    final ColumnInfo columnInfo = getColumnInfos()[columnIndex];
    myCache.processLeafEntries(new PairProcessor<Object, List<Object>>() {
      public boolean process(final Object o, final List<Object> objects) {
        objects.set(columnIndex, columnInfo.valueOf(o));
        return true;
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.intellij.util.ui.ColumnInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.