public class HierarchyInspector
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
countMaxDepth(ej.mwt.Widget widget)
Counts the maximum depth of the child hierarchy of a widget.
|
static int |
countNumberOfContainers(ej.mwt.Widget widget)
Counts the number of containers in the child hierarchy of a widget.
|
static int |
countNumberOfWidgets(ej.mwt.Widget widget)
Counts the number of widgets in the child hierarchy of a widget.
|
static java.lang.String |
hierarchyToString(ej.mwt.Widget widget)
Prints the hierarchy of the given widget.
|
static java.lang.String |
pathToWidgetToString(ej.mwt.Widget widget)
Prints the path to the given widget with
> separator. |
static java.lang.String |
pathToWidgetToString(ej.mwt.Widget widget,
char separator)
Prints the path to the given widget.
|
public static int countNumberOfContainers(ej.mwt.Widget widget)
The method is recursive: if the given widget is a container, it browses its children.
widget
- the root widget.public static int countNumberOfWidgets(ej.mwt.Widget widget)
The method is recursive: if the given widget is a container, it browses its children.
widget
- the root widget.public static int countMaxDepth(ej.mwt.Widget widget)
The method is recursive: if the given widget is a container, it browses its children.
widget
- the root widget.public static java.lang.String hierarchyToString(ej.mwt.Widget widget)
Prints the widget and its children recursively in a tree format.
widget
- the widget.public static java.lang.String pathToWidgetToString(ej.mwt.Widget widget)
>
separator.widget
- the widget to inspect.pathToWidgetToString(Widget, char)
public static java.lang.String pathToWidgetToString(ej.mwt.Widget widget, char separator)
Prints the containers from the root (including the desktop) to the widget, separated with the given separator.
Example: Desktop > Scroll > ScrollableList > Label
widget
- the widget to inspect.separator
- the separator between the items.