public class TTreeItem extends TWidget
Modifier and Type | Field and Description |
---|---|
protected int |
level
Tree level.
|
Constructor and Description |
---|
TTreeItem(TTreeView view,
java.lang.String text,
boolean expanded)
Public constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
draw()
Draw this item to a window.
|
java.util.List<TTreeItem> |
expandTree(java.lang.String prefix,
boolean last)
Recursively expand the tree into a linear array of items.
|
int |
getMaximumColumn()
Get the length of the widest item to display.
|
java.lang.String |
getPrefix()
Get the vertical bars and such along the left side.
|
java.lang.String |
getText()
Get the displayable text for this item.
|
TTreeView |
getTreeView()
Get the parent TTreeView.
|
boolean |
isExpandable()
Get expandable value.
|
boolean |
isExpanded()
Get expanded value.
|
boolean |
isSelected()
Get selected value.
|
void |
onExpand()
Called when this item is expanded or collapsed.
|
void |
onKeypress(TKeypressEvent keypress)
Handle keystrokes.
|
void |
onMouseUp(TMouseEvent mouse)
Handle mouse release events.
|
void |
setExpandable(boolean expandable)
Set expandable value.
|
void |
setExpanded(boolean expanded)
Set expanded value.
|
void |
setSelectable(boolean selectable)
Set selectable value.
|
void |
setSelected(boolean selected)
Set selected value.
|
void |
setText(java.lang.String text)
Set the displayable text for this item.
|
void |
unselect()
Recursively unselect me and my children.
|
activate, activate, activate, activateAll, addButton, addCalendar, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, close, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getApplication, getAttrXY, getChildren, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getHeight, getLayoutManager, getParent, getScreen, getTheme, getWidth, getWindow, getX, getY, handleEvent, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEnabled, isVisible, messageBox, messageBox, mouseWouldHit, onCommand, onIdle, onMenu, onMouseDoubleClick, onMouseDown, onMouseMotion, onResize, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setDimensions, setEnabled, setHeight, setLayoutManager, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, toString, vLineXY
public TTreeItem(TTreeView view, java.lang.String text, boolean expanded)
view
- root TTreeViewtext
- text for this itemexpanded
- if true, have it expanded immediatelypublic void onMouseUp(TMouseEvent mouse)
public void onExpand()
public void onKeypress(TKeypressEvent keypress)
onKeypress
in class TWidget
keypress
- keystroke eventpublic final TTreeView getTreeView()
public final java.lang.String getText()
public final void setText(java.lang.String text)
text
- the displayable text for this itempublic final boolean isExpanded()
public final void setExpanded(boolean expanded)
expanded
- new valuepublic final boolean isExpandable()
public final void setExpandable(boolean expandable)
expandable
- new valuepublic final java.lang.String getPrefix()
public final boolean isSelected()
public final void setSelected(boolean selected)
selected
- new valuepublic final void setSelectable(boolean selectable)
selectable
- new valuepublic int getMaximumColumn()
public java.util.List<TTreeItem> expandTree(java.lang.String prefix, boolean last)
prefix
- vertical bar of parent levels and such that is set on
each childlast
- if true, this is the "last" leaf node of a treepublic void unselect()
Copyright © 2019 Kevin Lamonte. Licensed MIT.