Interface TableSelectionHandler


  • public interface TableSelectionHandler

    Definition of an interface that allows changing the way a selected or focused cell in the table is displayed.

    If custom editors or renderers are installed for columns of a table the components used for this purpose must reflect the selected and/or focused state of the represented cell. The platform specific table implementations will provide defaults for doing this. If an application needs a very specific way of marking cells as selected or focused, it can create a specialized implementation of this interface.

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

      • prepareComponent

        void prepareComponent​(Object table,
                              TableTag tableTag,
                              Object component,
                              boolean selected,
                              boolean hasFocus,
                              int row,
                              int col)
        Prepares the renderer or editor component before it is displayed. This method is called whenever a custom renderer or editor component is requested. An implementation can initialize this component in an arbitrary way based on the passed in parameters.
        Parameters:
        table - the table component
        tableTag - the tag representing the affected table
        component - the component that is used as custom renderer or editor
        selected - a flag whether the cell is selected
        hasFocus - a flag whether the cell has the focus
        row - the index of the affected row
        col - the index of the affected column