/** * Pop to the previous element in the stack. */ private void popElement() { currentElement = getCurrentElement().getParentElement(); }
/** * Assert that the builder is in a state where an attribute can be added. * * @return the element on which the attribute can be set * @throw {@link IllegalStateException} if the start tag is closed */ Element assertCanAddAttribute() { assertCanAddAttributeImpl(); return getCurrentElement(); }
@Override protected void doTextImpl(String text) { getCurrentElement().setInnerText(text); }
@Override protected void doHtmlImpl(SafeHtml html) { getCurrentElement().setInnerSafeHtml(html); }
/** * Assert that the builder is in a state where a style property can be added. * * @return the {@link Style} on which the property can be set * @throw {@link IllegalStateException} if the style is not accessible */ Style assertCanAddStyleProperty() { assertCanAddStylePropertyImpl(); return getCurrentElement().getStyle(); }
/** * Start a child element. * * @param element the element to start * @param builder the builder used to builder the new element */ private void start(Element element, ElementBuilderBase<?> builder) { onStart(element.getTagName(), builder); // Set the root element. if (rootElement == null) { // This is the new root element. rootElement = element; } else { // Appending to the current element. getCurrentElement().appendChild(element); } // Add the element to the stack. currentElement = element; }
/** * Pop to the previous element in the stack. */ private void popElement() { currentElement = getCurrentElement().getParentElement(); }
/** * Assert that the builder is in a state where an attribute can be added. * * @return the element on which the attribute can be set * @throw {@link IllegalStateException} if the start tag is closed */ Element assertCanAddAttribute() { assertCanAddAttributeImpl(); return getCurrentElement(); }
/** * Pop to the previous element in the stack. */ private void popElement() { currentElement = getCurrentElement().getParentElement(); }
/** * Assert that the builder is in a state where an attribute can be added. * * @return the element on which the attribute can be set * @throw {@link IllegalStateException} if the start tag is closed */ Element assertCanAddAttribute() { assertCanAddAttributeImpl(); return getCurrentElement(); }
@Override protected void doTextImpl(String text) { getCurrentElement().setInnerText(text); }
@Override protected void doTextImpl(String text) { getCurrentElement().setInnerText(text); }
@Override protected void doHtmlImpl(SafeHtml html) { getCurrentElement().setInnerSafeHtml(html); }
@Override protected void doHtmlImpl(SafeHtml html) { getCurrentElement().setInnerSafeHtml(html); }
/** * Assert that the builder is in a state where a style property can be added. * * @return the {@link Style} on which the property can be set * @throw {@link IllegalStateException} if the style is not accessible */ Style assertCanAddStyleProperty() { assertCanAddStylePropertyImpl(); return getCurrentElement().getStyle(); }
/** * Assert that the builder is in a state where a style property can be added. * * @return the {@link Style} on which the property can be set * @throw {@link IllegalStateException} if the style is not accessible */ Style assertCanAddStyleProperty() { assertCanAddStylePropertyImpl(); return getCurrentElement().getStyle(); }
/** * Start a child element. * * @param element the element to start * @param builder the builder used to builder the new element */ private void start(Element element, ElementBuilderBase<?> builder) { onStart(element.getTagName(), builder); // Set the root element. if (rootElement == null) { // This is the new root element. rootElement = element; } else { // Appending to the current element. getCurrentElement().appendChild(element); } // Add the element to the stack. currentElement = element; }
/** * Start a child element. * * @param element the element to start * @param builder the builder used to builder the new element */ private void start(Element element, ElementBuilderBase<?> builder) { onStart(element.getTagName(), builder); // Set the root element. if (rootElement == null) { // This is the new root element. rootElement = element; } else { // Appending to the current element. getCurrentElement().appendChild(element); } // Add the element to the stack. currentElement = element; }