Package jexer.ttree
Class TTreeView
- java.lang.Object
-
- jexer.TWidget
-
- jexer.ttree.TTreeView
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispatch()
Perform user selection action.int
getLeftColumn()
Get the left column value.int
getMaximumColumn()
Get the length of the widest item to display.TTreeItem
getSelected()
Get the tree view item that was selected.int
getTopLine()
Get the top line (row) value.int
getTotalLineCount()
Get the total line (rows) count, based on the items that are visible and expanded.TTreeItem
getTreeRoot()
Get the root of the tree.void
onKeypress(TKeypressEvent keypress)
Handle keystrokes.void
setLeftColumn(int leftColumn)
Set the left column value.void
setSelected(TTreeItem item, boolean centerWindow)
Set the new selected tree view item.void
setTopLine(int topLine)
Set the top line value.void
setTreeRoot(TTreeItem treeRoot)
Set the root of the tree.-
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, draw, 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, onMouseDoubleClick, onMouseDown, onMouseMotion, onMouseUp, 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
-
TTreeView
public TTreeView(TWidget parent, int x, int y, int width, int height)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentwidth
- width of tree viewheight
- height of tree view
-
TTreeView
public TTreeView(TWidget parent, int x, int y, int width, int height, TAction action)
Public constructor.- Parameters:
parent
- parent widgetx
- column relative to parenty
- row relative to parentwidth
- width of tree viewheight
- height of tree viewaction
- action to perform when an item is selected
-
-
Method Detail
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypress
in classTWidget
- Parameters:
keypress
- keystroke event
-
getTreeRoot
public final TTreeItem getTreeRoot()
Get the root of the tree.- Returns:
- the root of the tree
-
setTreeRoot
public final void setTreeRoot(TTreeItem treeRoot)
Set the root of the tree.- Parameters:
treeRoot
- the new root of the tree
-
getSelected
public final TTreeItem getSelected()
Get the tree view item that was selected.- Returns:
- the selected item, or null if no item is selected
-
setSelected
public void setSelected(TTreeItem item, boolean centerWindow)
Set the new selected tree view item.- Parameters:
item
- new item that became selectedcenterWindow
- if true, move the window to put the selected into view
-
dispatch
public void dispatch()
Perform user selection action.
-
getLeftColumn
public int getLeftColumn()
Get the left column value. 0 is the leftmost column.- Returns:
- the left column
-
setLeftColumn
public void setLeftColumn(int leftColumn)
Set the left column value. 0 is the leftmost column.- Parameters:
leftColumn
- the new left column
-
getTopLine
public int getTopLine()
Get the top line (row) value. 0 is the topmost line.- Returns:
- the top line
-
setTopLine
public void setTopLine(int topLine)
Set the top line value. 0 is the topmost line.- Parameters:
topLine
- the new top line
-
getTotalLineCount
public int getTotalLineCount()
Get the total line (rows) count, based on the items that are visible and expanded.- Returns:
- the line count
-
getMaximumColumn
public int getMaximumColumn()
Get the length of the widest item to display.- Returns:
- the maximum number of columns for this item or its children
-
-