PAnchor extends PFocusWidget { public void setHref(final String href) { if (Objects.equals(this.href, href)) return; this.href = href; if (initialized) saveUpdate(ServerToClientModel.HREF, href); } protected  PAnchor(); protected  PAnchor(final String text); protected  PAnchor(final String text, final String href); String getHref(); void setHref(final String href); String getText(); void setText(final String text); String getHTML(); void setHTML(final String html); @Override String dumpDOM();  }
@Test public void testSetHref() { final PAnchor anchor = Element.newPAnchor("Text", "#test"); assertEquals("Text", anchor.getText()); assertEquals("#test", anchor.getHref()); assertNull(anchor.getHTML()); final PAnchor anchor1 = Element.newPAnchor("Text"); assertEquals("Text", anchor1.getText()); assertNull(anchor1.getHref()); anchor1.setHref("#test"); assertEquals("#test", anchor1.getHref()); }