Oracle9i Supplied Java Packages Reference Release 2 (9.2) Part Number A96609-01 |
|
This chapter describes package oracle.xml.srcviewer for, which contains the XMLSourceView bean.
The Oracle XML Transviewer Beans are provided as part of Oracle9i XDK for Java Beans. XML Transviewer Beans facilitate the addition of graphical or visual interfaces to your XML applications.
This chaper contains these sections:
The classes in oracle.xml.srcviewer implement the XMLSourceView bean for displaying the attributes and source for an XML document. The XMLSourceView bean presents a visual interface for XML documents for easier editing. It enables the display of XML and XSL formatted files with color syntax highlighting when modifying an XML document with a text editor. This helps view and edit the files. It can be integrated with DOMBuilder bean, and allows pre- or post-parsing visualization and validation against a specified DTD. Information about developing applications using Oracle XML Transviewer Java Beans can be found in the Oracle resources listed here under See Also.
Class | Description |
---|---|
Shows an XML document. |
|
Extends |
public class XMLSourceView extends javax.swing.JPanel implements java.io.Serializable java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.srcviewer.XMLSourceView
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.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 setting. The default color and font settings can be changed by the user. Takes as input an org.w3c.dom.Document
object.
protected org.w3c.dom.Document inputDOMDocument
protected javax.swing.JScrollPane jScrollPane
protected javax.swing.JTextPane jTextPane
protected oracle.xml.srcviewer.XMLStyledDocument xmlStyledDocument
public XMLSourceView()
The class constructor. Creates an object of type XMLSourceView.
public static java.awt.Font fontGet(javax.swing.text.AttributeSet attributeset)
Extracts and returns the font from a given attributeset.
attributeset
- The source Attributeset
.
The extracted Font
.
public static void fontSet(javax.swing.text.MutableAttributeSet mutableattributeset, java.awt.Font font)
Sets the mutableattributeset font.
mutableattributeset
- The mutableattributeset
to update.
font
- The new Font
for the mutableattributeset.
public java.awt.Font getAttributeNameFont()
Returns the Attribute Value font.
The Font
object.
public java.awt.Color getAttributeNameForeground()
Returns the Attribute Name foreground color.
The Color
object.
public java.awt.Font getAttributeValueFont()
Returns the Attribute Value font.
The Font object.
public java.awt.Color getAttributeValueForeground()
Returns the Attribute Value foreground color.
The Color object.
public java.awt.Color getBackground()
Returns the background color.
java.awt.Component.getBackground() in class java.awt.Component
The Color
object.
public java.awt.Font getCDATAFont()
Returns the CDATA font.
The Font
object.
public java.awt.Color getCDATAForeground()
Returns the CDATA foreground color.
The Color
object.
public java.awt.Font getCommentDataFont()
Returns the Comment Data font.
The Font
object.
public java.awt.Color getCommentDataForeground()
Returns the Comment Data foreground color.
The Color
object.
public java.lang.String getEditedText()
Returns the edited text.
The String
object containing the edited text.
public javax.swing.JTextPane getJTextPane()
Returns the viewer JTextPane
component.
The JTextPane
object used by XMLSourceViewer
public java.awt.Dimension getMinimumSize()
Returns the XMLSourceView minimal size.
javax.swing.JComponent.getMinimumSize() in class javax.swing.JComponent
The Dimension
object containing the XMLSourceView minimum size.
public org.w3c.dom.Node getNodeAtOffset(int i)
Returns the XML node at a given offset.
i
- The node offset.
The Node
object from offset i
.
public java.awt.Font getPCDATAFont()
Returns the PCDATA font.
The Font
object.
public java.awt.Color getPCDATAForeground()
Returns the PCDATA foreground color.
The Color
object.
public java.awt.Font getPIDataFont()
Returns the PI Data font.
The Font
object
public java.awt.Color getPIDataForeground()
Returns the PI Data foreground color.
The Color
object.
public java.awt.Font getPINameFont()
Returns the PI Name font.
The Font
object.
public java.awt.Color getPINameForeground()
Returns the PI Data foreground color.
The Color
object.
public java.awt.Font getSymbolFont()
Returns the NOTATION Symbol font.
The Font
object.
public java.awt.Color getSymbolForeground()
Returns the NOTATION Symbol foreground color.
The Color
object.
public java.awt.Font getTagFont()
Returns the Tag font.
The Font
object.
public java.awt.Color getTagForeground()
Returns the Tag foreground color.
The Color
object.
public java.lang.String getText()
Returns the XML document as a String.
The String
object containing the XML document.
public boolean isEditable()
Returns boolean to indicate whether this object is editable.
public void selectNodeAt(int i)
Moves the cursor to XML Node at offset i
.
i
- The node offset.
public void setAttributeNameFont(java.awt.Font font)
Sets the Attribute Name font.
font
- The new Font
for Attribute Name.
public void setAttributeNameForeground(java.awt.Color color)
Sets the Attribute Name foreground color.
color
- The new Color
for Attribute Name.
public void setAttributeValueFont(java.awt.Font font)
Sets the Attribute Value font.
font
- The new Font
for Attribute Value.
public void setAttributeValueForeground(java.awt.Color color)
Sets the Attribute Value foreground color.
color
- The new Color
for Attribute Value.
public void setBackground(java.awt.Color color)
Sets the background color.
javax.swing.JComponent.setBackground(java.awt.Color) in class javax.swing.JComponent
color
- The new background Color
.
public void setCDATAFont(java.awt.Font font)
Sets the CDATA font.
font
- The new Font
for CDATA.
public void setCDATAForeground(java.awt.Color color)
Sets the CDATA foreground color.
color
- The new Color
for CDATA.
public void setCommentDataFont(java.awt.Font font)
Sets the Comment font.
font
- The new Font
for the XML Comments.
public void setCommentDataForeground(java.awt.Color color)
Sets the Comment foreground color.
color
- The new Color
for Comment.
public void setEditable(boolean edit)
Sets the specified boolean to indicate whether this object should be editable.
doc
- The new boolean
value.
public void setPCDATAFont(java.awt.Font font)
Sets the PCDATA font.
font
- The new Font
for PCDATA.
public void setPCDATAForeground(java.awt.Color color)
Sets the PCDATA foreground color.
color
- The new Color
for PCDATA.
public void setPIDataFont(java.awt.Font font)
Sets the PI Data font.
font
- The new Font
for PI Data.
public void setPIDataForeground(java.awt.Color color)
Sets the PI Data foreground color.
color
- The new Color
for PI Data.
public void setPINameFont(java.awt.Font font)
Sets the PI Name font.
font
- The new Font
for the PI Names.
public void setPINameForeground(java.awt.Color color)
Sets the PI Name foreground color.
color
- The new Color
for PI Name.
public void setSelectedNode(org.w3c.dom.Node node)
Sets the cursor position at the selected XML node.
node
- The selected node.
public void setSymbolFont(java.awt.Font font)
Sets the NOTATION Symbol font.
color
- The new Font
for NOTATION Symbol.
public void setSymbolForeground(java.awt.Color color)
Sets the NOTATION Symbol foreground color.
color
- The new Color
for NOTATION Symbol.
public void setTagFont(java.awt.Font font)
Sets the Tag font.
font
- The new Font
for the XML Tags.
public void setTagForeground(java.awt.Color color)
Sets the Tag foreground color.
color
- The new Color
for the XML Tags.
public void setXMLDocument(org.w3c.dom.Document document)
Associates the XMLviewer with a XML document.
doc
- The Document
document to display.
public class XMLSourceViewBeanInfo extends java.beans.SimpleBeanInfo java.lang.Object | +--java.beans.SimpleBeanInfo | +--oracle.xml.srcviewer.XMLSourceViewBeanInfo
java.beans.BeanInfo
public XMLSourceViewBeanInfo()
public java.awt.Image getIcon(int iconKind)
java.beans.SimpleBeanInfo.getIcon(int) in class java.beans.SimpleBeanInfo
public java.beans.PropertyDescriptor[] getPropertyDescriptors()
java.beans.SimpleBeanInfo.getPropertyDescriptors() in class java.beans.SimpleBeanInfo
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|