NodeInfo tree working (besides litho nodes)

Summary: The second tree has access to all AX NodeInfo properties (they are not in the sidebar yet). Infrastructure set up to customize displayed information bassed on what is most useful. Descriptors for views updated to include AX functionality and non-view descriptors AX functions defaulted to null/empty. Non-view nodes (like Fragments, Window, Appication) no longer included in AX tree. Corresponding nodes will be highlighted (although not expanded) on click in either tree.

Differential Revision: D8795800

fbshipit-source-id: cf2333f69bfecca3ff84aae62681c684dfa14bf3
This commit is contained in:
Sara Valderrama
2018-07-12 09:23:29 -07:00
committed by Facebook Github Bot
parent 9e673a07a8
commit 1c5ecce667
8 changed files with 284 additions and 8 deletions

View File

@@ -44,6 +44,12 @@ public class TextViewDescriptor extends NodeDescriptor<TextView> {
return descriptor.getName(node);
}
@Override
public String getAXName(TextView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(View.class);
return descriptor.getAXName(node);
}
@Override
public int getChildCount(TextView node) {
return 0;
@@ -54,6 +60,11 @@ public class TextViewDescriptor extends NodeDescriptor<TextView> {
return null;
}
@Override
public @Nullable Object getAXChildAt(TextView node, int index) {
return null;
}
@Override
public List<Named<SonarObject>> getData(TextView node) throws Exception {
final List<Named<SonarObject>> props = new ArrayList<>();
@@ -76,6 +87,14 @@ public class TextViewDescriptor extends NodeDescriptor<TextView> {
return props;
}
@Override
public List<Named<SonarObject>> getAXData(TextView node) throws Exception {
final List<Named<SonarObject>> props = new ArrayList<>();
final NodeDescriptor descriptor = descriptorForClass(View.class);
props.addAll(descriptor.getAXData(node));
return props;
}
@Override
public void setValue(TextView node, String[] path, SonarDynamic value) throws Exception {
switch (path[0]) {
@@ -106,6 +125,12 @@ public class TextViewDescriptor extends NodeDescriptor<TextView> {
return descriptor.getAttributes(node);
}
@Override
public List<Named<String>> getAXAttributes(TextView node) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(View.class);
return descriptor.getAXAttributes(node);
}
@Override
public void setHighlighted(TextView node, boolean selected) throws Exception {
final NodeDescriptor descriptor = descriptorForClass(View.class);