Class SwingTableSelectionHandler

  • All Implemented Interfaces:
    net.sf.jguiraffe.gui.builder.components.tags.table.TableSelectionHandler

    public class SwingTableSelectionHandler
    extends Object
    implements net.sf.jguiraffe.gui.builder.components.tags.table.TableSelectionHandler

    A Swing-specific default implementation of the TableSelectionHandler interface.

    This implementation expects that the component passed in to the prepareComponent() method is a javax.swing.JComponent. Depending on the selected or focused flags the color of this component will be set, and eventually a border will be drawn.

    Version:
    $Id: SwingTableSelectionHandler.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Constructor Detail

      • SwingTableSelectionHandler

        public SwingTableSelectionHandler()
    • Method Detail

      • prepareComponent

        public void prepareComponent​(Object table,
                                     net.sf.jguiraffe.gui.builder.components.tags.table.TableTag tableTag,
                                     Object component,
                                     boolean selected,
                                     boolean hasFocus,
                                     int row,
                                     int col)
        Prepares the renderer or editor component. This implementation will set the correct colors and a border for focused cells.
        Specified by:
        prepareComponent in interface net.sf.jguiraffe.gui.builder.components.tags.table.TableSelectionHandler
        Parameters:
        table - the table component
        tableTag - the table tag
        component - the component to be prepared
        selected - a flag whether this cell is selected
        hasFocus - a flag whether this cell has the focus
        row - the current row index
        col - the current column index