public class HTMLDocPlus
extends javax.swing.text.html.HTMLDocument
Modifier and Type | Class and Description |
---|---|
static class |
HTMLDocPlus.ChoiceDiv
Deprecated.
|
static class |
HTMLDocPlus.ChoiceGroup
Deprecated.
A document may be displayed piecemeal; nominally each piece
corresponds to a tab in the view, but other organizations
will also be used.
|
static class |
HTMLDocPlus.Embed
Deprecated.
Manage a user input object embedded in a document.
|
static class |
HTMLDocPlus.EmbedAbstractButton
Deprecated.
An Embed that manages a button.
|
static class |
HTMLDocPlus.EmbedButton
Deprecated.
Embed JButton.
|
static class |
HTMLDocPlus.EmbedCheckBox
Deprecated.
An Embed that manages a JCheckBox.
|
static class |
HTMLDocPlus.EmbedComboBox
Deprecated.
An Embed that manages a JComboBox
|
static class |
HTMLDocPlus.EmbedFilename
Deprecated.
Embed a JTextField AND an associated button
to raise a JFileChooser.
|
static class |
HTMLDocPlus.EmbedLabel
Deprecated.
An Embed that manages a JLabel.
|
static class |
HTMLDocPlus.EmbedList
Deprecated.
An Embed that manages a JList.
|
static class |
HTMLDocPlus.EmbedListener
Deprecated.
|
static class |
HTMLDocPlus.EmbedRadioButton
Deprecated.
An Embed that manages a JRadioButton.
|
static class |
HTMLDocPlus.EmbedTextComponent
Deprecated.
An Embed that manages a JTextField or a JTextArea.
|
static class |
HTMLDocPlus.HTMLEdKitPlus
Deprecated.
|
static class |
HTMLDocPlus.HTMLFactoryPlus
Deprecated.
|
javax.swing.text.html.HTMLDocument.BlockElement, javax.swing.text.html.HTMLDocument.HTMLReader, javax.swing.text.html.HTMLDocument.Iterator, javax.swing.text.html.HTMLDocument.RunElement
javax.swing.text.DefaultStyledDocument.AttributeUndoableEdit, javax.swing.text.DefaultStyledDocument.ElementBuffer, javax.swing.text.DefaultStyledDocument.ElementSpec, javax.swing.text.DefaultStyledDocument.SectionElement
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HIDDEN
Deprecated.
|
static java.lang.String |
HTMLPLUS
Deprecated.
|
static java.lang.String |
NL
Deprecated.
|
static java.lang.String |
RTFPLUS
Deprecated.
|
static java.lang.String |
TEXTPLUS
Deprecated.
|
Constructor and Description |
---|
HTMLDocPlus()
Deprecated.
Clone of the no-arg constructor for HTMLDocument.
|
HTMLDocPlus(javax.swing.text.AbstractDocument.Content c,
javax.swing.text.html.StyleSheet styles)
Deprecated.
Clone of the two-arg constructor for HTMLDocument.
|
HTMLDocPlus(javax.swing.text.html.StyleSheet styles)
Deprecated.
Clone of the one-arg constructor for HTMLDocument.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener act)
Deprecated.
Add a listener for ActionEvents.
|
void |
addEmbedListener(HTMLDocPlus.EmbedListener el)
Deprecated.
|
static void |
copyElement(javax.swing.text.html.HTMLDocument.BlockElement src,
javax.swing.text.html.HTMLDocument.BlockElement dest)
Deprecated.
Copy one element to another.
|
static void |
dumpElementTree(java.lang.String fileName,
javax.swing.text.Element elt,
javax.swing.JEditorPane jed)
Deprecated.
Dump an element and children to a named file.
|
static void |
dumpHTML(java.lang.String fileName,
javax.swing.text.Element elt)
Deprecated.
|
static void |
dumpViews(Writer f,
javax.swing.text.View v,
java.lang.String indent)
Deprecated.
Write a view tree to a Writer.
|
static void |
dumpViewTree(java.lang.String fileName,
javax.swing.text.View v)
Deprecated.
Write view tree to to file.
|
void |
extractChoices()
Deprecated.
Remove and save the DIVs that are children of DIVs with
attribute choicegroup="groupname" attribute.
|
protected void |
fireActionListeners(java.awt.event.ActionEvent aev)
Deprecated.
|
java.util.ArrayList<java.awt.event.ActionListener> |
getActionListeners()
Deprecated.
|
static int |
getAttrInt(javax.swing.text.AttributeSet attrs,
java.lang.Object name)
Deprecated.
Find a named attribute and convert its value to an int.
|
static java.lang.String |
getAttrString(javax.swing.text.AttributeSet attrs,
java.lang.Object name)
Deprecated.
|
HTMLDocPlus.ChoiceGroup |
getChoiceGroup(java.lang.String name)
Deprecated.
|
java.util.HashMap<java.lang.String,HTMLDocPlus.ChoiceGroup> |
getChoiceTable()
Deprecated.
|
java.lang.String |
getColor(int dot)
Deprecated.
|
HTMLDocPlus.Embed |
getEmbed(java.lang.String id)
Deprecated.
|
java.util.ArrayList<HTMLDocPlus.EmbedListener> |
getEmbedListeners()
Deprecated.
|
java.util.Collection<HTMLDocPlus.Embed> |
getEmbeds()
Deprecated.
|
javax.swing.text.html.HTMLEditorKit.ParserCallback |
getReader(int pos)
Deprecated.
|
javax.swing.text.html.HTMLEditorKit.ParserCallback |
getReader(int pos,
int popDepth,
int pushDepth,
javax.swing.text.html.HTML.Tag insertTag)
Deprecated.
|
static java.awt.Rectangle |
getViewRectangle(javax.swing.text.Element e,
javax.swing.text.JTextComponent txt)
Deprecated.
Compute the union of all visible Rectangles
of this element and its descendants.
|
static void |
loadDocument(javax.swing.JEditorPane jed,
java.lang.Class aClass,
java.lang.String locator,
java.net.URL base)
Deprecated.
Load the document of the given JEditorPane from a webpage at
a given locator (IOUtils.getInputStream).
|
static void |
loadDocument(javax.swing.JEditorPane jed,
java.lang.String locator)
Deprecated.
Load the document of the given JEditorPane from a webpage at
a given locator (IOUtils.getInputStream).
|
static void |
loadDocumentFromStream(javax.swing.JEditorPane jed,
InputStream src)
Deprecated.
Load an HTML document from an InputStream.
|
void |
nbsp(javax.swing.text.html.HTMLDocument.BlockElement e)
Deprecated.
replace the contents of an element with a single
|
HTMLDocPlus.Embed |
registerEmbed(java.lang.String enm,
HTMLDocPlus.Embed e)
Deprecated.
|
void |
removeActionListener(java.awt.event.ActionListener act)
Deprecated.
|
void |
removeEmbedListener(HTMLDocPlus.EmbedListener el)
Deprecated.
|
void |
setElementAttribute(javax.swing.text.Element elt,
java.lang.Object key,
java.lang.Object val)
Deprecated.
Sets an attribute for an HTMLDocument's Element.
|
static void |
setType(javax.swing.JEditorPane jedp)
Deprecated.
to make jEditorPane actually create an HTMLDocPlus.
|
create, createBranchElement, createDefaultRoot, createLeafElement, fireChangedUpdate, fireUndoableEditUpdate, getBase, getElement, getElement, getIterator, getParser, getPreservesUnknownTags, getStyleSheet, getTokenThreshold, insert, insertAfterEnd, insertAfterStart, insertBeforeEnd, insertBeforeStart, insertUpdate, processHTMLFrameHyperlinkEvent, setBase, setInnerHTML, setOuterHTML, setParagraphAttributes, setParser, setPreservesUnknownTags, setTokenThreshold
addDocumentListener, addStyle, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, styleChanged
addUndoableEditListener, createPosition, dump, fireInsertUpdate, fireRemoveUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
public static final java.lang.String HTMLPLUS
public static final java.lang.String TEXTPLUS
public static final java.lang.String RTFPLUS
public static final java.lang.String HIDDEN
public static final java.lang.String NL
public HTMLDocPlus()
public HTMLDocPlus(javax.swing.text.html.StyleSheet styles)
styles
- The StyleSheet to be used.public HTMLDocPlus(javax.swing.text.AbstractDocument.Content c, javax.swing.text.html.StyleSheet styles)
c
- Contents for the document; may have HTML markupstyles
- The StyleSheet to be used.public java.util.Collection<HTMLDocPlus.Embed> getEmbeds()
public HTMLDocPlus.Embed registerEmbed(java.lang.String enm, HTMLDocPlus.Embed e)
public HTMLDocPlus.Embed getEmbed(java.lang.String id)
public java.util.ArrayList<HTMLDocPlus.EmbedListener> getEmbedListeners()
public void addEmbedListener(HTMLDocPlus.EmbedListener el)
public void removeEmbedListener(HTMLDocPlus.EmbedListener el)
public java.util.ArrayList<java.awt.event.ActionListener> getActionListeners()
public void addActionListener(java.awt.event.ActionListener act)
act
- the listener object whose ActionPerformed is to be calledpublic void removeActionListener(java.awt.event.ActionListener act)
protected void fireActionListeners(java.awt.event.ActionEvent aev)
public javax.swing.text.html.HTMLEditorKit.ParserCallback getReader(int pos)
getReader
in class javax.swing.text.html.HTMLDocument
public javax.swing.text.html.HTMLEditorKit.ParserCallback getReader(int pos, int popDepth, int pushDepth, javax.swing.text.html.HTML.Tag insertTag)
getReader
in class javax.swing.text.html.HTMLDocument
public static void loadDocument(javax.swing.JEditorPane jed, java.lang.String locator)
jed
- The JEditorPane whose getDocument will be loaded intolocator
- a locator identifying the document to be loadedpublic static void loadDocument(javax.swing.JEditorPane jed, java.lang.Class aClass, java.lang.String locator, java.net.URL base)
jed
- The JEditorPane whose getDocument will be loaded intoaClass
- the Class for the application; its ClassLoader
will be applied to resolve "resource:" and "jardir:" locators.locator
- a locator identifying the document to be loadedbase
- base URL for resolving relative references in the documentpublic static void loadDocumentFromStream(javax.swing.JEditorPane jed, InputStream src) throws IOException
jed
- The editor into which to do the load. The method sets
the type to .html with a call to HTMLDocPlus.setType(jed).src
- the document source.IOException
- for input errorpublic HTMLDocPlus.ChoiceGroup getChoiceGroup(java.lang.String name)
public java.util.HashMap<java.lang.String,HTMLDocPlus.ChoiceGroup> getChoiceTable()
public void extractChoices()
public void nbsp(javax.swing.text.html.HTMLDocument.BlockElement e)
e
- The BlockElement to evisceratepublic static java.awt.Rectangle getViewRectangle(javax.swing.text.Element e, javax.swing.text.JTextComponent txt) throws javax.swing.text.BadLocationException
e
- the Elementtxt
- the Viewjavax.swing.text.BadLocationException
- for java.swing errorpublic void setElementAttribute(javax.swing.text.Element elt, java.lang.Object key, java.lang.Object val)
This method is thread safe.
elt
- an Element in an HTMLDocumentkey
- the attribute key. Usually this should be HTML.Attribute.xxxval
- the value. For HTML.Attribute.xxx, the value is a String.
// Most ways to set color fail:
// CSS.Attribute.BACKGROUND_COLOR,
// doc.getStyleSheet().stringToColor("#ffff66"));
//
// HTML.Attribute.STYLE, "background-color: #ffff66");
//
// // addAttribute fails because set is immutable
// dl.addAttribute(HTML.Attribute.BGCOLOR,
// doc.getStyleSheet().stringToColor("#FFFF66"));
//
// // setParagraphAttributes does get color,
// // but only behind the text, not the full column
// SimpleAttributeSet attrset = new SimpleAttributeSet();
// attrset.addAttribute(HTML.Attribute.BGCOLOR, "#FFFF66");
// doc.setParagraphAttributes(start, end-start-1,
// attrset, false);public java.lang.String getColor(int dot)
public static java.lang.String getAttrString(javax.swing.text.AttributeSet attrs, java.lang.Object name)
public static int getAttrInt(javax.swing.text.AttributeSet attrs, java.lang.Object name)
attrs
- An AttributeSet of attributesname
- Name of an attribute that could be in the set.public static void setType(javax.swing.JEditorPane jedp)
jedp
- The JEditorPane to be made to use HTMLDocPlus.public static void dumpElementTree(java.lang.String fileName, javax.swing.text.Element elt, javax.swing.JEditorPane jed)
fileName
- where to write the outputelt
- the Element to dumpjed
- the Text component that maps from model to viewpublic static void dumpHTML(java.lang.String fileName, javax.swing.text.Element elt)
public static void dumpViewTree(java.lang.String fileName, javax.swing.text.View v)
fileName
- File namev
- top level view in the treepublic static void dumpViews(Writer f, javax.swing.text.View v, java.lang.String indent) throws IOException
f
- The destination.v
- The parent view.indent
- Prefix to lines. Three spaces are appended for each level of depth.IOException
- If writing to f throws and exceptionpublic static void copyElement(javax.swing.text.html.HTMLDocument.BlockElement src, javax.swing.text.html.HTMLDocument.BlockElement dest)
src
- a BlockElement to be copied, including its document textdest
- another BlockElement; its contents are to be replaced with the copy