@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));
   }
 }
示例#2
0
 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;
 }
示例#4
0
 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);
   }
 }
示例#6
0
 @Override
 public String toString() {
   return HtmlUtils.htmlToPlain(getText());
 }
示例#7
0
 public final void setXmlText(final String pXmlText) {
   xmlText = XmlUtils.makeValidXml(pXmlText);
   userObject = HtmlUtils.toHtml(xmlText);
 }
示例#8
0
 private String toHtml(String htmlOrPlainText) {
   if (HtmlUtils.isHtmlNode(htmlOrPlainText))
     return htmlOrPlainText.replaceAll("</?(html|body)>", "");
   else return HtmlUtils.toHTMLEscapedText(htmlOrPlainText);
 }