Class DefaultTableCellRenderer

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

public class DefaultTableCellRenderer extends JLabel implements TableCellRenderer, Serializable
Port of DefaultTableCellRenderer. Extends JLabel so its peer is the SJLabel surrogate (a real Vaadin Component), satisfying the SJTable bridge's "return a Component-shaped emulator" requirement.

The body is intentionally minimal: getTableCellRendererComponent just routes the value through setValue(Object) (which writes the cell text via JLabel.setText(String)). The selection-foreground / background / font / border-on-focus chrome JDK applies via UIManager defaults is not applied here. R_vaadin_first-acceptable: Vaadin Grid owns the row-selection theme, and our migration shape is "list view + edit form" where in-cell selection chrome rarely matters.

JDK has a static nested DefaultTableCellRenderer.UIResource subclass for L&F-internal sourcing — dropped per R_match_swing_errors sub-bucket (b) (L&F dispatch is permanent). The performance-no-op overrides JDK carries (validate / invalidate / revalidate / repaint / firePropertyChange filter) are preserved verbatim per R_swing_is_truth — they're inert in our world but keep the JDK shape intact for migrated user-subclasses.

See Also:
  • Field Details

    • noFocusBorder

      protected static Border noFocusBorder
  • Constructor Details

    • DefaultTableCellRenderer

      public DefaultTableCellRenderer()
  • Method Details

    • setForeground

      public void setForeground(Color c)
      Overrides:
      setForeground in class JComponent
    • setBackground

      public void setBackground(Color c)
      Overrides:
      setBackground in class JComponent
    • updateUI

      public void updateUI()
      Overrides:
      updateUI in class JLabel
    • getTableCellRendererComponent

      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
      Description copied from interface: TableCellRenderer
      Build the rendering component for value.
      Specified by:
      getTableCellRendererComponent in interface TableCellRenderer
      Parameters:
      table - the rendering host — emulator JTable in emulator-flow, null from pure-surrogate contexts.
      value - the cell value to render. null is valid.
      isSelected - true if the cell is to be rendered with the selection highlighted.
      hasFocus - true if the cell has keyboard focus. Vaadin Grid has no per-cell focus signal at render time; the SJTable bridge always passes false (R_vaadin_first sub-bucket (c)).
      row - the row index of the cell being drawn. When drawing a column header, the value is -1.
      column - the column index of the cell being drawn.
    • isOpaque

      public boolean isOpaque()
      Overrides:
      isOpaque in class JComponent
    • invalidate

      public void invalidate()
      Overrides:
      invalidate in class Container
    • validate

      public void validate()
      Overrides:
      validate in class Container
    • revalidate

      public void revalidate()
      Overrides:
      revalidate in class JComponent
    • repaint

      public void repaint(long tm, int x, int y, int width, int height)
      Overrides:
      repaint in class JComponent
    • repaint

      public void repaint(Rectangle r)
      Overrides:
      repaint in class JComponent
    • repaint

      public void repaint()
      Overrides:
      repaint in class Component
    • firePropertyChange

      protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)
      Overrides:
      firePropertyChange in class Component
    • firePropertyChange

      public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
      Overrides:
      firePropertyChange in class JComponent
    • setValue

      protected void setValue(Object value)
      Sets the cell's text from value. Migrated subclasses commonly override this hook to format values differently (currency, dates, yes/no) — the canonical "DefaultTableCellRenderer subclass" pattern.