Skip to content

Commit

Permalink
Parent Node for ContextNode (#19)
Browse files Browse the repository at this point in the history
* Adding the parent to the ContextNode as it provides enough info when creating correc hierarchies

* Removing unintended files from commits
  • Loading branch information
custompointofview authored Mar 13, 2024
1 parent 885cf0e commit bfa4eae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,7 @@ BasicSwing.class

# Java
*.class


# Output
output/
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Java Access Bridge Wrapper changelog

## 1.2.0 (date: 13.03.2024)

- Added parent Node to ContextNode - useful for creating correct hierarchies between nodes

## 1.1.0 (date: 03.10.2023)

- Add node/element refresh capability
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "java-access-bridge-wrapper"
version = "1.1.0"
version = "1.2.0"
description = "Python wrapper for the Windows Java Access Bridge"
license = "Apache-2.0"
readme = "README.md"
Expand Down
5 changes: 5 additions & 0 deletions src/JABWrapper/context_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(
ancestry: int = 0,
parse_children: bool = True,
max_depth: Optional[int] = None,
parent: Optional["ContextNode"] = None,
) -> None:
self._jab_wrapper = jab_wrapper
self._lock = lock
Expand All @@ -55,6 +56,8 @@ def __init__(
self.virtual_accessible_name = None
self._children: list[ContextNode] = []

self.parent: Optional[ContextNode] = parent

# Populate the element with data and its children if enabled.
self.refresh()

Expand Down Expand Up @@ -134,6 +137,7 @@ def _parse_children(self) -> None:
self.ancestry + 1,
parse_children=self._should_parse_children,
max_depth=self._max_depth,
parent=self,
)
self._children.append(child_node)

Expand Down Expand Up @@ -335,6 +339,7 @@ def get_visible_children(self) -> List:
self._lock,
self.ancestry + 1,
parse_children=False,
parent=self,
)
visible_children.append(visible_child)
return visible_children
Expand Down

0 comments on commit bfa4eae

Please sign in to comment.