Class ConfigPropertyEditor.DescribingRenderer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, TableCellRenderer
Enclosing class:
ConfigPropertyEditor

public static class ConfigPropertyEditor.DescribingRenderer extends JLabel implements TableCellRenderer
Table-Cell renderer that describes its contents rather than displays its contents. An instance of this renderer can be used with ConfigPropertyEditor.addRE(String,TableCellRenderer,TableCellEditor) for cases where the contents of a cell should not be displayed and one wants a description of its contents instead.

A function maps the value to the string describing it. If the value is a string, the string is trimmed and if the resulting length is 0, the value is handled as if it were null. Any text that is displayed by this renderer will be bracketed by square brackets.

This renderer will use colors that are the same as those used for indicating encrypted text.

See Also:
  • Constructor Details

    • DescribingRenderer

      public DescribingRenderer(Function<Object,String> textFunction, boolean isBordered)
      Constructor.
      Parameters:
      textFunction - a function that maps the value of a cell to a string that should be displayed when the contents are not empty
      isBordered - true if this cell renderer should use a border; false otherwise
      Throws:
      IllegalArgumentException - if the first argument is null
  • Method Details