Ejemplo n.º 1
0
 /**
  * Returns the default table cell renderer.
  *
  * @param table the <code>JTable</code>
  * @param value the value to assign to the cell at <code>[row, column]</code>
  * @param isSelected true if cell is selected
  * @param hasFocus true if cell has focus
  * @param row the row of the cell to render
  * @param column the column of the cell to render
  * @return the default table cell renderer
  */
 public Component getTableCellRendererComponent(
     JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
   ReadingList list = model.getLists()[row];
   Component comp =
       super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
   comp.setForeground(list.isMissing() ? Color.GRAY : table.getForeground());
   return comp;
 }
Ejemplo n.º 2
0
    /**
     * Returns value of a cell.
     *
     * @param row row.
     * @param column column.
     * @return value.
     */
    public Object getValueAt(int row, int column) {
      Object value;
      ReadingList list = lists[row];

      switch (column) {
        case COL_NAME:
          value = list.getTitle();
          break;
        case COL_URL:
          value = list.getURL().toString();
          break;
        case COL_LATEST:
          long lastPollTime = list.getLastPollTime();
          value = pollTimeToString(lastPollTime);
          break;
        default:
          value = null;
      }
      return value;
    }