public Component getTableCellRendererComponent()

in src/org/jetbrains/tfsIntegration/ui/MultiLineTableRenderer.java [34:70]


  public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
      super.setForeground(table.getSelectionForeground());
      super.setBackground(table.getSelectionBackground());
    }
    else {
      Color background = table.getBackground();
      if (background == null || background instanceof javax.swing.plaf.UIResource) {
        Color alternateColor = UIManager.getColor("Table.alternateRowColor");
        if (alternateColor != null && row % 2 == 0) background = alternateColor;
      }
      super.setForeground(table.getForeground());
      super.setBackground(background);
    }

    setFont(table.getFont());

    if (hasFocus) {
      if (!isSelected && table.isCellEditable(row, column)) {
        Color col;
        col = UIUtil.getTableFocusCellForeground();
        if (col != null) {
          super.setForeground(col);
        }
        col = UIUtil.getTableFocusCellBackground();
        if (col != null) {
          super.setBackground(col);
        }
      }
    }

    customize(table, this, isSelected, value);

    setSize(table.getColumnModel().getColumn(column).getWidth(), 100000);
    table.setRowHeight(row, getPreferredSize().height);
    return this;
  }