Class PLinkRenderer

All Implemented Interfaces:
Exportable, ImageObserver, MenuContainer, Serializable, Accessible, ListCellRenderer, SwingConstants, TableCellRenderer

public class PLinkRenderer extends PFieldComponentRenderer
Generic renderer that displays the data as an underlined link.
When using this component with a PIASpreadSheet, the table properties should be set in this order:
  • set column identifiers
  • setIdxDisplayFieldDescription
  • set table modelFieldDescription
  • set column renderers (this renderer)
  • setIdxDisplayFieldFormat (if any)
Version:
%version: 4 % %date_modified: Fri Aug 17 13:09:51 2001 %
Author:
kapono
See Also:
  • Constructor Details

    • PLinkRenderer

      public PLinkRenderer()
      Creates a renderer that displays data in a tablecell as a selectable link. Note that by itself this is fairly useless. You will also need to specify a cell editor or listen for table selection events if you want a 'link selection' to appear to take an action.
      This passes a format of "{0}" to the superclass.
    • PLinkRenderer

      public PLinkRenderer(String format)
      Creates a renderer that displays data in a tablecell as a selectable link. Note that by itself this is fairly useless. You will also need to specify a cell editor or listen for table selection events if you want a 'link selection' to appear to take an action.
      Parameters:
      format - The Java MessageFormat compliant format that should be used to format this data before displaying it.
  • Method Details

    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      Get a renderer for a table cell.
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
      Overrides:
      getTableCellRendererComponent in class PFieldComponentRenderer
      Parameters:
      table - The table we a formatting a cell for.
      value - value The value to format
      isSelected - true if the value is selected
      hasFocus - true if the cell had focus
      row - The table row for the value
      column - The table column of the value
      Returns:
      A renderer for the specified cell.
    • getFormattedLabel

      public Component getFormattedLabel(Object value, Color focusColor)
      Formats the data and returns a component to render the data.
      Overrides:
      getFormattedLabel in class PFieldComponentRenderer
      Parameters:
      value -
      focusColor -
      Returns:
      The component that should be used to render the data in the table cell; in this case a link component