Package jexer

Class TTableWidget.Cell

  • All Implemented Interfaces:
    java.lang.Comparable<TWidget>
    Enclosing class:
    TTableWidget

    public class TTableWidget.Cell
    extends TWidget
    Cell represents an editable cell in the table. Normally, navigation to a cell only highlights it; pressing Enter or F2 will switch to editing mode.
    • Constructor Detail

      • Cell

        public Cell​(TTableWidget parent,
                    int x,
                    int y,
                    int width,
                    int height,
                    int column,
                    int row)
        Public constructor.
        Parameters:
        parent - parent widget
        x - column relative to parent
        y - row relative to parent
        width - width of widget
        height - height of widget
        column - column index of this cell
        row - row index of this cell
    • Method Detail

      • onMouseDoubleClick

        public void onMouseDoubleClick​(TMouseEvent mouse)
        Handle mouse double-click events.
        Overrides:
        onMouseDoubleClick in class TWidget
        Parameters:
        mouse - mouse double-click event
      • onMouseDown

        public void onMouseDown​(TMouseEvent mouse)
        Handle mouse press events.
        Overrides:
        onMouseDown in class TWidget
        Parameters:
        mouse - mouse button press event
      • onMouseUp

        public void onMouseUp​(TMouseEvent mouse)
        Handle mouse release events.
        Overrides:
        onMouseUp in class TWidget
        Parameters:
        mouse - mouse button release event
      • onKeypress

        public void onKeypress​(TKeypressEvent keypress)
        Handle keystrokes.
        Overrides:
        onKeypress in class TWidget
        Parameters:
        keypress - keystroke event
      • draw

        public void draw()
        Draw this cell.
        Overrides:
        draw in class TWidget
      • getText

        public final java.lang.String getText()
        Get field text.
        Returns:
        field text
      • setText

        public void setText​(java.lang.String text)
        Set field text.
        Parameters:
        text - the new field text
      • cancelEdit

        public void cancelEdit()
        Cancel any pending edit.
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
        Set an entire column of cells read-only (non-editable) or not.
        Parameters:
        readOnly - if true, the cells will be non-editable