StyleEnumSupport extends EnumSupport { @Override @NotNull public List<ValueWithDisplayString> getAllValues() { String tagName = myProperty.getTagName(); assert tagName != null; return convertStylesToDisplayValues(myStyleFilter.getWidgetStyles(tagName)); } StyleEnumSupport(@NotNull NlProperty property); private  StyleEnumSupport(@NotNull AndroidFacet facet, @NotNull NlProperty property); @VisibleForTesting  StyleEnumSupport(@NotNull NlProperty property, @NotNull StyleFilter styleFilter, @NotNull ResourceNamespace defaultNamespace); @Override @NotNull List<ValueWithDisplayString> getAllValues();  }
@Test public void testFindPossibleValues() { Dependencies.INSTANCE.add(myProjectRule.fixture, APPCOMPAT_LIB_ARTIFACT_ID); NlComponent checkBox = myLayout.getChild(0); NlPropertyItem property = NlPropertyItem.create(new XmlName(ATTR_STYLE, ""), null, ImmutableList.of(checkBox), null); StyleEnumSupport support = new StyleEnumSupport(property); assertThat(support.getAllValues()).containsExactly( new ValueWithDisplayString("MyCheckBox", "@style/MyCheckBox"), ValueWithDisplayString.SEPARATOR, new ValueWithDisplayString("Widget.AppCompat.CompoundButton.CheckBox", "@style/Widget.AppCompat.CompoundButton.CheckBox"), ValueWithDisplayString.SEPARATOR, androidStyle("Widget.CompoundButton.CheckBox"), androidStyle("Widget.DeviceDefault.CompoundButton.CheckBox"), androidStyle("Widget.DeviceDefault.Light.CompoundButton.CheckBox"), androidStyle("Widget.Holo.CompoundButton.CheckBox"), androidStyle("Widget.Holo.Light.CompoundButton.CheckBox"), androidStyle("Widget.Material.CompoundButton.CheckBox"), androidStyle("Widget.Material.Light.CompoundButton.CheckBox") ).inOrder(); }
@Test public void testFindPossibleValuesWithInvalidXmlTag() { NlComponent checkBox = myLayout.getChild(0); NlPropertyItem property = NlPropertyItem.create(new XmlName(ATTR_STYLE, ""), null, ImmutableList.of(checkBox), null); deleteTag(checkBox); StyleEnumSupport support = new StyleEnumSupport(property); assertThat(support.getAllValues()).containsExactly( new ValueWithDisplayString("MyCheckBox", "@style/MyCheckBox"), ValueWithDisplayString.SEPARATOR, androidStyle("Widget.CompoundButton.CheckBox"), androidStyle("Widget.DeviceDefault.CompoundButton.CheckBox"), androidStyle("Widget.DeviceDefault.Light.CompoundButton.CheckBox"), androidStyle("Widget.Holo.CompoundButton.CheckBox"), androidStyle("Widget.Holo.Light.CompoundButton.CheckBox"), androidStyle("Widget.Material.CompoundButton.CheckBox"), androidStyle("Widget.Material.Light.CompoundButton.CheckBox") ).inOrder(); }