Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This answer is incomplete, I'm using it as a notepad when I keep coming back to continue.</p> <p><code>javax.swing.text.html.HTML</code> contains a class <code>Tag</code>, it also contains a large number of final <code>Tag</code> instances that represent each of the HTML tags.</p> <p>We're interested in the line;</p> <pre><code>public static final Tag STRONG = new Tag("b"); </code></pre> <p><code>javax.swing.text.html.HTMLDocument</code> contains a <code>HashTable</code> <code>tagMap</code> that stores all of these tags.</p> <p>We're interested in the lines;</p> <pre><code>tagMap.put(HTML.Tag.STRONG, ca); </code></pre> <p>Where <code>ca</code> is <code>TagAction ca = new CharacterAction();</code> and;</p> <pre><code>protected void registerTag(HTML.Tag t, TagAction a) { tagMap.put(t, a); } </code></pre> <p>I've not located the package for <code>TagAction</code> yet or a way of accessing/changing the HTML document used by <code>HTMLEditorKit</code>.</p> <hr> <p>I've located what I believe to be the point where a tag is written out (marked with the <code>//here</code>;</p> <p>javax.swing.java.text.html.HTMLWriter.java</p> <pre><code>protected void writeEmbeddedTags(AttributeSet attr) throws IOException { // translate css attributes to html attr = convertToHTML(attr, oConvAttr); Enumeration names = attr.getAttributeNames(); while (names.hasMoreElements()) { Object name = names.nextElement(); if (name instanceof HTML.Tag) { HTML.Tag tag = (HTML.Tag)name; if (tag == HTML.Tag.FORM || tags.contains(tag)) { continue; } write('&lt;'); write(tag.toString());//Here Object o = attr.getAttribute(tag); if (o != null &amp;&amp; o instanceof AttributeSet) { writeAttributes((AttributeSet)o); } write('&gt;'); tags.addElement(tag); tagValues.addElement(o); } } } </code></pre> <p>So it looks asthough we need to change whatever builds the <code>attributeSet</code>s within the document being written.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload