private ParagraphElement addDocumentPropertiesRow(Document document, DivElement dialog, String label) { DivElement row = createChildDiv(document, dialog, "row"); SpanElement span = createChildSpan(document, row, ""); span.setInnerText(label); ParagraphElement result = createChildP(document, row); result.setInnerText("-"); return result; }
/** * Converts the given {@code HTML} into robot compatible plaintext. * * @param html the {@code HTML} to convert. * @return a plain text version of the given {@code HTML}. */ private static String convertToPlainText(String html) { StringBuffer result = new StringBuffer(); Matcher matcher = MARKUP_PATTERN.matcher(html); while (matcher.find()) { String replacement = ""; String tag = matcher.group().substring(1, matcher.group().length() - 1).split(" ")[0]; if (ParagraphElement.TAG.equalsIgnoreCase(tag) || BRElement.TAG.equalsIgnoreCase(tag)) { replacement = "\n"; } matcher.appendReplacement(result, replacement); } matcher.appendTail(result); return result.toString(); }
/** * Converts the given {@code HTML} into robot compatible plain text. * * @param html the text to convert. * @return a plain text version of the given html text. */ private static String convertToPlainText(String html) { StringBuffer result = new StringBuffer(); Matcher matcher = MARKUP_PATTERN.matcher(html); while (matcher.find()) { String replacement = ""; String tag = matcher.group().substring(1, matcher.group().length() - 1).split(" ")[0]; if (ParagraphElement.TAG.equalsIgnoreCase(tag) || BRElement.TAG.equalsIgnoreCase(tag)) { replacement = "\n"; } matcher.appendReplacement(result, replacement); } matcher.appendTail(result); return result.toString(); }
public PaperDialog(Element element, String styleName) { super(element); if (styleName != null && !styleName.equalsIgnoreCase(STYLE)) { styleName = STYLE + " " + styleName; } setStyleName(styleName); paragraphs = new ArrayList<ParagraphElement>(); }
public void addParagraphContent(String... content){ for(String txt : content){ ParagraphElement p = Document.get().createPElement(); p.setInnerHTML(txt); paragraphs.add(p); } if(!paragraphs.isEmpty()){ buildContent(); } }
public void addParagraphContent(ParagraphElement... content){ for(ParagraphElement p : content){ paragraphs.add(p); } if(!paragraphs.isEmpty()){ buildContent(); } }
private ParagraphElement createP(Document document) { ParagraphElement result = document.createPElement(); return result; }
private ParagraphElement createChildP(Document document, Element parent) { ParagraphElement result = createP(document); parent.appendChild(result); return result; }
/** * * @param styledBlock A non null styled paragraph instance * @param withFormatting If false, then styles will be ignored. */ public final void append(StyledBlock styledBlock, boolean withFormatting) { FlowPanel outerWidget = new FlowPanel(ParagraphElement.TAG /* <p> tag */ ); styledBlock.toGwtWidget(this, outerWidget, withFormatting, null /* outer style override */); appendAndScrollOrFocusAsAppropriate(outerWidget); }
private void buildContent(){ for(ParagraphElement p : paragraphs){ getPaperElement().appendChild(p); } }
public Help() { super(ParagraphElement.TAG); StyleUtils.addStyle(this, Help.STYLE_HELP); }
public Paragraph(final String html) { super(ParagraphElement.TAG, html); setHTML(html); }