All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.xml.srcviewer.XMLSourceView

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JPanel
                                   |
                                   +----oracle.xml.srcviewer.XMLSourceView

public class XMLSourceView
extends JPanel
implements Serializable
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.


Variable Index

 o inputDOMDocument
 o jScrollPane
 o jTextPane
 o xmlStyledDocument

Constructor Index

 o XMLSourceView()
The class constructor.

Method Index

 o fontGet(AttributeSet)
Extracts and returns the font from a given attributeset.
 o fontSet(MutableAttributeSet, Font)
Sets the mutableattributeset font.
 o getAttributeNameFont()
Returns the Attribute Value font.
 o getAttributeNameForeground()
Returns the Attribute Name foreground color.
 o getAttributeValueFont()
Returns the Attribute Value font.
 o getAttributeValueForeground()
Returns the Attribute Value foreground color.
 o getBackground()
Returns the background color.
 o getCDATAFont()
Returns the CDATA font.
 o getCDATAForeground()
Returns the CDATA foreground color.
 o getCommentDataFont()
Returns the Comment Data font.
 o getCommentDataForeground()
Returns the Comment Data foreground color.
 o getEditedText()
Returns the edited text.
 o getJTextPane()
Returns the viewer JTextPane component.
 o getMinimumSize()
Returns the XMLSourceView minimal size.
 o getNodeAtOffset(int)
Returns the XML node at a given offset.
 o getPCDATAFont()
Returns the PCDATA font.
 o getPCDATAForeground()
Returns the PCDATA foreground color.
 o getPIDataFont()
Returns the PI Data font.
 o getPIDataForeground()
Returns the PI Data foreground color.
 o getPINameFont()
Returns the PI Name font.
 o getPINameForeground()
Returns the PI Data foreground color.
 o getSymbolFont()
Returns the NOTATION Symbol font.
 o getSymbolForeground()
Returns the NOTATION Symbol foreground color.
 o getTagFont()
Returns the Tag font.
 o getTagForeground()
Returns the Tag foreground color.
 o getText()
Returns the XML document as a String.
 o isEditable()
Returns boolean to indicate whether this object is editable.
 o selectNodeAt(int)
Moves the cursor to XML Node at offset i.
 o setAttributeNameFont(Font)
Sets the Attribute Name font.
 o setAttributeNameForeground(Color)
Sets the Attribute Name foreground color.
 o setAttributeValueFont(Font)
Sets the Attribute Value font.
 o setAttributeValueForeground(Color)
Sets the Attribute Value foreground color.
 o setBackground(Color)
Sets the background color.
 o setCDATAFont(Font)
Sets the CDATA font.
 o setCDATAForeground(Color)
Sets the CDATA foreground color.
 o setCommentDataFont(Font)
Sets the Comment font.
 o setCommentDataForeground(Color)
Sets the Comment foreground color.
 o setEditable(boolean)
Sets the specified boolean to indicate whether this object should be editable.
 o setPCDATAFont(Font)
Sets the PCDATA font.
 o setPCDATAForeground(Color)
Sets the PCDATA foreground color.
 o setPIDataFont(Font)
Sets the PI Data font.
 o setPIDataForeground(Color)
Sets the PI Data foreground color.
 o setPINameFont(Font)
Sets the PI Name font.
 o setPINameForeground(Color)
Sets the PI Name foreground color.
 o setSelectedNode(Node)
Sets the cursor position at the selected XML node.
 o setSymbolFont(Font)
Sets the NOTATION Symbol font.
 o setSymbolForeground(Color)
Sets the NOTATION Symbol foreground color.
 o setTagFont(Font)
Sets the Tag font.
 o setTagForeground(Color)
Sets the Tag foreground color.
 o setXMLDocument(Document)
Associates the XMLviewer with a XML document.

Variables

 o jTextPane
 protected JTextPane jTextPane
 o jScrollPane
 protected JScrollPane jScrollPane
 o inputDOMDocument
 protected Document inputDOMDocument
 o xmlStyledDocument
 protected XMLStyledDocument xmlStyledDocument

Constructors

 o XMLSourceView
 public XMLSourceView()
The class constructor. Creates an object of type XMLSourceView.

Methods

 o getAttributeNameFont
 public Font getAttributeNameFont()
Returns the Attribute Value font.

Returns:
The Font object.
 o getAttributeNameForeground
 public Color getAttributeNameForeground()
Returns the Attribute Name foreground color.

Returns:
The Color object.
 o getAttributeValueFont
 public Font getAttributeValueFont()
Returns the Attribute Value font.

Returns:
The Font object.
 o getAttributeValueForeground
 public Color getAttributeValueForeground()
Returns the Attribute Value foreground color.

Returns:
The Color object.
 o getBackground
 public Color getBackground()
Returns the background color.

Returns:
The Color object.
Overrides:
getBackground in class Component
 o getCDATAFont
 public Font getCDATAFont()
Returns the CDATA font.

Returns:
The Font object.
 o getCDATAForeground
 public Color getCDATAForeground()
Returns the CDATA foreground color.

Returns:
The Color object.
 o getCommentDataFont
 public Font getCommentDataFont()
Returns the Comment Data font.

Returns:
The Font object.
 o getCommentDataForeground
 public Color getCommentDataForeground()
Returns the Comment Data foreground color.

Returns:
The Color object.
 o getJTextPane
 public JTextPane getJTextPane()
Returns the viewer JTextPane component.

Returns:
The JTextPane object used by XMLSourceViewer
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the XMLSourceView minimal size.

Returns:
The Dimension object containing the XMLSourceView minimum size.
Overrides:
getMinimumSize in class JComponent
 o getNodeAtOffset
 public Node getNodeAtOffset(int i) throws BadLocationException
Returns the XML node at a given offset.

Parameters:
i - The node offset.
Returns:
The Node object from offset i.
 o getPCDATAFont
 public Font getPCDATAFont()
Returns the PCDATA font.

Returns:
The Font object.
 o getPCDATAForeground
 public Color getPCDATAForeground()
Returns the PCDATA foreground color.

Returns:
The Color object.
 o getPIDataFont
 public Font getPIDataFont()
Returns the PI Data font.

Returns:
The Font object
 o getPIDataForeground
 public Color getPIDataForeground()
Returns the PI Data foreground color.

Returns:
The Color object.
 o getPINameFont
 public Font getPINameFont()
Returns the PI Name font.

Returns:
The Font object.
 o getPINameForeground
 public Color getPINameForeground()
Returns the PI Data foreground color.

Returns:
The Color object.
 o getText
 public String getText()
Returns the XML document as a String.

Returns:
The String object containing the XML document.
 o getEditedText
 public String getEditedText()
Returns the edited text.

Returns:
The String object containing the edited text.
 o getSymbolFont
 public Font getSymbolFont()
Returns the NOTATION Symbol font.

Returns:
The Font object.
 o getSymbolForeground
 public Color getSymbolForeground()
Returns the NOTATION Symbol foreground color.

Returns:
The Color object.
 o getTagFont
 public Font getTagFont()
Returns the Tag font.

Returns:
The Font object.
 o getTagForeground
 public Color getTagForeground()
Returns the Tag foreground color.

Returns:
The Color object.
 o selectNodeAt
 public void selectNodeAt(int i) throws BadLocationException
Moves the cursor to XML Node at offset i.

Parameters:
i - The node offset.
 o setAttributeNameFont
 public void setAttributeNameFont(Font font) throws IllegalArgumentException
Sets the Attribute Name font.

Parameters:
font - The new Font for Attribute Name.
 o setAttributeNameForeground
 public void setAttributeNameForeground(Color color) throws IllegalArgumentException
Sets the Attribute Name foreground color.

Parameters:
color - The new Color for Attribute Name.
 o setAttributeValueFont
 public void setAttributeValueFont(Font font) throws IllegalArgumentException
Sets the Attribute Value font.

Parameters:
font - The new Font for Attribute Value.
 o setAttributeValueForeground
 public void setAttributeValueForeground(Color color) throws IllegalArgumentException
Sets the Attribute Value foreground color.

Parameters:
color - The new Color for Attribute Value.
 o setBackground
 public void setBackground(Color color)
Sets the background color.

Parameters:
color - The new background Color.
Overrides:
setBackground in class JComponent
 o setCDATAFont
 public void setCDATAFont(Font font) throws IllegalArgumentException
Sets the CDATA font.

Parameters:
font - The new Font for CDATA.
 o setCDATAForeground
 public void setCDATAForeground(Color color) throws IllegalArgumentException
Sets the CDATA foreground color.

Parameters:
color - The new Color for CDATA.
 o setCommentDataFont
 public void setCommentDataFont(Font font) throws IllegalArgumentException
Sets the Comment font.

Parameters:
font - The new Font for the XML Comments.
 o setCommentDataForeground
 public void setCommentDataForeground(Color color) throws IllegalArgumentException
Sets the Comment foreground color.

Parameters:
color - The new Color for Comment.
 o setEditable
 public void setEditable(boolean edit)
Sets the specified boolean to indicate whether this object should be editable.

Parameters:
doc - The new boolean value.
 o isEditable
 public boolean isEditable()
Returns boolean to indicate whether this object is editable.

 o setXMLDocument
 public void setXMLDocument(Document document)
Associates the XMLviewer with a XML document.

Parameters:
doc - The Document document to display.
See Also:
getText
 o setPCDATAFont
 public void setPCDATAFont(Font font) throws IllegalArgumentException
Sets the PCDATA font.

Parameters:
font - The new Font for PCDATA.
 o setPCDATAForeground
 public void setPCDATAForeground(Color color) throws IllegalArgumentException
Sets the PCDATA foreground color.

Parameters:
color - The new Color for PCDATA.
 o setPIDataFont
 public void setPIDataFont(Font font) throws IllegalArgumentException
Sets the PI Data font.

Parameters:
font - The new Font for PI Data.
 o setPIDataForeground
 public void setPIDataForeground(Color color) throws IllegalArgumentException
Sets the PI Data foreground color.

Parameters:
color - The new Color for PI Data.
 o setPINameFont
 public void setPINameFont(Font font) throws IllegalArgumentException
Sets the PI Name font.

Parameters:
font - The new Font for the PI Names.
 o setPINameForeground
 public void setPINameForeground(Color color) throws IllegalArgumentException
Sets the PI Name foreground color.

Parameters:
color - The new Color for PI Name.
 o setSelectedNode
 public void setSelectedNode(Node node)
Sets the cursor position at the selected XML node.

Parameters:
node - The selected node.
 o setSymbolFont
 public void setSymbolFont(Font font) throws IllegalArgumentException
Sets the NOTATION Symbol font.

Parameters:
color - The new Font for NOTATION Symbol.
 o setSymbolForeground
 public void setSymbolForeground(Color color) throws IllegalArgumentException
Sets the NOTATION Symbol foreground color.

Parameters:
color - The new Color for NOTATION Symbol.
 o setTagFont
 public void setTagFont(Font font) throws IllegalArgumentException
Sets the Tag font.

Parameters:
font - The new Font for the XML Tags.
 o setTagForeground
 public void setTagForeground(Color color) throws IllegalArgumentException
Sets the Tag foreground color.

Parameters:
color - The new Color for the XML Tags.
 o fontGet
 public static Font fontGet(AttributeSet attributeset)
Extracts and returns the font from a given attributeset.

Parameters:
attributeset - The source Attributeset.
Returns:
The extracted Font.
 o fontSet
 public static void fontSet(MutableAttributeSet mutableattributeset,
                            Font font)
Sets the mutableattributeset font.

Parameters:
mutableattributeset - The mutableattributeset to update.
font - The new Font for the mutableattributeset.

All Packages  Class Hierarchy  This Package  Previous  Next  Index