Package javax.help
Class TOCView.DefaultTOCFactory
- java.lang.Object
-
- javax.help.TOCView.DefaultTOCFactory
-
- All Implemented Interfaces:
TreeItemFactory
- Enclosing class:
- TOCView
public static class TOCView.DefaultTOCFactory extends java.lang.Object implements TreeItemFactory
A default TreeItemFactory that can be used to parse TOC items as used by this navigator.
-
-
Constructor Summary
Constructors Constructor Description DefaultTOCFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TreeItem
createItem()
Creates a default TOCItem.TreeItem
createItem(java.lang.String tagName, java.util.Hashtable atts, HelpSet hs, java.util.Locale locale)
Create an TOCItem with the given data.java.util.Enumeration
listMessages()
Lists all the error messages.javax.swing.tree.DefaultMutableTreeNode
parsingEnded(javax.swing.tree.DefaultMutableTreeNode node)
Ends parsing.void
parsingStarted(java.net.URL source)
Starts parsing.void
processDOCTYPE(java.lang.String root, java.lang.String publicID, java.lang.String systemID)
Processes a DOCTYPE.void
processPI(HelpSet hs, java.lang.String target, java.lang.String data)
Finds a PI--ignore it.void
reportMessage(java.lang.String msg, boolean validParse)
Reports an error message.
-
-
-
Method Detail
-
parsingStarted
public void parsingStarted(java.net.URL source)
Starts parsing.- Specified by:
parsingStarted
in interfaceTreeItemFactory
- Parameters:
source
- The URL of the document being parsed.
-
processDOCTYPE
public void processDOCTYPE(java.lang.String root, java.lang.String publicID, java.lang.String systemID)
Processes a DOCTYPE.- Specified by:
processDOCTYPE
in interfaceTreeItemFactory
- Parameters:
root
- The root tag of the document.publicID
- PublicID from the DOCTYPE.systemID
- SystemID from the DOCTYPE.
-
processPI
public void processPI(HelpSet hs, java.lang.String target, java.lang.String data)
Finds a PI--ignore it.- Specified by:
processPI
in interfaceTreeItemFactory
target
- The target of the PI.data
- A String for the data in the PI.
-
createItem
public TreeItem createItem(java.lang.String tagName, java.util.Hashtable atts, HelpSet hs, java.util.Locale locale)
Create an TOCItem with the given data.- Specified by:
createItem
in interfaceTreeItemFactory
- Parameters:
tagName
- The TOC type to create. Valid types are "tocitem". Null or invalid types will throw an IllegalArgumentExceptionatts
- Attributes of the Item. Valid attributes are "target", "image", and "text". A null atts is valid and means no attributeshs
- HelpSet this item was created under.locale
- Locale of this item. A null locale is valid.- Returns:
- A TreeItem.
- Throws:
IllegalArgumentExcetpion
- if tagname is null or invalid.
-
createItem
public TreeItem createItem()
Creates a default TOCItem.- Specified by:
createItem
in interfaceTreeItemFactory
- Returns:
- A TreeItem
-
reportMessage
public void reportMessage(java.lang.String msg, boolean validParse)
Reports an error message.- Specified by:
reportMessage
in interfaceTreeItemFactory
- Parameters:
msg
- The message to report.validParse
- Whether the result of the parse is still valid.
-
listMessages
public java.util.Enumeration listMessages()
Lists all the error messages.- Specified by:
listMessages
in interfaceTreeItemFactory
-
parsingEnded
public javax.swing.tree.DefaultMutableTreeNode parsingEnded(javax.swing.tree.DefaultMutableTreeNode node)
Ends parsing. Last chance to do something to the node.- Specified by:
parsingEnded
in interfaceTreeItemFactory
- Parameters:
node
- The DefaultMutableTreeNode that has been built during the the parsing. If node is null or there were parsing errors a null is returned.
-
-