public class TreeListWidget extends TreeWidgetBase implements TreeList
BaseEntity.CharsPixels| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<TreeListConfig.Column> |
columns
List of columns.
|
private java.time.format.DateTimeFormatter |
dateTimeParser
Parser to parse strings passed from application for columns of DATETIME data type to
use for sorting dates.
|
protected boolean |
pendingPushColumns
Flag marking columns or column position changes are pending
|
private java.util.List<java.lang.Integer> |
selectedNodesIds
List of ids for the selected nodes.
|
private static integer |
WHITE
Convenience constant for white color value
|
buildingTree, LOGcomDataALIGN_COLON, ALIGN_LEFT, ALIGN_RIGHTgroupconfig, deleted, frame, internalScreenValueUsage, realizeOnAttributeAccessname, nextSibling, prevSibling, wainstProc, pm| Constructor and Description |
|---|
TreeListWidget()
Default constructor.
|
TreeListWidget(boolean dynamic)
Default constructor.
|
TreeListWidget(boolean dynamic,
TreeListConfig config)
Custom constructor to simplify subclassing.
|
| Modifier and Type | Method and Description |
|---|---|
protected TreeNodeResource |
_getSelectedNode()
Get selected node by node ID helper method.
|
private java.util.List<java.lang.Integer> |
_getSelectedNodesIds()
Get the ids of the selected nodes
|
(package private) void |
_setSelectedNode(int nodeId,
boolean trigger)
Convenient method for setting the selected node just by its id.
|
protected void |
addColumn(TreeListConfig.Column column)
Append a newly-created column to the end of
column list.
|
void |
afterConfigUpdate(TreeConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected boolean |
allowDuplicateKeys()
Test if this tree allows duplicate node key values.
|
void |
clearAll()
This methods calls super, then clear all columns.
|
private void |
columnUpdate(int index,
TreeListConfig.Column column)
Update a column at the given index.
|
private static <T extends java.lang.Comparable<T>> |
convertCompare(int index,
java.util.function.Function<java.lang.String,T> parser,
boolean descending,
T defaultValue)
Create a comparator suitable for comparing cell values in the sorting column with datatypes
other than STRING or ICON.
|
integer |
createCellImage(character path)
Creates an image that can be later used in
setCellIcon(NumberType, NumberType, NumberType) |
integer |
createColumn(character caption,
NumberType dataType,
NumberType width,
NumberType align,
NumberType bgColor,
NumberType fgColor)
Create a new column and append to the tree-list columns.
|
protected TreeListNodeResource |
createNode(java.lang.String key,
java.lang.String text,
TreeNodeResource parent)
Creates new node.
|
private static <T extends java.lang.Comparable<T>> |
directCompare(int index,
java.util.function.Function<java.lang.Object,T> parser,
boolean descending)
Create a comparator suitable for comparing cell values in the sorting column with datatypes
STRING and ICON.
|
void |
ensureNodeVisible(character nodeKey)
Assure the supplied node is visible in the tree viewport
|
private TreeListConfig.Column |
findColumn(int colIndex)
Finds column configuration entry from column index.
|
private TreeListConfig.Column |
findColumn(NumberType colIndex)
Finds column configuration entry from column index.
|
protected boolean |
firesNodeExpandOnLeaf()
Test if this tree triggers a node expand type event when expanding leaf nodes.
|
void |
fixColumnsLeft(NumberType colIndex)
Fixes the columns to the left starting at the provided column index.
|
integer |
getCellBgColor(NumberType nodeId,
NumberType colIndex)
Returns background color of the supplied cell.
|
integer |
getCellFgColor(NumberType nodeId,
NumberType colIndex)
Returns foreground color of the supplied cell.
|
void |
getCellString(NumberType nodeId,
NumberType colIndex,
character outValue)
Retrieve cell value as a string.
|
private <T> T |
getCellValue(NumberType nodeId,
NumberType colIndex,
java.util.function.Function<TreeNodeResource,java.util.List<T>> getValues)
Helper method to set indexed field values, like cell colors and values.
|
integer |
getColumnPosition(NumberType index)
Returns column position, based on the column index.
|
integer |
getColumnWidth(NumberType index)
Returns column width of a specified column.
|
character |
getDateSeparator()
Getter for the DATE-SEPARATOR attribute.
|
private java.time.format.DateTimeFormatter |
getDateTimeParser()
Get datetime parser to use when sorting columns of DATETIME type.
|
character |
getDecimalSeparator()
Getter for the DECIMAL-SEPARATOR attribute.
|
handle |
getFocusedAndSelectedNode()
Getter for the FOCUSED-AND-SELECTED-NODE attribute.
|
integer |
getNodeBgColor(NumberType nodeId)
Returns background color of the supplied node.
|
integer |
getNodeFgColor(NumberType nodeId)
Returns foreground color of the supplied node.
|
integer |
getSelectedNodeId()
Getter for the SELECTED-NODE-ID attribute.
|
character |
getSelectedNodeKey()
Getter for the SELECTED-NODE-KEY attribute.
|
character |
getShortDateFormat()
Getter for the SHORT-DATE-FORMAT attribute.
|
integer |
getSortedColumnCount()
Getter for the SORTED-COLUMN-COUNT attribute.
|
integer |
getSortedColumns()
Getter for the SORTED-COLUMNS attribute.
|
character |
getThousandSeparator()
Getter for the THOUSAND-SEPARATOR attribute.
|
integer |
getTriggerColumn()
Getter for TRIGGER-COLUMN attribute.
|
logical |
isAsteriskActive()
Getter for the ASTERISK-ACTIVE attribute.
|
logical |
isColumnVisible(NumberType index)
IS-COLUMN-VISIBLE method.
|
logical |
isEventsActive()
Getter for the EVENTS-ACTIVE attribute.
|
logical |
isMultiSelect(logical extended)
Getter for the IS-MULTI-SELECT attribute.
|
logical |
isShowHeader()
Getter for the SHOW-HEADER attribute.
|
void |
moveDownInParent()
This should move the currently selected node after its next sibling.
|
void |
moveUpInParent()
This should move the currently selected node before its previous sibling.
|
private java.util.Comparator<TreeNodeResource> |
nodeComparator()
Create a comparator capable to compare nodes based on current sorting column.
|
private double |
parseDecimal(java.lang.String s)
Parse a decimal number, honor the group and decimal separators.
|
private int |
parseInteger(java.lang.String s)
Parse an integer number, honor the group separator.
|
(package private) void |
removeNode(TreeNodeResource node,
boolean pushNodes)
Removes the node from the tree internal structures.
|
void |
resort()
Resorts the list according to current settings.
|
void |
setAsteriskActive(logical value)
Setter for the ASTERISK-ACTIVE attribute.
|
void |
setBuildingTree(logical value)
Setter for the BUILDING-TREE attribute.
|
void |
setCellBgColor(NumberType nodeId,
NumberType colIndex,
NumberType color)
Sets background color for the supplied cell.
|
void |
setCellFgColor(NumberType nodeId,
NumberType colIndex,
NumberType color)
Sets foreground color for the supplied cell.
|
void |
setCellIcon(NumberType nodeId,
NumberType colIndex,
NumberType imgId)
SET-CELL-ICON-VALUE method.
|
void |
setCellString(NumberType nodeId,
NumberType colIndex,
character value)
Sets string value to a specified cell.
|
private <T> void |
setCellValue(int nodeId,
int colIndex,
java.util.function.Function<TreeNodeResource,java.util.List<T>> getValues,
T newValue)
Helper method to set indexed field values, like cell colors and values.
|
void |
setColumnCaption(NumberType index,
character caption)
Sets column caption.
|
void |
setColumnVisible(NumberType colIndex,
logical visible)
SET-COLUMN-VISIBLE method.
|
void |
setColumnWidth(NumberType colIndex,
NumberType width)
Sets column width of a specified column.
|
void |
setDateSeparator(character value)
Setter for the DATE-SEPARATOR attribute.
|
void |
setDecimalSeparator(character value)
Setter for the DECIMAL-SEPARATOR attribute.
|
void |
setEventsActive(logical value)
Setter for the EVENTS-ACTIVE attribute.
|
void |
setMultiSelect(logical extended,
logical value)
SET-MULTI-SELECT options.
|
void |
setNodeBgColor(NumberType nodeId,
NumberType bgrValue)
Sets background color for the supplied node.
|
void |
setNodeFgColor(NumberType nodeId,
NumberType fgrValue)
Sets foreground color for the supplied node.
|
void |
setShortDateFormat(character value)
Setter for the SHORT-DATE-FORMAT attribute.
|
void |
setShowHeader(logical value)
Setter for the SHOW-HEADER attribute.
|
void |
setSortedColumns(NumberType colIndex)
Setter for the SORTED-COLUMNS attribute.
|
void |
setThousandSeparator(character value)
Setter for the THOUSAND-SEPARATOR attribute.
|
private void |
sortNodes(java.util.List<TreeNodeResource> nodes,
java.util.Comparator<TreeNodeResource> comparator)
Sort nodes recursively using the provided comparator.
|
void |
sortTreeList(int index,
boolean resetSorting)
Sorts a tree list widget by a column.
|
private void |
swapNodes(java.util.function.Function<TreeNodeResource,handle> getOtherNode)
If a node is selected in the tree, try to swap it with the given node.
|
private TreeListConfig |
treeListConfig()
Get widget config casted to the real type.
|
_getFocusedNode, _getFocusedNodeId, _setSelectedNode, addNode, assertKnown, clearNodesImageList, collapseAll, collapseAllExcept, collapseNode, createImage, createMergedImage, createSubNode, delete, deleteChildNodes, doWithNode, doWithNode, doWithNode, doWithNode, doWithNodeImpl, ensureNodeVisible, ensureNodeVisible, expandAll, expandNode, findNode, findNode, findNode, findNode, getDraggedNode, getDraggedOverNode, getDropHighlight, getDropHighlightNodeId, getFirstChildNode, getFirstNode, getFirstVisibleNode, getFocusedAndSelectedNodeKey, getFocusedNode, getFocusedNodeKey, getImageList, getIndentation, getLineStyle, getNewNodeLabel, getNextNode, getNextNodeId, getNextSiblingNode, getNodeAt, getNodeBold, getNodeHasChildren, getNodeHeight, getNodeLevel, getNodes, getNodeText, getNodeVisibleInViewPort, getParentNode, getPrevSiblingNode, getPrivateData, getRemoveNodeOnCollapse, getRootNode, getRowHeight, getScreenValue, getScreenValue, getScrollNodeCount, getScrollWheelLines, getSelectedNode, getSelectedNodeColors, getStyle, getTopVisibleNodeId, getTreeNodeByIndex, getTreeNodeIndex, getTriggerNode, getVisibleNodeCount, getVisibleRowCount, hitTest, hitTestFwd, isBuildingTree, isCheckBoxes, isDblClickExpanding, isDragDrop, isDragDropOtherTree, isExpandOnEnter, isExpandOnSingleClick, isNodeExpanded, isShowButtons, isTextEdit, nodeKeyToId, pushNodes, pushWidgetAttr, pushWidgetAttr, removeNode, requestNodeExpand, scrollNodeToTop, scrollVertical, selectSetFirstVisibleNode, setCheckBoxes, setDblClickExpanding, setDragDrop, setDragDropOtherTree, setDropHighlight, setExpandOnEnter, setExpandOnSingleClick, setImageList, setImageList, setIndentation, setLineStyle, setNewNodeLabel, setNodeBold, setNodeHasChildren, setNodeHeight, setNodeText, setPrivateData, setRemoveNodeOnCollapse, setRowHeight, setScrollWheelLines, setSelectedNode, setSelectedNodeColors, setSelectedNodeKey, setShowButtons, setStyle, setTextEdit, setTreeNodeIcons, startLabelEdit, updateNodegetAllowedEffects, getComData, getDataFormat, getEffect, getMouseButton, getMouseIcon, getMousePointerNum, getMouseShift, getMouseX, getMouseY, getOleDragMode, getOleDropMode, getOleX, getOleY, getState, isDefaultCursors, isEnabled, oleDrag, refreshUI, setAllowedEffects, setAllowedEffects, setComData, setDataFormat, setDataFormat, setDefaultCursors, setDefaultCursors, setEffect, setEffect, setEnabled, setEnabled, setMouseIcon, setMouseIcon, setMousePointerNum, setMousePointerNum, setOleDragMode, setOleDragMode, setOleDropMode, setOleDropMode, setOleX, setOleX, setOleY, setOleY, setState, setStatechangeFontWorker, firstChild, getColon, getDataClass, getDataType, getIndex, getNextTabItem, getPreviousTabItem, getPrevSibling, getSideLabelHandleWorker, getSizeAttrs, getTitle, hasSideLabelHandle, isAutoResize, isDropTarget, isModified, lastChild, processSideLabel, resetAutoResize, setAttrSpace, setAutoResize, setAutoResize, setColumnLabel, setColumnLabel, setDataType, setDataType, setDropTarget, setForceLabel, setForceLabel, setHeightCharsWorker, setHeightPixelsWorker, setIndex, setIndex, setModified, setModified, setNoAttrSpace, setNoLabels, setSideLabelHandleWorker, setTitle, setTitle, setTo, setTo, setWidthCharsWorker, setWidthPixelsWorker, validateFields_getHeightChars, _getHeightPixels, _getWidthChars, _getWidthPixels, canSetPixelPositionInChui, emit4084Warning, emitUnableToAssignUnknownAttributeWarning, getBgColor, getBgColorRgb, getColumn, getDColor, getFgColor, getFgColorRgb, getFont, getFontInfo, getFontName, getFontSize, getFrameColumn, getFrameRow, getFrameX, getFrameY, getHeightChars, getHeightPixels, getNextSibling, getParent, getParent, getPfColor, getRow, getTooltip, getValidParentTypes, getWidthChars, getWidthPixels, getX, getY, isFontBold, isFontItalic, isFontUnderline, isMovable, isResizable, isSelected, isTabStop, prepareSizeChars, prepareSizePixels, pushLocAttrs, pushSizeAttrs, setAlign, setBgColor, setBgColor, setBgColor, setBgColorRgb, setBgColorRgb, setColon, setColon, setColumn, setColumn, setColumnOrRow, setColumnOrRowWorker, setDColor, setDColor, setDColor, setFgColor, setFgColor, setFgColor, setFgColorRgb, setFgColorRgb, setFont, setFontBold, setFontItalic, setFontName, setFontSize, setFontUnderline, setGroup, setHeightChars, setHeightChars, setHeightImpl, setHeightPixels, setHeightPixels, setMaxHeightCharsWorker, setMaxHeightPixelsWorker, setMaxWidthCharsWorker, setMaxWidthPixelsWorker, setMinHeightCharsWorker, setMinHeightPixelsWorker, setMinWidthCharsWorker, setMinWidthPixelsWorker, setMovable, setMovable, setParent, setPfColor, setPfColor, setPfColor, setResizable, setResizable, setRow, setRow, setSelected, setSelected, setSizeChars, setSizePixels, setSystemParent, setTabStop, setTabStop, setTooltip, setTooltip, setVirtHeightCharsWorker, setVirtHeightPixelsWorker, setVirtWidthCharsWorker, setVirtWidthPixelsWorker, setWidthChars, setWidthChars, setWidthImpl, setWidthPixels, setWidthPixels, setX, setX, setXorY, setXOrYWorker, setY, setY, useHandleChainSiblings, validateParent, validateSize, validColumnOrRow_dynamic, _getDbName, _getFormat, _getTable, _isEntered, _isHidden, _isNotEntered, _isRealized, _isVisible, _name, _setDynamic, _setVisible, apply, apply, apply, apply, asWidgetHandle, canAccess, canDelete, canPushWidgetAttr, cleanup, colorDisplay, colorPrompt, config, deselectRows, detachMenu, disable, dynamic, editUndo, enable, finishConfigProcessing, finishSetup, flushWidgetAttrs, genAssignUnknownWarning, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getAttr, getColumnFont, getColumnLabel, getContextHelpId, getConvert3D, getCursorOffset, getDbName, getFormat, getFrame, getFrameHandle, getFrameName, getHeight, getHelp, getHWND, getId, getImage, getLabel, getLabelFont, getLabelStr, getLogicalTerminal, getMaxHeightChars, getMaxWidthChars, getMenuKey, getMenuMouse, getMousePointer, getMousePosition, getNumColumns, getNumSelectedRows, getParentHandle, getPopupMenu, getQuery, getRetainShape, getSideLabelHandle, getStretchToFit, getTable, getTabPosition, getTitleFont, getTransparent, getValidationExpression, getValidationMessage, getVirtHeight, getVirtHeightPixels, getVirtWidth, getVirtWidthPixels, getWidgetId, getWidth, getWindow, getZOrderClass, hasFormat, hasNameReadOnly, hasParent, hide, hide, implicitDeletion, inputValue, isAutoCompletion, isAutoReturn, isChained, isChecked, isDisableRedraw, isEntered, isExpandLabel, isFocusedRowSelected, isHidden, isKeepFrameZOrder, isManualHighlight, isMultiple, isNotEntered, isReadOnly, isScrollable, isSelectable, isSelected, isSelected, isSensitive, isTabWidget, isTextSelected, isThreeD, isValidatable, isVisible, labelSizeCheck, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadMousePointer, loadMousePointer, moveAfterTabItem, moveAfterTabItem, moveBeforeTabItem, moveBeforeTabItem, moveToBottom, moveToTop, moveToWorker, name, notQueryable, notQueryable, notSettable, notSettable, notWorker, openPopup, preRealizeCheck, pushScreenDefinition, readOnlyError, readOnlyError, realize, refresh, resourceDelete, restoreSharedState, saveSharedState, selectAll, selectFocusedRow, setAtFormatLength, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttr, setAttrs, setAutoCompletion, setAutoCompletion, setAutoReturn, setAutoReturn, setBlank, setChecked, setChecked, setColumnFont, setColumnFont, setContextHelpId, setContextHelpId, setConvert3D, setConvert3D, setCursorOffset, setCursorOffset, setDbname, setDeblank, setDisableAutoZap, setDisableRedraw, setFont, setFormat, setFormat, setFrame, setFrame, setFrame, setFrameHandle, setFrameHandle, setFrameHandle, setFromOCX, setHeader, setHeight, setHelp, setHelp, setHelpDefault, setHelpStatic, setHidden, setHidden, setId, setKeepFrameZOrder, setKeepFrameZOrder, setLabel, setLabel, setLabel, setLabelFont, setLabelFont, setLabelInt, setManualHighlight, setManualHighlight, setMaxHeightChars, setMaxWidthChars, setMenuKey, setMenuKey, setMenuMouse, setMenuMouse, setMultiple, setMultiple, setNextTabItem, setNoAutoValidate, setNumSelectedRows, setParentHandle, setParentHandle, setPopupMenu, setPopupMenu, setQuery, setReadOnly, setRetainShape, setRetainShape, setScreenLock, setScreenValue, setScreenValue, setScreenValue, setScreenValue, setScreenValueInt, setScreenValueNoErrorHandling, setScrollable, setScrollable, setSelectable, setSelectable, setSensitive, setSensitive, setSensitive, setSensitive, setSideLabelHandle, setStretchToFit, setStretchToFit, setTable, setThreeD, setThreeD, setTitleFont, setTitleFont, setTransparent, setTransparent, setValidation, setValidation, setVertical, setVirtHeight, setVirtHeightPixels, setVirtWidth, setVirtWidthPixels, setVisible, setVisible, setWidgetId, setWidgetId, setWidth, truncatePixelSize, type, underline, underline, valid, validate, validateFields, validateFields, validateFields, validateLabelAssignment, view, warningAlreadyRealized, widgetNamefirstResource, firstResource, getHead, getNextSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameConstraints, hasNextSibling, hasPrevSibling, hasPrivateData, interlink, lastResource, lastResource, moveInChain, name, name, resolveChainType, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, resourceType, setInstantiatingProcedure, toString, unableToAssignUnknown, unknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitid, id, unknown, validclearNodesImageList, collapseAll, collapseAllExcept, collapseNode, createImage, createMergedImage, createSubNode, createSubNode, deleteChildNodes, expandAll, expandNode, findNode, findNode, getDraggedNode, getDraggedOverNode, getDropHighlight, getFirstChildNode, getFirstNode, getFirstVisibleNode, getFocusedAndSelectedNodeKey, getFocusedNode, getFocusedNodeKey, getHWND, getImageList, getIndentation, getLineStyle, getMousePointerNum, getNewNodeLabel, getNextNode, getNextSiblingNode, getNodeAt, getNodeBold, getNodeHasChildren, getNodeHeight, getNodeLevel, getNodeText, getNodeVisibleInViewPort, getParentNode, getPrevSiblingNode, getPrivateData, getRemoveNodeOnCollapse, getRowHeight, getScrollNodeCount, getScrollWheelLines, getSelectedNode, getSelectedNodeColors, getStyle, getTopVisibleNodeId, getTriggerNode, getVisibleNodeCount, getVisibleRowCount, hitTest, hitTestFwd, isBuildingTree, isCheckBoxes, isDblClickExpanding, isDragDrop, isDragDropOtherTree, isExpandOnEnter, isExpandOnSingleClick, isNodeExpanded, isShowButtons, isTextEdit, nodeKeyToId, scrollNodeToTop, scrollVertical, selectSetFirstVisibleNode, setCheckBoxes, setDblClickExpanding, setDragDrop, setDragDropOtherTree, setDropHighlight, setExpandOnEnter, setExpandOnSingleClick, setImageList, setImageList, setIndentation, setLineStyle, setMousePointerNum, setNewNodeLabel, setNodeBold, setNodeHasChildren, setNodeHeight, setNodeText, setPrivateData, setRemoveNodeOnCollapse, setRowHeight, setScrollWheelLines, setSelectedNode, setSelectedNodeColors, setSelectedNodeKey, setShowButtons, setStyle, setTextEdit, setTreeNodeIcons, startLabelEditremoveNodegetFontInfo, getFontName, getFontSize, isFontBold, isFontItalic, isFontUnderline, setFontBold, setFontItalic, setFontName, setFontSize, setFontUnderlinegetAllowedEffects, getDataFormat, getEffect, getOleDragMode, getOleDropMode, getOleX, getOleY, getState, isDefaultCursors, oleDrag, setAllowedEffects, setDataFormat, setDefaultCursors, setEffect, setOleDragMode, setOleDropMode, setOleX, setOleY, setStateisVisible, setVisible, setVisibleendFileDrop, getDroppedFile, getDroppedFile, getNumDroppedFiles, setDropTargetgetIdEx, getListItems, isEditCanUndo, setListItems, setListItems, setScreenValuegetPrivateData, setPrivateData, setPrivateDataresourceTypesetDisableRedrawsetReadOnlyallowDeleteprotected final java.util.List<TreeListConfig.Column> columns
WHen BUILDING-TREE mode of off, this list contains same entries as config.columns
protected boolean pendingPushColumns
private java.util.List<java.lang.Integer> selectedNodesIds
private static final integer WHITE
private java.time.format.DateTimeFormatter dateTimeParser
TreeListConfig.shortDateFormat.
If no value was parsed from the application before this field is user, the default 4gl date format
"99/99/99" is used, with the component order used in date.getDateComponentOrder().public TreeListWidget()
public TreeListWidget(boolean dynamic)
dynamic - Flag indicating if this is a static or dynamic resource.public TreeListWidget(boolean dynamic,
TreeListConfig config)
dynamic - Flag indicating if this is a static or dynamic resource.config - The config to use to create widget.public void afterConfigUpdate(TreeConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwner<TreeConfig>afterConfigUpdate in class TreeWidgetBasebeforeUpdate - Config reference capturing the config state before
the owner's config was modified.public void clearAll()
clearAll in interface TreeFaceclearAll in class TreeWidgetBasepublic integer createCellImage(character path)
setCellIcon(NumberType, NumberType, NumberType)createCellImage in interface TreeListpath - The image file path. Can be an absolute name or relative. When relative the Propath entries
will be searched.public integer createColumn(character caption, NumberType dataType, NumberType width, NumberType align, NumberType bgColor, NumberType fgColor)
createColumn in interface TreeListcaption - Column caption.dataType - Data type, where:
0... character,
1... decimal,
2... date/datetime (TODO),
3... integer,
4... icon (TODO)width - Pixel width of the column.align - Horizontal value alignment, where:
0... TODO,
1... right,
2... middle,
3... leftbgColor - Background color. The value is binary compatible with the result of RGB-VALUE
function.fgColor - Foreground color. The value is binary compatible with the result of RGB-VALUE
function.
TODO: is this parameter really foreground color?public void ensureNodeVisible(character nodeKey)
ensureNodeVisible in interface TreeFacenodeKey - the node to make visiblepublic void fixColumnsLeft(NumberType colIndex)
fixColumnsLeft in interface TreeListcolIndex - Column index. Set negative value or unknown to unfix all columns.public integer getCellBgColor(NumberType nodeId, NumberType colIndex)
getCellBgColor in interface TreeListnodeId - A valid node id.colIndex - Column index.public integer getCellFgColor(NumberType nodeId, NumberType colIndex)
getCellFgColor in interface TreeListnodeId - A valid node id.colIndex - Column index.public void getCellString(NumberType nodeId, NumberType colIndex, character outValue)
getCellString in interface TreeListnodeId - Node id.colIndex - 0-based column indexoutValue - If the method succeeds, it will assign the cell string value.public integer getColumnPosition(NumberType index)
getColumnPosition in interface TreeListindex - Column index.public integer getColumnWidth(NumberType index)
getColumnWidth in interface TreeListindex - Column index.public character getDateSeparator()
getDateSeparator in interface TreeListpublic character getDecimalSeparator()
getDecimalSeparator in interface TreeListpublic integer getNodeBgColor(NumberType nodeId)
getNodeBgColor in interface TreeFacenodeId - a valid node idpublic integer getNodeFgColor(NumberType nodeId)
getNodeFgColor in interface TreeFacegetNodeFgColor in class TreeWidgetBasenodeId - a valid node idpublic character getShortDateFormat()
getShortDateFormat in interface TreeListpublic integer getSortedColumnCount()
getSortedColumnCount in interface TreeListpublic integer getSortedColumns()
getSortedColumns in interface TreeListpublic character getThousandSeparator()
getThousandSeparator in interface TreeListpublic integer getTriggerColumn()
getTriggerColumn in interface TreeListpublic logical isAsteriskActive()
isAsteriskActive in interface TreeListpublic logical isColumnVisible(NumberType index)
isColumnVisible in interface TreeListindex - 0-based column indexpublic logical isEventsActive()
isEventsActive in interface TreeListpublic logical isShowHeader()
isShowHeader in interface TreeListpublic void moveDownInParent()
moveDownInParent in interface TreeListpublic void moveUpInParent()
moveUpInParent in interface TreeListpublic void resort()
public void setAsteriskActive(logical value)
setAsteriskActive in interface TreeListvalue - the attribute valuepublic void setBuildingTree(logical value)
true
any model changes (columns added, nodes added or removed) won't
be reflected until the attribute is set back to false.setBuildingTree in interface TreeFacesetBuildingTree in class TreeWidgetBasevalue - the attribute valuepublic void setCellBgColor(NumberType nodeId, NumberType colIndex, NumberType color)
setCellBgColor in interface TreeListnodeId - A valid node id.colIndex - Column index.color - The new color.private java.util.List<java.lang.Integer> _getSelectedNodesIds()
public handle getFocusedAndSelectedNode()
TreeNodeResource.
Note that the runtime behavior is the same as for the SELECTED-NODE attribute.getFocusedAndSelectedNode in interface TreeFacegetFocusedAndSelectedNode in class TreeWidgetBasepublic integer getSelectedNodeId()
getSelectedNodeId in interface TreeFacegetSelectedNodeId in class TreeWidgetBaseprotected TreeNodeResource _getSelectedNode()
public character getSelectedNodeKey()
getSelectedNodeKey in interface TreeFacegetSelectedNodeKey in class TreeWidgetBasevoid removeNode(TreeNodeResource node, boolean pushNodes)
removeNode in class TreeWidgetBasenode - The node being removed.pushNodes - When set to true the model change will be pushed to the client.void _setSelectedNode(int nodeId,
boolean trigger)
_setSelectedNode in class TreeWidgetBasenodeId - The id of the tree node which should be selected.trigger - Flag to indicate if the VALUE-CHANGED trigger should be fired.public void setCellFgColor(NumberType nodeId, NumberType colIndex, NumberType color)
setCellFgColor in interface TreeListnodeId - A valid node id.colIndex - Column index.color - The color value.public void setCellIcon(NumberType nodeId, NumberType colIndex, NumberType imgId)
setCellIcon in interface TreeListnodeId - Node id.colIndex - 0-based column indeximgId - Id of the image to assign. The image must be first created with
TreeFace.createImage(character).public void setCellString(NumberType nodeId, NumberType colIndex, character value)
setCellString in interface TreeListnodeId - Node id.colIndex - 0-based column indexvalue - New string value.public void setColumnCaption(NumberType index, character caption)
setColumnCaption in interface TreeListindex - Column index.caption - The new caption.public void setColumnVisible(NumberType colIndex, logical visible)
setColumnVisible in interface TreeListcolIndex - 0-based column indexvisible - New visibility state.public void setColumnWidth(NumberType colIndex, NumberType width)
setColumnWidth in interface TreeListcolIndex - Column index.width - The new width.public void setDateSeparator(character value)
setDateSeparator in interface TreeListvalue - the attribute valuepublic void setDecimalSeparator(character value)
setDecimalSeparator in interface TreeListvalue - the attribute valuepublic void setEventsActive(logical value)
setEventsActive in interface TreeListvalue - the attribute valuepublic void setNodeBgColor(NumberType nodeId, NumberType bgrValue)
setNodeBgColor in interface TreeFacenodeId - a valid node idbgrValue - the new colorpublic void setNodeFgColor(NumberType nodeId, NumberType fgrValue)
setNodeFgColor in interface TreeFacenodeId - a valid node idfgrValue - the new colorpublic void setShortDateFormat(character value)
setShortDateFormat in interface TreeListvalue - the attribute valuepublic void setShowHeader(logical value)
true columns header
will be shown at the top of the list.setShowHeader in interface TreeListvalue - the attribute valuepublic void setSortedColumns(NumberType colIndex)
setSortedColumns in interface TreeListcolIndex - The index of the column to sort ascending by or a negative value to disable sorting.public void setThousandSeparator(character value)
setThousandSeparator in interface TreeListvalue - the attribute valuepublic void sortTreeList(int index,
boolean resetSorting)
index - the index of the column being sortedresetSorting - if true, then reset column sortingpublic void setMultiSelect(logical extended, logical value)
setMultiSelect in interface TreeFacesetMultiSelect in class TreeWidgetBaseextended - extended selection, if false only sibling nodes can be multi-selected,
otherwise any nodes can be selected.value - the new multiSelect valuepublic logical isMultiSelect(logical extended)
isMultiSelect in interface TreeFaceisMultiSelect in class TreeWidgetBaseextended - extended selection mode.protected final void addColumn(TreeListConfig.Column column)
column - the column to appendprotected boolean allowDuplicateKeys()
allowDuplicateKeys in class TreeWidgetBaseprotected TreeListNodeResource createNode(java.lang.String key, java.lang.String text, TreeNodeResource parent)
createNode in class TreeWidgetBasekey - Node key.text - Node text.parent - Node parent.protected boolean firesNodeExpandOnLeaf()
firesNodeExpandOnLeaf in class TreeWidgetBaseprivate void columnUpdate(int index,
TreeListConfig.Column column)
index - valid column indexcolumn - the new columnprivate TreeListConfig.Column findColumn(int colIndex)
colIndex - A valid column index.null if the index doesn't refer to a valid column.private TreeListConfig.Column findColumn(NumberType colIndex)
colIndex - A valid column index.null if the index doesn't refer to a valid column.private final <T> T getCellValue(NumberType nodeId, NumberType colIndex, java.util.function.Function<TreeNodeResource,java.util.List<T>> getValues)
T - the value typenodeId - the node IDcolIndex - the cell indexgetValues - the procedure to retrieve the value array from the nodeprivate final <T> void setCellValue(int nodeId,
int colIndex,
java.util.function.Function<TreeNodeResource,java.util.List<T>> getValues,
T newValue)
nodeId - the node IDcolIndex - the cell indexgetValues - the procedure to retrieve the value array from the nodenewValue - the new valueprivate final void swapNodes(java.util.function.Function<TreeNodeResource,handle> getOtherNode)
null, then do nothing.getOtherNode - the function to obtain the other node, may return null.
the function must guarantee its return value always differs from the
selected node.private final TreeListConfig treeListConfig()
private void sortNodes(java.util.List<TreeNodeResource> nodes, java.util.Comparator<TreeNodeResource> comparator)
nodes - the nodes to sort.comparator - the comparator to use when sortingprivate final java.util.Comparator<TreeNodeResource> nodeComparator()
null if no sorting column is set in the tree.private static <T extends java.lang.Comparable<T>> java.util.Comparator<TreeNodeResource> convertCompare(int index, java.util.function.Function<java.lang.String,T> parser, boolean descending, T defaultValue)
For such columns, the cell values should be compared according to their types. So, the value string representations shall first be parsed into the corresponding types before the values can be compared.
The parsed values are cached in the TreeListNodeEntry.cellSortingValues.
T - the type of values to compare.index - the column indexparser - the parsing function to try to parse stringdescending - true if sorting order should be reverseddefaultValue - the value to use if parse was not successfulprivate static <T extends java.lang.Comparable<T>> java.util.Comparator<TreeNodeResource> directCompare(int index, java.util.function.Function<java.lang.Object,T> parser, boolean descending)
TreeListNodeEntry.cellValues can be directly compared.T - the type of values to compare.index - the column indexparser - the parsing function to try to parse stringdescending - true if sorting order should be reversedprivate final java.time.format.DateTimeFormatter getDateTimeParser()
private double parseDecimal(java.lang.String s)
throws ErrorConditionException
s - the string to parseErrorConditionException - if the value cannot parseprivate int parseInteger(java.lang.String s)
throws ErrorConditionException
The values of the group separator are taken from the tree list config or, if missing, from the 4gl session configuration.
s - the string to parseErrorConditionException - if the value cannot be parsed