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.
-
inputDOMDocument
-
-
jScrollPane
-
-
jTextPane
-
-
xmlStyledDocument
-
-
XMLSourceView()
- The class constructor.
-
fontGet(AttributeSet)
- Extracts and returns the font from a given attributeset.
-
fontSet(MutableAttributeSet, Font)
- Sets the mutableattributeset font.
-
getAttributeNameFont()
- Returns the Attribute Value font.
-
getAttributeNameForeground()
- Returns the Attribute Name foreground color.
-
getAttributeValueFont()
- Returns the Attribute Value font.
-
getAttributeValueForeground()
- Returns the Attribute Value foreground color.
-
getBackground()
- Returns the background color.
-
getCDATAFont()
- Returns the CDATA font.
-
getCDATAForeground()
- Returns the CDATA foreground color.
-
getCommentDataFont()
- Returns the Comment Data font.
-
getCommentDataForeground()
- Returns the Comment Data foreground color.
-
getEditedText()
- Returns the edited text.
-
getJTextPane()
- Returns the viewer
JTextPane
component.
-
getMinimumSize()
- Returns the XMLSourceView minimal size.
-
getNodeAtOffset(int)
- Returns the XML node at a given offset.
-
getPCDATAFont()
- Returns the PCDATA font.
-
getPCDATAForeground()
- Returns the PCDATA foreground color.
-
getPIDataFont()
- Returns the PI Data font.
-
getPIDataForeground()
- Returns the PI Data foreground color.
-
getPINameFont()
- Returns the PI Name font.
-
getPINameForeground()
- Returns the PI Data foreground color.
-
getSymbolFont()
- Returns the NOTATION Symbol font.
-
getSymbolForeground()
- Returns the NOTATION Symbol foreground color.
-
getTagFont()
- Returns the Tag font.
-
getTagForeground()
- Returns the Tag foreground color.
-
getText()
- Returns the XML document as a String.
-
isEditable()
- Returns boolean to indicate whether this object is editable.
-
selectNodeAt(int)
- Moves the cursor to XML Node at offset
i
.
-
setAttributeNameFont(Font)
- Sets the Attribute Name font.
-
setAttributeNameForeground(Color)
- Sets the Attribute Name foreground color.
-
setAttributeValueFont(Font)
- Sets the Attribute Value font.
-
setAttributeValueForeground(Color)
- Sets the Attribute Value foreground color.
-
setBackground(Color)
- Sets the background color.
-
setCDATAFont(Font)
- Sets the CDATA font.
-
setCDATAForeground(Color)
- Sets the CDATA foreground color.
-
setCommentDataFont(Font)
- Sets the Comment font.
-
setCommentDataForeground(Color)
- Sets the Comment foreground color.
-
setEditable(boolean)
- Sets the specified boolean to indicate whether this object should be editable.
-
setPCDATAFont(Font)
- Sets the PCDATA font.
-
setPCDATAForeground(Color)
- Sets the PCDATA foreground color.
-
setPIDataFont(Font)
- Sets the PI Data font.
-
setPIDataForeground(Color)
- Sets the PI Data foreground color.
-
setPINameFont(Font)
- Sets the PI Name font.
-
setPINameForeground(Color)
- Sets the PI Name foreground color.
-
setSelectedNode(Node)
- Sets the cursor position at the selected XML node.
-
setSymbolFont(Font)
- Sets the NOTATION Symbol font.
-
setSymbolForeground(Color)
- Sets the NOTATION Symbol foreground color.
-
setTagFont(Font)
- Sets the Tag font.
-
setTagForeground(Color)
- Sets the Tag foreground color.
-
setXMLDocument(Document)
- Associates the XMLviewer with a XML document.
jTextPane
protected JTextPane jTextPane
jScrollPane
protected JScrollPane jScrollPane
inputDOMDocument
protected Document inputDOMDocument
xmlStyledDocument
protected XMLStyledDocument xmlStyledDocument
XMLSourceView
public XMLSourceView()
- The class constructor.
Creates an object of type
XMLSourceView
.
getAttributeNameFont
public Font getAttributeNameFont()
- Returns the Attribute Value font.
- Returns:
- The
Font
object.
getAttributeNameForeground
public Color getAttributeNameForeground()
- Returns the Attribute Name foreground color.
- Returns:
- The
Color
object.
getAttributeValueFont
public Font getAttributeValueFont()
- Returns the Attribute Value font.
- Returns:
- The
Font
object.
getAttributeValueForeground
public Color getAttributeValueForeground()
- Returns the Attribute Value foreground color.
- Returns:
- The
Color
object.
getBackground
public Color getBackground()
- Returns the background color.
- Returns:
- The
Color
object.
- Overrides:
- getBackground in class Component
getCDATAFont
public Font getCDATAFont()
- Returns the CDATA font.
- Returns:
- The
Font
object.
getCDATAForeground
public Color getCDATAForeground()
- Returns the CDATA foreground color.
- Returns:
- The
Color
object.
getCommentDataFont
public Font getCommentDataFont()
- Returns the Comment Data font.
- Returns:
- The
Font
object.
getCommentDataForeground
public Color getCommentDataForeground()
- Returns the Comment Data foreground color.
- Returns:
- The
Color
object.
getJTextPane
public JTextPane getJTextPane()
- Returns the viewer
JTextPane
component.
- Returns:
- The
JTextPane
object used by XMLSourceViewer
getMinimumSize
public Dimension getMinimumSize()
- Returns the XMLSourceView minimal size.
- Returns:
- The
Dimension
object containing
the XMLSourceView minimum size.
- Overrides:
- getMinimumSize in class JComponent
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
.
getPCDATAFont
public Font getPCDATAFont()
- Returns the PCDATA font.
- Returns:
- The
Font
object.
getPCDATAForeground
public Color getPCDATAForeground()
- Returns the PCDATA foreground color.
- Returns:
- The
Color
object.
getPIDataFont
public Font getPIDataFont()
- Returns the PI Data font.
- Returns:
- The
Font
object
getPIDataForeground
public Color getPIDataForeground()
- Returns the PI Data foreground color.
- Returns:
- The
Color
object.
getPINameFont
public Font getPINameFont()
- Returns the PI Name font.
- Returns:
- The
Font
object.
getPINameForeground
public Color getPINameForeground()
- Returns the PI Data foreground color.
- Returns:
- The
Color
object.
getText
public String getText()
- Returns the XML document as a String.
- Returns:
- The
String
object containing the XML document.
getEditedText
public String getEditedText()
- Returns the edited text.
- Returns:
- The
String
object containing the edited text.
getSymbolFont
public Font getSymbolFont()
- Returns the NOTATION Symbol font.
- Returns:
- The
Font
object.
getSymbolForeground
public Color getSymbolForeground()
- Returns the NOTATION Symbol foreground color.
- Returns:
- The
Color
object.
getTagFont
public Font getTagFont()
- Returns the Tag font.
- Returns:
- The
Font
object.
getTagForeground
public Color getTagForeground()
- Returns the Tag foreground color.
- Returns:
- The
Color
object.
selectNodeAt
public void selectNodeAt(int i) throws BadLocationException
- Moves the cursor to XML Node at offset
i
.
- Parameters:
- i - The node offset.
setAttributeNameFont
public void setAttributeNameFont(Font font) throws IllegalArgumentException
- Sets the Attribute Name font.
- Parameters:
- font - The new
Font
for Attribute Name.
setAttributeNameForeground
public void setAttributeNameForeground(Color color) throws IllegalArgumentException
- Sets the Attribute Name foreground color.
- Parameters:
- color - The new
Color
for Attribute Name.
setAttributeValueFont
public void setAttributeValueFont(Font font) throws IllegalArgumentException
- Sets the Attribute Value font.
- Parameters:
- font - The new
Font
for Attribute Value.
setAttributeValueForeground
public void setAttributeValueForeground(Color color) throws IllegalArgumentException
- Sets the Attribute Value foreground color.
- Parameters:
- color - The new
Color
for Attribute Value.
setBackground
public void setBackground(Color color)
- Sets the background color.
- Parameters:
- color - The new background
Color
.
- Overrides:
- setBackground in class JComponent
setCDATAFont
public void setCDATAFont(Font font) throws IllegalArgumentException
- Sets the CDATA font.
- Parameters:
- font - The new
Font
for CDATA.
setCDATAForeground
public void setCDATAForeground(Color color) throws IllegalArgumentException
- Sets the CDATA foreground color.
- Parameters:
- color - The new
Color
for CDATA.
setCommentDataFont
public void setCommentDataFont(Font font) throws IllegalArgumentException
- Sets the Comment font.
- Parameters:
- font - The new
Font
for the XML Comments.
setCommentDataForeground
public void setCommentDataForeground(Color color) throws IllegalArgumentException
- Sets the Comment foreground color.
- Parameters:
- color - The new
Color
for Comment.
setEditable
public void setEditable(boolean edit)
- Sets the specified boolean to indicate whether this object should be editable.
- Parameters:
- doc - The new
boolean
value.
isEditable
public boolean isEditable()
- Returns boolean to indicate whether this object is editable.
setXMLDocument
public void setXMLDocument(Document document)
- Associates the XMLviewer with a XML document.
- Parameters:
- doc - The
Document
document to display.
- See Also:
- getText
setPCDATAFont
public void setPCDATAFont(Font font) throws IllegalArgumentException
- Sets the PCDATA font.
- Parameters:
- font - The new
Font
for PCDATA.
setPCDATAForeground
public void setPCDATAForeground(Color color) throws IllegalArgumentException
- Sets the PCDATA foreground color.
- Parameters:
- color - The new
Color
for PCDATA.
setPIDataFont
public void setPIDataFont(Font font) throws IllegalArgumentException
- Sets the PI Data font.
- Parameters:
- font - The new
Font
for PI Data.
setPIDataForeground
public void setPIDataForeground(Color color) throws IllegalArgumentException
- Sets the PI Data foreground color.
- Parameters:
- color - The new
Color
for PI Data.
setPINameFont
public void setPINameFont(Font font) throws IllegalArgumentException
- Sets the PI Name font.
- Parameters:
- font - The new
Font
for the PI Names.
setPINameForeground
public void setPINameForeground(Color color) throws IllegalArgumentException
- Sets the PI Name foreground color.
- Parameters:
- color - The new
Color
for PI Name.
setSelectedNode
public void setSelectedNode(Node node)
- Sets the cursor position at the selected XML node.
- Parameters:
- node - The selected node.
setSymbolFont
public void setSymbolFont(Font font) throws IllegalArgumentException
- Sets the NOTATION Symbol font.
- Parameters:
- color - The new
Font
for NOTATION Symbol.
setSymbolForeground
public void setSymbolForeground(Color color) throws IllegalArgumentException
- Sets the NOTATION Symbol foreground color.
- Parameters:
- color - The new
Color
for NOTATION Symbol.
setTagFont
public void setTagFont(Font font) throws IllegalArgumentException
- Sets the Tag font.
- Parameters:
- font - The new
Font
for the XML Tags.
setTagForeground
public void setTagForeground(Color color) throws IllegalArgumentException
- Sets the Tag foreground color.
- Parameters:
- color - The new
Color
for the XML Tags.
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
.
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