Class
XMLSourceView |
Shows an XML document. Recognizes the following XML token types: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Each token type has a foreground color and font. The default color/font settings can be changed by the user. Takes as input an org.w3c.dom.Document object. |
Fields
inputDOMDocument, jScrollPane, jTextPane, xmlStyledDocument |
|
Constructors
XMLSourceView() |
The class constructor. Creates an object of type XMLSourceView. |
Methods
fontGet(AttributeSet) |
Extracts and returns the font from a given attributeset. Parameters: attributeset - The source Attributeset. Returns: The extracted Font. |
fontSet(MutableAttributeSet, Font) |
Sets the mutableattributeset font. Parameters: mutableattributeset - The mutableattributeset to update, font - The new Font for the mutableattributeset. |
getAttributeNameFont() |
Returns the Attribute Value font. Returns: The Font object. |
getAttributeNameForeground() |
Returns the Attribute Name foreground color. Returns: The Color object. |
getAttributeValueFont() |
Returns the Attribute Value font. Returns: The Font object. |
getAttributeValueForeground() |
public java.awt.Color getAttributeValueForeground() Returns the Attribute Value foreground color. Returns: The Color object. |
getBackground() |
public java.awt.Color getBackground() Returns the background color.Overrides: java.awt.Component.getBackground() in class java.awt.Component Returns: The Color object. |
getCDATAFont() |
public java.awt.Font getCDATAFont() Returns the CDATA font. Returns: The Font object. |
getCDATAForeground() |
public java.awt.Color getCDATAForeground() Returns the CDATA foreground color. Returns: The Color object. |
getCommentDataFont() |
public java.awt.Font getCommentDataFont() Returns the Comment Data font. Returns: The Font object. |
getCommentDataForeground() |
public java.awt.Color getCommentDataForeground() Returns the Comment Data foreground color.Returns: The Color object |
getEditedText() |
public java.lang.String getEditedText() Returns the edited text. Returns: The String object containing the edited text. |
getJTextPane() |
public javax.swing.JTextPane getJTextPane() Returns the viewer JTextPane component. Returns: The JTextPane object used by XMLSourceViewer |
getMinimumSize() |
public java.awt.Dimension getMinimumSize() Returns the XMLSourceView minimal size. Overrides: javax.swing.JComponent.getMinimumSize() in class javax.swing.JComponent Returns: The Dimension object containing the XMLSourceView minimum size. |
getNodeAtOffset(int) |
public org.w3c.dom.Node getNodeAtOffset(int i) Returns the XML node at a given offset. Parameters: i - The node offset. Returns: The Node object from offset i. |
getPCDATAFont() |
public java.awt.Font getPCDATAFont() Returns the PCDATA font. Returns: The Font object. |
getPCDATAForeground() |
public java.awt.Color getPCDATAForeground() Returns the PCDATA foreground color. Returns: The Color object. |
getPIDataFont() |
public java.awt.Font getPIDataFont() Returns the PI Data font. Returns: The Font object |
getPIDataForeground() |
public java.awt.Color getPIDataForeground() Returns the PI Data foreground color. Returns: The Color object. |
getPINameFont() |
public java.awt.Font getPINameFont() Returns the PI Name font. Returns: The Font object. |
getPINameForeground() |
public java.awt.Color getPINameForeground() Returns the PI Data foreground color. Returns: The Color object. |
getSymbolFont() |
public java.awt.Font getSymbolFont() Returns the NOTATION Symbol font. Returns: The Font object. |
getSymbolForeground() |
public java.awt.Color getSymbolForeground() Returns the NOTATION Symbol foreground color.Returns: The Color object. |
getTagFont() |
public java.awt.Font getTagFont() Returns the Tag font. Returns: The Font object. |
getTagForeground() |
public java.awt.Color getTagForeground() Returns the Tag foreground color. Returns: The Color object. |
getText() |
public java.lang.String getText() Returns the XML document as a String. Returns: The String object containing the XML document. |
isEditable() |
public boolean isEditable() Returns boolean to indicate whether this object is editable. |
selectNodeAt(int) |
public void selectNodeAt(int i) Moves the cursor to XML Node at offset i. Parameters: i - The node offset. |
setAttributeNameFont(Font) |
public void setAttributeNameFont(java.awt.Font font) Sets the Attribute Name font. Parameters: font - The new Font for Attribute Name. |
setAttributeNameForeground(Color) |
public void setAttributeNameForeground(java.awt.Color color) Sets the Attribute Name foreground color.Parameters: color - The new Color for Attribute Name. |
setAttributeValueFont(Font) |
public void setAttributeValueFont(java.awt.Font font) Sets the Attribute Value font. Parameters: font - The new Font for Attribute Value. |
setAttributeValueForeground(Color) |
public void setAttributeValueForeground(java.awt.Color color) Sets the Attribute Value foreground color. Parameters: color - The new Color for Attribute Value. |
setBackground(Color) |
public void setBackground(java.awt.Color color) Sets the background color. Overrides: javax.swing.JComponent.setBackground(java.awt.Color) in class javax.swing.JComponent Parameters: color - The new background Color. |
setCDATAFont(Font) |
public void setCDATAFont(java.awt.Font font) Sets the CDATA font. Parameters: font - The new Font for CDATA. |
setCDATAForeground(Color) |
public void setCDATAForeground(java.awt.Color color) Sets the CDATA foreground color. Parameters: color - The new Color for CDATA. |
setCommentDataFont(Font) |
public void setCommentDataFont(java.awt.Font font) Sets the Comment font. Parameters: font - The new Font for the XML Comments. |
setCommentDataForeground(Color) |
public void setCommentDataForeground(java.awt.ColoSets the Comment foreground color. Parameters: color - The new Color for Comment.r color) |
setEditable(boolean) |
public void setEditable(boolean edit) Sets the specified boolean to indicate whether this object should be editable. Parameters: doc - The new boolean value. |
setPCDATAFont(Font) |
public void setPCDATAFont(java.awt.Font font) Sets the PCDATA font. Parameters: font - The new Font for PCDATA. |
setPCDATAForeground(Color) |
public void setPCDATAForeground(java.awt.Color color) Sets the PCDATA foreground color. Parameters: color - The new Color for PCDATA. |
setPIDataFont(Font) |
public void setPIDataFont(java.awt.Font font) Sets the PI Data font. Parameters: font - The new Font for PI Data. |
setPIDataForeground(Color) |
public void setPIDataForeground(java.awt.Color color) Sets the PI Data foreground color. Parameters: color - The new Color for PI Data. |
setPINameFont(Font) |
public void setPINameFont(java.awt.Font font) Sets the PI Name font. Parameters: font - The new Font for the PI Names. |
setPINameForeground(Color) |
public void setPINameForeground(java.awt.Color color) Sets the PI Name foreground color. Parameters: color - The new Color for PI Name. |
setSelectedNode(Node) |
public void setSelectedNode(org.w3c.dom.Node node) Sets the cursor position at the selected XML node. Parameters: node - The selected node. |
setSymbolFont(Font) |
public void setSymbolFont(java.awt.Font font) Sets the NOTATION Symbol font. Parameters: color - The new Font for NOTATION Symbol. |
setSymbolForeground(Color) |
public void setSymbolForeground(java.awt.Color color) Sets the NOTATION Symbol foreground color. Parameters: color - The new Color for NOTATION Symbol. |
setTagFont(Font) |
public void setTagFont(java.awt.Font font) Sets the Tag font. Parameters: font - The new Font for the XML Tags. |
setTagForeground(Color) |
public void setTagForeground(java.awt.Color color) Sets the Tag foreground color. Parameters: color - The new Color for the XML Tags. |
setXMLDocument(Document) |
public void setXMLDocument(org.w3c.dom.Document document) Associates the XMLviewer with a XML document. Parameters: doc - The Document document to display. See Also: getText() |