@Test public void horizontal_alignment_RIGHT() { xmlTag.setAttribute("horizontal-alignment", "RIGHT"); populator.populate(xmlTag, label); assertEquals(RIGHT, label.getHorizontalAlignment()); }
@Override public boolean populate(XmlReader.Element xmlTag, Label uiElement) { if (xmlTag.hasAttribute("text")) { uiElement.setText(xmlTag.getAttribute("text")); } uiElement.setResponsive(xmlTag.getBoolean("responsive", false)); String providedHorizontalAlignment = xmlTag.get("horizontal-alignment", "LEFT").toUpperCase(); uiElement.setHorizontalAlignment(HorizontalAlignment.valueOf(providedHorizontalAlignment)); return false; }
LabelPopulator implements UiElementPopulator<Label> { @Override public boolean populate(XmlReader.Element xmlTag, Label uiElement) { if (xmlTag.hasAttribute("text")) { uiElement.setText(xmlTag.getAttribute("text")); } uiElement.setResponsive(xmlTag.getBoolean("responsive", false)); String providedHorizontalAlignment = xmlTag.get("horizontal-alignment", "LEFT").toUpperCase(); uiElement.setHorizontalAlignment(HorizontalAlignment.valueOf(providedHorizontalAlignment)); return false; } }
LabelPopulator implements UiElementPopulator<Label> { @Override public boolean populate(XmlReader.Element xmlTag, Label uiElement) { if (xmlTag.hasAttribute("text")) { uiElement.setText(xmlTag.getAttribute("text")); } uiElement.setResponsive(xmlTag.getBoolean("responsive", false)); String providedHorizontalAlignment = xmlTag.get("horizontal-alignment", "LEFT").toUpperCase(); uiElement.setHorizontalAlignment(HorizontalAlignment.valueOf(providedHorizontalAlignment)); return false; }  }
LabelPopulator implements UiElementPopulator<Label> { @Override public boolean populate(XmlReader.Element xmlTag, Label uiElement) { if (xmlTag.hasAttribute("text")) { uiElement.setText(xmlTag.getAttribute("text")); } uiElement.setResponsive(xmlTag.getBoolean("responsive", false)); String providedHorizontalAlignment = xmlTag.get("horizontal-alignment", "LEFT").toUpperCase(); uiElement.setHorizontalAlignment(HorizontalAlignment.valueOf(providedHorizontalAlignment)); return false; }  @Override boolean populate(XmlReader.Element xmlTag, Label uiElement); }
LabelPopulator implements UiElementPopulator<Label> { @Override public boolean populate(XmlReader.Element xmlTag, Label uiElement) { if (xmlTag.hasAttribute("text")) { uiElement.setText(xmlTag.getAttribute("text")); } uiElement.setResponsive(xmlTag.getBoolean("responsive", false)); String providedHorizontalAlignment = xmlTag.get("horizontal-alignment", "LEFT").toUpperCase(); uiElement.setHorizontalAlignment(HorizontalAlignment.valueOf(providedHorizontalAlignment)); return false; }  @Override boolean populate(XmlReader.Element xmlTag, Label uiElement);  }