Skip to content

Commit

Permalink
add alternative labels in json output
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyli committed Aug 1, 2016
1 parent 776a17b commit 1fecd5f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import android.graphics.Rect;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

import edu.cmu.hcii.sugilite.model.block.UIElementMatchingFilter;

/**
Expand All @@ -21,6 +25,8 @@ public SugiliteFilterJSON(UIElementMatchingFilter filter){
this.parentFilter = new SugiliteFilterJSON(filter.getParentFilter());
if(filter.getChildFilter() != null)
this.childFilter = new SugiliteFilterJSON(filter.getChildFilter());
if(filter.alternativeLabels != null && filter.alternativeLabels.size() > 0)
alternativeLabels = new HashSet<>(filter.alternativeLabels);
}
}
public UIElementMatchingFilter toUIElementMatchingFilter(){
Expand All @@ -38,8 +44,11 @@ public UIElementMatchingFilter toUIElementMatchingFilter(){
filter.setParentFilter(parentFilter.toUIElementMatchingFilter());
if(childFilter != null)
filter.setChildFilter(childFilter.toUIElementMatchingFilter());
if(alternativeLabels != null)
filter.alternativeLabels = new HashSet<>(alternativeLabels);
return filter;
}
public String text, contentDescription, viewId, packageName, className, boundsInScreen, boundsInParent;
public SugiliteFilterJSON parentFilter, childFilter;
public Set<Map.Entry<String, String>> alternativeLabels;
}

0 comments on commit 1fecd5f

Please sign in to comment.