Package jexer
Class TTableWidget.Cell
- java.lang.Object
-
- jexer.TWidget
-
- jexer.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 Summary
Constructors Constructor Description Cell(TTableWidget parent, int x, int y, int width, int height, int column, int row)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelEdit()
Cancel any pending edit.void
draw()
Draw this cell.java.lang.String
getText()
Get field text.void
onKeypress(TKeypressEvent keypress)
Handle keystrokes.void
onMouseDoubleClick(TMouseEvent mouse)
Handle mouse double-click events.void
onMouseDown(TMouseEvent mouse)
Handle mouse press events.void
onMouseUp(TMouseEvent mouse)
Handle mouse release events.void
setReadOnly(boolean readOnly)
Set an entire column of cells read-only (non-editable) or not.void
setText(java.lang.String text)
Set field text.-
Methods inherited from class jexer.TWidget
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, close, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseMotion, onResize, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
-
-
-
-
Constructor Detail
-
Cell
public Cell(TTableWidget parent, int x, int y, int width, int height, int column, int row)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentwidth
- width of widgetheight
- height of widgetcolumn
- column index of this cellrow
- row index of this cell
-
-
Method Detail
-
onMouseDoubleClick
public void onMouseDoubleClick(TMouseEvent mouse)
Handle mouse double-click events.- Overrides:
onMouseDoubleClick
in classTWidget
- Parameters:
mouse
- mouse double-click event
-
onMouseDown
public void onMouseDown(TMouseEvent mouse)
Handle mouse press events.- Overrides:
onMouseDown
in classTWidget
- Parameters:
mouse
- mouse button press event
-
onMouseUp
public void onMouseUp(TMouseEvent mouse)
Handle mouse release events.
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypress
in classTWidget
- Parameters:
keypress
- keystroke event
-
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
-
-