public abstract class TreeWidgetBase extends ControlEntityExt<TreeConfig> implements TreeFace
BaseEntity.CharsPixels
Modifier and Type | Field and Description |
---|---|
protected int |
buildingTree
The backed field for BUILDING-TREE attribute.
|
protected static java.util.logging.Logger |
LOG
Logger
|
private int |
nextId
Last used node id.
|
private handle |
nodeImageListHandle
Assigned imagelist for node images.
|
private java.util.HashMap<java.lang.Integer,TreeNodeResource> |
nodesById
Map of nodes by ids.
|
private java.util.LinkedList<TreeNodeResource> |
nodesByIndices
The list of all tree nodes.
|
private java.util.HashMap<java.lang.String,TreeNodeResource> |
nodesByKey
Map of nodes by keys.
|
private java.util.List<java.lang.String> |
pendingAttrs
Widget attributes pending to be sent to the client
|
private java.util.List<java.lang.Object> |
pendingAttrValues
Widget attribute values pending to be sent to the client
|
private boolean |
pendingPushNodes
Flag marking pushNodes call pending
|
private TreeNodeResource |
rootNode
The root node.
|
comData
ALIGN_COLON, ALIGN_LEFT, ALIGN_RIGHT
group
config, deleted, frame, internalScreenValueUsage, realizeOnAttributeAccess
name, nextSibling, prevSibling
instProc
Constructor and Description |
---|
TreeWidgetBase(boolean dynamic,
TreeConfig ctrl)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected TreeNodeResource |
_getSelectedNode()
Get selected node by node ID helper method.
|
private int |
_getSelecteNodeId()
Get selected node ID helper method.
|
private int |
_getTopVisibleNodeId()
Returns the ID of the top visible node or -1 if this tree is empty.
|
(package private) void |
_setSelectedNode(int nodeId)
Convenient method for setting the selected node just by its id.
|
(package private) void |
_setSelectedNode(int nodeId,
boolean trigger)
Convenient method for setting the selected node just by its id.
|
protected void |
addNode(TreeNodeResource node,
boolean pushNodes)
Adds new node to the tree internal structures.
|
void |
afterConfigUpdate(TreeConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
protected abstract boolean |
allowDuplicateKeys()
Test if this tree allows duplicate node key values.
|
protected static boolean |
assertKnown(BaseDataType... values)
Returns
false if any of the supplied values is null or unknown , true
otherwise. |
void |
clearAll()
Unconditionally removes all the nodes from the tree.
|
void |
clearNodesImageList()
Clears all images used as node images.
|
void |
collapseAll()
Collapses all the nodes.
|
void |
collapseAllExcept(handle node)
Collapses all the nodes, except the one specified.
|
void |
collapseNode(NumberType nodeId)
Collapses a node.
|
integer |
createImage(character path)
Creates an image that can be later used in
setTreeNodeIcons(NumberType, NumberType, NumberType) and
TreeFace.createSubNode(NumberType, character, character, logical, NumberType, NumberType, integer) . |
integer |
createMergedImage(integer imgIndex,
character imgFile)
Implements legacy method CREATE-MERGED-IMAGE.
|
protected abstract TreeNodeResource |
createNode(java.lang.String key,
java.lang.String text,
TreeNodeResource parent)
Creates new node.
|
void |
createSubNode(NumberType parentNodeId,
character nodeText,
character nodeKey,
logical hasChildren,
NumberType collapseIcon,
NumberType expandIcon,
character tooltip,
integer newNodeId)
Creates a new node for the supplied parent node.
|
void |
delete()
Perform actual delete of an resource.
|
void |
deleteChildNodes(NumberType nodeId)
Recursively delete all node children.
|
protected void |
doWithNode(character nodeKey,
BaseDataType[] mandatoryArgs,
java.util.function.Consumer<TreeNodeResource> body)
Validates the supplied array of mandatory arguments and node key, finds the node nodeKey and executes
the supplied consumer with the found node.
|
protected <T extends BaseDataType> |
doWithNode(character nodeKey,
BaseDataType[] mandatoryArgs,
T failResult,
java.util.function.Function<TreeNodeResource,T> body)
Validates the supplied array of mandatory arguments and node key, finds the node nodeKey and executes
the supplied function with the found node.
|
protected void |
doWithNode(NumberType nodeId,
BaseDataType[] mandatoryArgs,
java.util.function.Consumer<TreeNodeResource> body)
Validates the supplied array of mandatory arguments and node id, finds the node nodeId and executes
the supplied consumer with the found node.
|
protected <T extends BaseDataType> |
doWithNode(NumberType nodeId,
BaseDataType[] mandatoryArgs,
T failResult,
java.util.function.Function<TreeNodeResource,T> body)
Validates the supplied array of mandatory arguments and node id, finds the node nodeId and executes
the supplied function with the found node.
|
protected static <T extends BaseDataType> |
doWithNodeImpl(BaseDataType nodeId,
BaseDataType[] mandatoryArgs,
T failResult,
java.util.function.Function<TreeNodeResource,T> body,
java.util.function.Function<BaseDataType,TreeNodeResource> findNode)
Validates the supplied array of mandatory arguments and node id, finds the node nodeId and executes
the supplied function with the found node.
|
protected void |
ensureNodeVisible(character nodeKey,
boolean trigger)
Assure the supplied node is visible in the tree viewport
|
protected void |
ensureNodeVisible(TreeNodeResource node,
boolean select,
boolean trigger)
Assure the supplied node is visible in the tree viewport, and
optionally select the node.
|
void |
expandAll()
Expands all the nodes.
|
void |
expandNode(NumberType nodeId)
Expands a node.
|
handle |
findNode(character nodeKey)
Finds a node in the tree.
|
(package private) TreeNodeResource |
findNode(int nodeId)
Finds a node based on a node id.
|
handle |
findNode(NumberType nodeId)
Finds a node in the tree.
|
(package private) TreeNodeResource |
findNode(java.lang.String key)
Finds a node based on a node key.
|
handle |
getDraggedNode()
Getter for DRAGGED-NODE attribute.
|
handle |
getDraggedOverNode()
Getter for DRAGGED-OVER-NODE attribute.
|
handle |
getDropHighlight()
Returns a reference to a node object that is highlighted with the system highlight color
when the cursor moves over it.
|
int |
getDropHighlightNodeId()
Returns the drophighlight node id.
|
void |
getFirstChildNode(NumberType nodeId,
integer outChildId,
character outChildKey)
Returns the first child node of the specified parent node.
|
integer |
getFirstNode()
Getter for the FIRST-NODE attribute.
|
handle |
getFirstVisibleNode()
Getter for the FIRST-VISIBLE-NODE attribute.
|
handle |
getFocusedAndSelectedNode()
Getter for the FOCUSED-AND-SELECTED-NODE attribute.
|
character |
getFocusedAndSelectedNodeKey()
Getter for the FOCUSED-AND-SELECTED-NODE-KEY attribute.
|
handle |
getFocusedNode()
Getter for the FOCUSED-NODE attribute.
|
character |
getFocusedNodeKey()
Getter for the FOCUSED-NODE-KEY attribute.
|
handle |
getImageList()
Returns the assigned imagelist or unknown.
|
integer |
getIndentation()
Getter for the INDENTATION attribute.
|
integer |
getLineStyle()
Gets the LINE-STYLE attribute value.
|
character |
getNewNodeLabel()
Returns the new label for the trigger node.
|
integer |
getNextNode(NumberType nodeId)
Returns the next visible node from the specified node.
|
protected int |
getNextNodeId()
Allocates and returns next node id.
|
void |
getNextSiblingNode(NumberType nodeId,
integer outSiblingId,
character outSiblingKey)
Returns the next sibling node of the specified node.
|
character |
getNodeAt(NumberType x,
NumberType y)
Returns key of the node at the specified location relative to the tree's top-left corner.
|
boolean |
getNodeBold(character nodeKey)
Getter for the NODE-BOLD attribute.
|
private TreeNodeResource |
getNodeByCoordinates(int x,
int y)
Gets a node by the given pixel coordinates relative to the owner window.
|
integer |
getNodeFgColor(NumberType nodeId)
Returns foreground color of the supplied node.
|
logical |
getNodeHasChildren(NumberType nodeId)
Returns true if the node represented by the supplied node id is allowed to have child nodes.
|
integer |
getNodeHeight()
Getter for the NODE-HEIGHT attribute.
|
private static int |
getNodeIdFrom(handle value)
Retrieves the node id from the provided tree node handle.
|
integer |
getNodeLevel(character nodeKey)
Returns tree level of the specified node.
|
handle |
getNodes()
Returns the collection of all the root nodes, a wrapped resource of the type
TreeNodeCollection . |
character |
getNodeText(character nodeKey)
Implements legacy method GET-NODE-TEXT.
|
logical |
getNodeVisibleInViewPort(character nodeKey)
The method returns
true if the specified node is visible in the current view port. |
void |
getParentNode(NumberType nodeId,
integer outParentId,
character outParentKey)
Returns the parent node of the specified node.
|
void |
getPrevSiblingNode(NumberType nodeId,
integer outSiblingId,
character outSiblingKey)
Returns the previous sibling node of the specified node.
|
java.lang.String |
getPrivateData(character nodeKey)
Getter for the PRIVATE-DATA attribute.
|
logical |
getRemoveNodeOnCollapse()
Getter for the REMOVE-NODE-ON-COLLAPSE attribute.
|
protected TreeNodeResource |
getRootNode()
Get the tree root node.
|
integer |
getRowHeight()
Returns row height for tree based widget.
|
character |
getScreenValue()
Obtain the current value in the screen buffer of the backing data for
this widget and return it as a
character type. |
(package private) character |
getScreenValue(boolean initialized,
BaseDataType bdt,
java.lang.String fmt,
boolean ignoreFormat)
Internal worker for getting the SCREEN-VALUE on a per-widget basis.
|
integer |
getScrollNodeCount()
Getter for SCROLL-NODE-COUNT attribute.
|
integer |
getScrollWheelLines()
Getter for the SCROLL-WHEEL-LINES attribute.
|
handle |
getSelectedNode()
Getter for the SELECTED-NODE attribute.
|
void |
getSelectedNodeColors(integer outBg,
integer outFg)
Returns background and foreground colors for selected nodes.
|
integer |
getSelectedNodeId()
Getter for the SELECTED-NODE-ID attribute.
|
character |
getSelectedNodeKey()
Getter for the SELECTED-NODE-KEY attribute.
|
integer |
getStyle()
Gets the STYLE attribute value.
|
integer |
getTopVisibleNodeId()
Returns node id of the top visible node.
|
(package private) TreeNodeResource |
getTreeNodeByIndex(int index)
Gets a node based on its index within all nodes list.
|
(package private) int |
getTreeNodeIndex(TreeNodeResource node)
Finds an index of the target node.
|
handle |
getTriggerNode()
The attribute holds the node that is the target of the current trigger.
|
integer |
getVisibleNodeCount()
Getter for the VISIBLE-NODE-COUNT attribute.
|
comhandle |
hitTest(NumberType x,
NumberType y)
Get the TreeView node under mouse cursor as a COM object.
|
handle |
hitTestFwd(NumberType x,
NumberType y)
Get the TreeView node under mouse cursor as a node handle.
|
logical |
isBuildingTree()
Getter for the BUILDING-TREE attribute.
|
logical |
isCheckBoxes()
Returns
true if a check box is displayed next to each tree node
in the tree view; otherwise, false . |
logical |
isDblClickExpanding()
Getter for the DBL-CLICK-EXPANDING attribute.
|
logical |
isDragDrop()
Getter for the DRAG-DROP attribute.
|
logical |
isDragDropOtherTree()
Getter for the ALLOW-DRAG-DROP-OTHER-TREE attribute.
|
logical |
isExpandOnEnter()
Getter for the EXPAND-ON-ENTER attribute.
|
logical |
isExpandOnSingleClick()
Getter for the EXPAND-ON-SINGLE-CLICK attribute.
|
logical |
isMultiSelect(logical extended)
IS-MULTI-SELECT method.
|
logical |
isNodeExpanded(NumberType nodeId)
Returns
true when the node of the supplied id is expanded. |
logical |
isShowButtons()
Getter for the SHOW-BUTTONS attribute.
|
logical |
isTextEdit()
Getter for the TEXT-EDIT attribute.
|
integer |
nodeKeyToId(character nodeKey)
Implement legacy method NODE-KEY-TO-ID.
|
protected void |
pushNodes()
Pushes the tree node model to the client.
|
void |
pushWidgetAttr(java.lang.String[] fnames,
java.lang.Object[] values)
Push the specified widget attribute changes to the client-side.
|
void |
pushWidgetAttr(java.lang.String fname,
java.lang.Object value)
Push the specified widget attribute change to the client-side.
|
void |
removeNode(NumberType nodeId)
Removes an existing node from the tree.
|
(package private) void |
removeNode(TreeNodeResource node,
boolean pushNodes)
Removes the node from the tree internal structures.
|
protected void |
requestNodeExpand(int nodeId,
boolean expand)
This method is called by a client to notify server that a node expansion status was changed.
|
void |
scrollNodeToTop(character nodeKey)
Makes the supplied node the first visible (at the top of the view if possible) node.
|
void |
scrollVertical(NumberType lines)
Scrolls the tree view the specified number of lines.
|
void |
selectSetFirstVisibleNode(NumberType nodeId)
Makes the supplied node the first visible node (at the top of the view if possible).
|
private void |
setAllNodesExpanded(boolean expanded,
TreeNodeResource exceptNode)
Expands or collapses all nodes.
|
void |
setBuildingTree(logical value)
Setter for the BUILDING-TREE attribute.
|
void |
setCheckBoxes(logical value)
Set to
true to display a check box next to each tree node
in the tree view; otherwise, false . |
void |
setDblClickExpanding(logical value)
Setter for the DBL-CLICK-EXPANDING attribute.
|
void |
setDragDrop(logical value)
Setter for the DRAG-DROP attribute.
|
void |
setDragDropOtherTree(logical value)
Setter for the ALLOW-DRAG-DROP-OTHER-TREE attribute.
|
void |
setDropHighlight(handle node)
Sets a reference to a node object that is highlighted with the system highlight color when
the cursor moves over it.
|
void |
setExpandOnEnter(logical value)
Setter for the EXPAND-ON-ENTER attribute.
|
void |
setExpandOnSingleClick(logical value)
Setter for the EXPAND-ON-SINGLE-CLICK attribute.
|
void |
setImageList(handle imgList)
Assigns an imagelist resource to the tree.
|
void |
setImageList(ImageList imgList)
Assigns an imagelist resource to the tree.
|
void |
setIndentation(NumberType value)
Setter for the INDENTATION attribute.
|
void |
setLineStyle(integer value)
Sets the LINE-STYLE attribute value.
|
void |
setMultiSelect(logical extended,
logical value)
SET-MULTI-SELECT method.
|
void |
setNewNodeLabel(character newLabel)
Sets the new label for the trigger node.
|
void |
setNodeBold(character nodeKey,
logical value)
Setter for the NODE-BOLD attribute.
|
void |
setNodeHasChildren(NumberType nodeId,
logical value)
Set the child node allowance on the node represented by the supplied node.
|
void |
setNodeHeight(NumberType value)
Setter for the NODE-HEIGHT attribute.
|
void |
setNodeText(character nodeKey,
character text)
Implements legacy method SET-NODE-TEXT.
|
void |
setPrivateData(character nodeKey,
character value)
Setter for the PRIVATE-DATA attribute.
|
void |
setRemoveNodeOnCollapse(logical value)
Setter for the REMOVE-NODE-ON-COLLAPSE attribute.
|
void |
setRowHeight(NumberType heightValue)
Sets row height for tree based widget.
|
void |
setScrollWheelLines(NumberType value)
Setter for the SCROLL-WHEEL-LINES attribute.
|
void |
setSelectedNode(handle value)
Setter for the SELECTED-NODE attribute.
|
void |
setSelectedNodeColors(NumberType bg,
NumberType fg)
Sets background and foreground colors for selected nodes.
|
void |
setSelectedNodeKey(character nodeKey)
Setter for the SELECTED-NODE attribute.
|
void |
setShowButtons(logical value)
Setter for the SHOW-BUTTONS attribute.
|
void |
setStyle(integer value)
Sets the STYLE attribute value.
|
void |
setTextEdit(logical value)
Setter for the TEXT-EDIT attribute.
|
void |
setTreeNodeIcons(NumberType nodeId,
NumberType icon,
NumberType expandIcon)
Sets leaf/collapse and expand icons for the specified node.
|
void |
startLabelEdit()
Begins a label editing operation for the current node.
|
(package private) void |
updateNode(TreeNodeResource node,
java.lang.String oldKeyValue,
boolean pushNodes)
Updates the tree internal structures for the given node.
|
getAllowedEffects, 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, setState
changeFontWorker, 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, _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, isScrollable, isSelectable, isSelected, isSelected, isSensitive, isTabWidget, isTextSelected, isThreeD, isValidatable, isVisible, labelSizeCheck, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadImage, loadMousePointer, loadMousePointer, moveAfterTab, moveAfterTab, 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, 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, setReadOnly, setRetainShape, setRetainShape, setScreenLock, 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, underline, underline, valid, validate, validateFields, validateFields, validateFields, validateLabelAssignment, view, warningAlreadyRealized, widgetName
firstResource, firstResource, getHead, getNextSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameConstraints, hasNextSibling, hasPrevSibling, hasPrivateData, interlink, lastResource, lastResource, moveInChain, name, name, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName
doDelete, getResourceType, id, id, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createSubNode, ensureNodeVisible, getHWND, getMousePointerNum, getNodeBgColor, setMousePointerNum, setNodeBgColor, setNodeFgColor
getFontInfo, getFontName, getFontSize, isFontBold, isFontItalic, isFontUnderline, setFontBold, setFontItalic, setFontName, setFontSize, setFontUnderline
getAllowedEffects, getDataFormat, getEffect, getOleDragMode, getOleDropMode, getOleX, getOleY, getState, isDefaultCursors, oleDrag, setAllowedEffects, setDataFormat, setDefaultCursors, setEffect, setOleDragMode, setOleDropMode, setOleX, setOleY, setState
isVisible, setVisible, setVisible
endFileDrop, getDroppedFile, getDroppedFile, getNumDroppedFiles, setDropTarget
getIdEx, getListItems, isEditCanUndo, setListItems, setListItems, setScreenValue
getPrivateData, setPrivateData, setPrivateData
getResourceType
id, id, unknown
setDisableRedraw
protected static final java.util.logging.Logger LOG
protected int buildingTree
private int nextId
private handle nodeImageListHandle
private java.util.HashMap<java.lang.Integer,TreeNodeResource> nodesById
private java.util.LinkedList<TreeNodeResource> nodesByIndices
private java.util.HashMap<java.lang.String,TreeNodeResource> nodesByKey
private java.util.List<java.lang.String> pendingAttrs
private java.util.List<java.lang.Object> pendingAttrValues
private boolean pendingPushNodes
private TreeNodeResource rootNode
public TreeWidgetBase(boolean dynamic, TreeConfig ctrl)
dynamic
- Flag indicating if this is a static or dynamic resource.ctrl
- Configuration container.protected static boolean assertKnown(BaseDataType... values)
false
if any of the supplied values is null
or unknown
, true
otherwise.values
- Values to check.protected static <T extends BaseDataType> T doWithNodeImpl(BaseDataType nodeId, BaseDataType[] mandatoryArgs, T failResult, java.util.function.Function<TreeNodeResource,T> body, java.util.function.Function<BaseDataType,TreeNodeResource> findNode)
failResult
.T
- The value to be supplied to the supplied function.nodeId
- Node id.mandatoryArgs
- Array of mandatory arguments, may be null
.failResult
- Value to return when the method fails.body
- The function to execute.findNode
- Provides the node based on the supplied node id or node key.private static int getNodeIdFrom(handle value)
value
- The tree node handlepublic void afterConfigUpdate(TreeConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<TreeConfig>
afterConfigUpdate
in class GenericWidget<TreeConfig>
beforeUpdate
- Config reference capturing the config state before
the owner's config was modified.public void clearAll()
public void clearNodesImageList()
clearNodesImageList
in interface TreeFace
public void collapseAll()
collapseAll
in interface TreeFace
public void collapseAllExcept(handle node)
collapseAllExcept
in interface TreeFace
node
- The node to exclude from collapsing, if unknown all nodes will be collapsed.public void collapseNode(NumberType nodeId)
collapseNode
in interface TreeFace
nodeId
- Id of the node to be collapsed.public integer createImage(character path)
setTreeNodeIcons(NumberType, NumberType, NumberType)
and
TreeFace.createSubNode(NumberType, character, character, logical, NumberType, NumberType, integer)
.
The returned integer value is the index into the local node image list.
The start index depends on the concrete tree subtype:
createImage
in interface TreeFace
path
- The image file path. Can be an absolute name or relative. When relative, the Propath entries
will be searched.public integer createMergedImage(integer imgIndex, character imgFile)
createMergedImage
in interface TreeFace
imgIndex
- Index of the target image.imgFile
- Image file of the source image.public void createSubNode(NumberType parentNodeId, character nodeText, character nodeKey, logical hasChildren, NumberType collapseIcon, NumberType expandIcon, character tooltip, integer newNodeId)
For TREELISTSs these indices are the values returned by createImage(character)
.
For TREEVIEWs also a few fixed built-in index values can be used:
createSubNode
in interface TreeFace
parentNodeId
- Id of the parent node for the newly created node. Use 0 to create a root node.nodeText
- The node text.nodeKey
- The unique node key for the new node.hasChildren
- When set to false
the node will be created as a leaf node without any children,
use true
for nodes that may hold child nodes.collapseIcon
- Optional collapse image index. See above for the value interpretation.expandIcon
- Optional collapse image index. See above for the value interpretation.tooltip
- The tooltip character string to be used with the new node.newNodeId
- Will be assigned node id of the created node if the operation succeeds.public void delete()
The method first calls GenericWidget.resourceDelete()
, if the method returns false
, the deletion
is aborted.
delete
in interface Deletable
delete
in class ControlEntity<TreeConfig>
public void deleteChildNodes(NumberType nodeId)
deleteChildNodes
in interface TreeFace
nodeId
- the node IDpublic void expandAll()
public void expandNode(NumberType nodeId)
expandNode
in interface TreeFace
nodeId
- Id of the node to be expanded.public handle findNode(character nodeKey)
findNode
in interface TreeFace
nodeKey
- Node key of the node to find.TreeNodeResource
or unknown.public handle findNode(NumberType nodeId)
findNode
in interface TreeFace
nodeId
- Node id of the node to find.TreeNodeResource
or unknown.public handle getDraggedNode()
getDraggedNode
in interface TreeFace
public handle getDraggedOverNode()
getDraggedOverNode
in interface TreeFace
public handle getDropHighlight()
getDropHighlight
in interface TreeFace
public int getDropHighlightNodeId()
public void getFirstChildNode(NumberType nodeId, integer outChildId, character outChildKey)
getFirstChildNode
in interface TreeFace
nodeId
- Id of the parent node.outChildId
- Upon return will hold id of the found node, 0 if no such node found.outChildKey
- Upon return will hold key of the found node, empty string if no such node found.public integer getFirstNode()
getFirstNode
in interface TreeFace
public handle getFirstVisibleNode()
getFirstVisibleNode
in interface TreeFace
public handle getFocusedAndSelectedNode()
TreeNodeResource
.
Note that the runtime behavior is the same as for the SELECTED-NODE attribute.getFocusedAndSelectedNode
in interface TreeFace
public character getFocusedAndSelectedNodeKey()
getFocusedAndSelectedNodeKey
in interface TreeFace
public handle getFocusedNode()
TreeNodeResource
.
Note that the runtime behavior is the same as for the SELECTED-NODE attribute.getFocusedNode
in interface TreeFace
public character getFocusedNodeKey()
getFocusedNodeKey
in interface TreeFace
public handle getImageList()
getImageList
in interface TreeFace
public integer getIndentation()
getIndentation
in interface TreeFace
public integer getLineStyle()
getLineStyle
in interface TreeFace
public character getNewNodeLabel()
getNewNodeLabel
in interface TreeFace
public integer getNextNode(NumberType nodeId)
getNextNode
in interface TreeFace
nodeId
- Id of the node for to start the search.public void getNextSiblingNode(NumberType nodeId, integer outSiblingId, character outSiblingKey)
getNextSiblingNode
in interface TreeFace
nodeId
- Id of the node where the search should start.outSiblingId
- Upon return will hold id of the found node, 0 if no such node found.outSiblingKey
- Upon return will hold key of the found node, unknown if no such node found.public character getNodeAt(NumberType x, NumberType y)
public boolean getNodeBold(character nodeKey)
getNodeBold
in interface TreeFace
nodeKey
- the node keypublic integer getNodeFgColor(NumberType nodeId)
getNodeFgColor
in interface TreeFace
nodeId
- a valid node idpublic logical getNodeHasChildren(NumberType nodeId)
getNodeHasChildren
in interface TreeFace
nodeId
- The node to query.public integer getNodeHeight()
getNodeHeight
in interface TreeFace
public integer getNodeLevel(character nodeKey)
getNodeLevel
in interface TreeFace
nodeKey
- Node key.public handle getNodes()
TreeNodeCollection
.public character getNodeText(character nodeKey)
getNodeText
in interface TreeFace
nodeKey
- Key of the node for which the text should be returned.public logical getNodeVisibleInViewPort(character nodeKey)
true
if the specified node is visible in the current view port.getNodeVisibleInViewPort
in interface TreeFace
nodeKey
- Node key of the node to check.public void getParentNode(NumberType nodeId, integer outParentId, character outParentKey)
getParentNode
in interface TreeFace
nodeId
- Id of the node where the search should start.outParentId
- Upon return will hold id of the found node, 0 if no such node found.outParentKey
- Upon return will hold key of the found node, unknown if no such node found.public void getPrevSiblingNode(NumberType nodeId, integer outSiblingId, character outSiblingKey)
getPrevSiblingNode
in interface TreeFace
nodeId
- Id of the node where the search should start.outSiblingId
- Upon return will hold id of the found node, 0 if no such node found.outSiblingKey
- Upon return will hold key of the found node, unknown if no such node found.public java.lang.String getPrivateData(character nodeKey)
getPrivateData
in interface TreeFace
nodeKey
- the node key valuenull
if private data was not set previouslypublic logical getRemoveNodeOnCollapse()
getRemoveNodeOnCollapse
in interface TreeFace
public integer getRowHeight()
getRowHeight
in interface TreeFace
public character getScreenValue()
character
type. If
there is no value in the screen buffer (if it is null
which is the representation for an uninitialized value), then return
the empty string.getScreenValue
in interface CommonWidget
getScreenValue
in class GenericWidget<TreeConfig>
character
type or the empty
string if the screen buffer value is uninitialized.public integer getScrollNodeCount()
getScrollNodeCount
in interface TreeFace
public integer getScrollWheelLines()
getScrollWheelLines
in interface TreeFace
public handle getSelectedNode()
TreeNodeResource
.getSelectedNode
in interface TreeFace
public void getSelectedNodeColors(integer outBg, integer outFg)
getSelectedNodeColors
in interface TreeFace
outBg
- the out parameter that will be assigned the background color for selected nodesoutFg
- the out parameter that will be assigned the foreground color for selected nodespublic integer getSelectedNodeId()
getSelectedNodeId
in interface TreeFace
public character getSelectedNodeKey()
getSelectedNodeKey
in interface TreeFace
public integer getStyle()
public integer getTopVisibleNodeId()
getTopVisibleNodeId
in interface TreeFace
public handle getTriggerNode()
Trigger Attribute value -------------------------------- VALUE-CHANGED The previously selected node, or root node (id 0) if no node selected. NODE-EXPANDING The node being expanded. NODE-EXPANDED The expanded node. NODE-COLLAPSING The node being collapsed. NODE-COLLAPSED The collapsed node. NODE-CLICK The node click event BEFORE-LABEL-EDIT The before node edit event AFTER-LABEL-EDIT The after node edit event CHANGE-NODE-DIRECT The previously selected node, or root node (id 0) if no node selected. CHANGE-TOP-VISIBLE-NODE The previously top node.
getTriggerNode
in interface TreeFace
public integer getVisibleNodeCount()
getVisibleNodeCount
in interface TreeFace
public comhandle hitTest(NumberType x, NumberType y)
public handle hitTestFwd(NumberType x, NumberType y)
hitTestFwd
in interface TreeFace
x
- Mouse cursor x position.y
- Mouse cursor y position.public logical isBuildingTree()
isBuildingTree
in interface TreeFace
public logical isCheckBoxes()
true
if a check box is displayed next to each tree node
in the tree view; otherwise, false
. The default is false
.isCheckBoxes
in interface TreeFace
public logical isDblClickExpanding()
isDblClickExpanding
in interface TreeFace
public logical isDragDrop()
true
the tree nodes can be dragged by the end user.
Note that currently this feature is not supported..isDragDrop
in interface TreeFace
public logical isDragDropOtherTree()
isDragDropOtherTree
in interface TreeFace
public logical isExpandOnEnter()
isExpandOnEnter
in interface TreeFace
public logical isExpandOnSingleClick()
isExpandOnSingleClick
in interface TreeFace
public logical isMultiSelect(logical extended)
isMultiSelect
in interface TreeFace
extended
- extended selection (TODO: find out semantics of this attribute)public logical isNodeExpanded(NumberType nodeId)
true
when the node of the supplied id is expanded.isNodeExpanded
in interface TreeFace
nodeId
- Id of the node to be checked.public logical isShowButtons()
isShowButtons
in interface TreeFace
public logical isTextEdit()
isTextEdit
in interface TreeFace
public integer nodeKeyToId(character nodeKey)
nodeKeyToId
in interface TreeFace
nodeKey
- A node key.public void pushWidgetAttr(java.lang.String fname, java.lang.Object value)
pushWidgetAttr
in class GenericWidget<TreeConfig>
fname
- The config field name.value
- The new config field value.public void pushWidgetAttr(java.lang.String[] fnames, java.lang.Object[] values)
pushWidgetAttr
in class GenericWidget<TreeConfig>
fnames
- The list of config field names.values
- The list of new config field values.public void removeNode(NumberType nodeId)
removeNode
in interface RemoveNode
nodeId
- A node id of the node to be removed.public void scrollNodeToTop(character nodeKey)
scrollNodeToTop
in interface TreeFace
nodeKey
- the node to make the top visiblepublic void scrollVertical(NumberType lines)
scrollVertical
in interface TreeFace
lines
- The number of lines to scroll.public void selectSetFirstVisibleNode(NumberType nodeId)
selectSetFirstVisibleNode
in interface TreeFace
nodeId
- the node to make the top visiblepublic 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 TreeFace
value
- the attribute valuepublic void setCheckBoxes(logical value)
true
to display a check box next to each tree node
in the tree view; otherwise, false
. The default is false
.setCheckBoxes
in interface TreeFace
public void setDblClickExpanding(logical value)
setDblClickExpanding
in interface TreeFace
value
- the attribute value.public void setDragDrop(logical value)
true
the tree nodes can be dragged by the end user.
Note that currently this feature is not supported.setDragDrop
in interface TreeFace
value
- the attribute valuepublic void setDragDropOtherTree(logical value)
setDragDropOtherTree
in interface TreeFace
value
- the attribute valuepublic void setDropHighlight(handle node)
setDropHighlight
in interface TreeFace
node
- The reference to a nodepublic void setExpandOnEnter(logical value)
setExpandOnEnter
in interface TreeFace
value
- the attribute valuepublic void setExpandOnSingleClick(logical value)
true
nodes will be
expanded/collapsed on single-click.setExpandOnSingleClick
in interface TreeFace
value
- the attribute valuepublic void setImageList(handle imgList)
setImageList
in interface TreeFace
imgList
- The image list to assign.public void setImageList(ImageList imgList)
setImageList
in interface TreeFace
imgList
- The image list to assign.public void setIndentation(NumberType value)
setIndentation
in interface TreeFace
value
- the attribute valuepublic void setLineStyle(integer value)
setLineStyle
in interface TreeFace
value
- the new line style valuepublic void setMultiSelect(logical extended, logical value)
setMultiSelect
in interface TreeFace
extended
- extended selection (TODO: find out semantics of this attribute)value
- the new multiselect valuepublic void setNewNodeLabel(character newLabel)
setNewNodeLabel
in interface TreeFace
newLabel
- The new label for the trigger nodepublic void setNodeBold(character nodeKey, logical value)
setNodeBold
in interface TreeFace
nodeKey
- the node keyvalue
- the attribute valuepublic void setNodeHasChildren(NumberType nodeId, logical value)
setNodeHasChildren
in interface TreeFace
nodeId
- The node to modify.value
- true
to set the node to allow to have child nodes, false
otherwise.public void setNodeHeight(NumberType value)
setNodeHeight
in interface TreeFace
value
- the attribute valuepublic void setNodeText(character nodeKey, character text)
setNodeText
in interface TreeFace
nodeKey
- Key of the node for which the text should be set.text
- The text to set.public void setPrivateData(character nodeKey, character value)
setPrivateData
in interface TreeFace
nodeKey
- the node key valuevalue
- new attribute valuepublic void setRemoveNodeOnCollapse(logical value)
true
collapsing a node will
cause all the node's children to be deleted.setRemoveNodeOnCollapse
in interface TreeFace
value
- the attribute valuepublic void setRowHeight(NumberType heightValue)
setRowHeight
in interface TreeFace
heightValue
- the new row height vale in pixels.public void setScrollWheelLines(NumberType value)
setScrollWheelLines
in interface TreeFace
value
- the attribute valuepublic void setSelectedNode(handle value)
setSelectedNode
in interface TreeFace
value
- the attribute valuepublic void setSelectedNodeColors(NumberType bg, NumberType fg)
setSelectedNodeColors
in interface TreeFace
bg
- the new background colorfg
- the new foreground colorpublic void setSelectedNodeKey(character nodeKey)
setSelectedNodeKey
in interface TreeFace
nodeKey
- the attribute valuepublic void setShowButtons(logical value)
true
to make the node expand icons (+-) visible,
false
to make the expand icons invisible.setShowButtons
in interface TreeFace
value
- the attribute valuepublic void setStyle(integer value)
public void setTextEdit(logical value)
setTextEdit
in interface TreeFace
value
- the attribute valuepublic void setTreeNodeIcons(NumberType nodeId, NumberType icon, NumberType expandIcon)
setTreeNodeIcons
in interface TreeFace
nodeId
- Id of the node to modify.icon
- Id of the image resource to be used as leaf icon (when the node has no children) or collapse
icon (when the node has children). The image must be first created with the
call to createImage(character)
.expandIcon
- Id of the image resource to be used as expand icon. The image must be first created with the
call to createImage(character)
.public void startLabelEdit()
startLabelEdit
in interface TreeFace
void _setSelectedNode(int nodeId)
nodeId
- The id of the tree node which should be selected.void _setSelectedNode(int nodeId, boolean trigger)
nodeId
- The id of the tree node which should be selected.trigger
- Flag to indicate if the VALUE-CHANGED trigger should be fired.final TreeNodeResource findNode(int nodeId)
nodeId
- A node id.final TreeNodeResource findNode(java.lang.String key)
key
- A node key.character getScreenValue(boolean initialized, BaseDataType bdt, java.lang.String fmt, boolean ignoreFormat)
getScreenValue
in class GenericWidget<TreeConfig>
initialized
- Flag indicating if the widget is realized or not.bdt
- The current value in the frame's buffer.fmt
- The format to be applied, in case this is a formatted value.ignoreFormat
- Flag indicating if the format needs to be ignored.TreeNodeResource getTreeNodeByIndex(int index)
index
corresponds
to the value of the INDEX property of the target tree node that is 1-based.index
- The node index, 0-based but the internal root node has a zero index and so the target value
of index
corresponds to the value of the INDEX property of the target tree node
that is 1-based.int getTreeNodeIndex(TreeNodeResource node)
node
- The target node.void removeNode(TreeNodeResource node, boolean pushNodes)
node
- The node being removed.pushNodes
- When set to true
the model change will be pushed to the client.void updateNode(TreeNodeResource node, java.lang.String oldKeyValue, boolean pushNodes)
node
- The given nodeoldKeyValue
- The old key value of the given nodepushNodes
- When set to true
the model change will be pushed to the client.protected final TreeNodeResource _getSelectedNode()
protected void addNode(TreeNodeResource node, boolean pushNodes)
node
- The node being added.pushNodes
- When set to true
the new node being added will be pushed to the client.protected abstract boolean allowDuplicateKeys()
protected abstract TreeNodeResource createNode(java.lang.String key, java.lang.String text, TreeNodeResource parent)
key
- Node key.text
- Node text.parent
- Node parent.protected void doWithNode(character nodeKey, BaseDataType[] mandatoryArgs, java.util.function.Consumer<TreeNodeResource> body)
nodeKey
- Node key.mandatoryArgs
- Array of mandatory arguments, may be null
.body
- The function to execute.protected <T extends BaseDataType> T doWithNode(character nodeKey, BaseDataType[] mandatoryArgs, T failResult, java.util.function.Function<TreeNodeResource,T> body)
failResult
.T
- The value to be supplied to the supplied function.nodeKey
- Node key.mandatoryArgs
- Array of mandatory arguments, may be null
.failResult
- Value to return when the method fails.body
- The function to execute.protected void doWithNode(NumberType nodeId, BaseDataType[] mandatoryArgs, java.util.function.Consumer<TreeNodeResource> body)
nodeId
- Node id.mandatoryArgs
- Array of mandatory arguments, may be null
.body
- The function to execute.protected <T extends BaseDataType> T doWithNode(NumberType nodeId, BaseDataType[] mandatoryArgs, T failResult, java.util.function.Function<TreeNodeResource,T> body)
failResult
.T
- The value to be supplied to the supplied function.nodeId
- Node id.mandatoryArgs
- Array of mandatory arguments, may be null
.failResult
- Value to return when the method fails.body
- The function to execute.protected final void ensureNodeVisible(character nodeKey, boolean trigger)
nodeKey
- the node to make visibletrigger
- Flag to indicate if the VALUE-CHANGED trigger should be fired.protected final void ensureNodeVisible(TreeNodeResource node, boolean select, boolean trigger)
node
- the node to make visibleselect
- if true
, then also select the nodetrigger
- Flag to indicate if the VALUE-CHANGED trigger should be fired.protected int getNextNodeId()
protected final TreeNodeResource getRootNode()
protected void pushNodes()
protected final void requestNodeExpand(int nodeId, boolean expand)
nodeId
- the node IDexpand
- the new expansion statusprivate int _getSelecteNodeId()
private final int _getTopVisibleNodeId()
private final TreeNodeResource getNodeByCoordinates(int x, int y)
x
- The given x-coordinatey
- The given y-coordinateprivate final void setAllNodesExpanded(boolean expanded, TreeNodeResource exceptNode)
expanded
- The new state.exceptNode
- The node to exclude from collapsing/expanding, if null all nodes will be collapsed/expanded.