@Override protected void actionPerformed(final ActionEvent e, final NodeModel node) { final String nodeText = node.getText(); if (HtmlUtils.isHtmlNode(nodeText)) { ((MTextController) TextController.getController()) .setNodeText(node, HtmlUtils.htmlToPlain(nodeText)); } }
public final void setText(final String text) { userObject = XmlUtils.makeValidXml(text); xmlText = HtmlUtils.toXhtml(text); if (xmlText != null && !xmlText.startsWith("<")) { userObject = " " + text; xmlText = null; } }
private Binding addStaticBindings(Binding binding) { binding.setProperty("logger", new LogUtils()); binding.setProperty("ui", new UITools()); binding.setProperty("htmlUtils", HtmlUtils.getInstance()); binding.setProperty("textUtils", new TextUtils()); binding.setProperty("menuUtils", new MenuUtils()); binding.setProperty("config", new ConfigProperties()); return binding; }
private void setStyleList(JButton btn, String styles) { if ("".equals(styles)) { btn.setToolTipText(null); btn.setText(" "); return; } btn.setToolTipText(HtmlUtils.plainToHTML(styles)); final String text = styles.replaceAll("\n", ", "); btn.setText(text); }
protected void setButtonText() { final String text = script.substring(0, Math.min(40, script.length())).trim().replaceAll("\\s+", " "); if (!text.equals("")) { showEditorBtn.setToolTipText(HtmlUtils.plainToHTML(script)); showEditorBtn.setText(text); } else { final String title = TextUtils.getText("EditScript"); showEditorBtn.setToolTipText(null); showEditorBtn.setText(title); } }
@Override public String toString() { return HtmlUtils.htmlToPlain(getText()); }
public final void setXmlText(final String pXmlText) { xmlText = XmlUtils.makeValidXml(pXmlText); userObject = HtmlUtils.toHtml(xmlText); }
private String toHtml(String htmlOrPlainText) { if (HtmlUtils.isHtmlNode(htmlOrPlainText)) return htmlOrPlainText.replaceAll("</?(html|body)>", ""); else return HtmlUtils.toHTMLEscapedText(htmlOrPlainText); }