|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--oracle.xml.srcviewer.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.
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Field Summary | |
protected Document |
inputDOMDocument
|
protected javax.swing.JScrollPane |
jScrollPane
|
protected javax.swing.JTextPane |
jTextPane
|
protected oracle.xml.srcviewer.XMLStyledDocument |
xmlStyledDocument
|
Fields inherited from class javax.swing.JComponent |
accessibleContext,
listenerList,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
LEFT_ALIGNMENT,
RIGHT_ALIGNMENT,
TOP_ALIGNMENT |
Constructor Summary | |
XMLSourceView()
The class constructor. |
Method Summary | |
static java.awt.Font |
fontGet(javax.swing.text.AttributeSet attributeset)
Extracts and returns the font from a given attributeset. |
static void |
fontSet(javax.swing.text.MutableAttributeSet mutableattributeset,
java.awt.Font font)
Sets the mutableattributeset font. |
java.awt.Font |
getAttributeNameFont()
Returns the Attribute Value font. |
java.awt.Color |
getAttributeNameForeground()
Returns the Attribute Name foreground color. |
java.awt.Font |
getAttributeValueFont()
Returns the Attribute Value font. |
java.awt.Color |
getAttributeValueForeground()
Returns the Attribute Value foreground color. |
java.awt.Color |
getBackground()
Returns the background color. |
java.awt.Font |
getCDATAFont()
Returns the CDATA font. |
java.awt.Color |
getCDATAForeground()
Returns the CDATA foreground color. |
java.awt.Font |
getCommentDataFont()
Returns the Comment Data font. |
java.awt.Color |
getCommentDataForeground()
Returns the Comment Data foreground color. |
java.awt.Font |
getDTDFont()
Returns the DTD reference font. |
java.awt.Color |
getDTDForeground()
Returns the DTD reference foreground color. |
java.awt.Font |
getDTDInternalFont()
Returns the internal DTD font. |
java.awt.Color |
getDTDInternalForeground()
Returns the internal DTD reference foreground color. |
java.lang.String |
getEditedText()
Returns the edited text. |
javax.swing.JTextPane |
getJTextPane()
Returns the viewer JTextPane component. |
java.awt.Dimension |
getMinimumSize()
Returns the XMLSourceView minimal size. |
Node |
getNodeAtOffset(int i)
Returns the XML node at a given offset. |
java.awt.Font |
getPCDATAFont()
Returns the PCDATA font. |
java.awt.Color |
getPCDATAForeground()
Returns the PCDATA foreground color. |
java.awt.Font |
getPIDataFont()
Returns the PI Data font. |
java.awt.Color |
getPIDataForeground()
Returns the PI Data foreground color. |
java.awt.Font |
getPINameFont()
Returns the PI Name font. |
java.awt.Color |
getPINameForeground()
Returns the PI Data foreground color. |
java.awt.Font |
getSymbolFont()
Returns the NOTATION Symbol font. |
java.awt.Color |
getSymbolForeground()
Returns the NOTATION Symbol foreground color. |
java.awt.Font |
getTagFont()
Returns the Tag font. |
java.awt.Color |
getTagForeground()
Returns the Tag foreground color. |
java.lang.String |
getText()
Returns the XML document as a String. |
boolean |
isEditable()
Returns boolean to indicate whether this object is editable. |
void |
selectNodeAt(int i)
Moves the cursor to XML Node at offset i . |
void |
setAttributeNameFont(java.awt.Font font)
Sets the Attribute Name font. |
void |
setAttributeNameForeground(java.awt.Color color)
Sets the Attribute Name foreground color. |
void |
setAttributeValueFont(java.awt.Font font)
Sets the Attribute Value font. |
void |
setAttributeValueForeground(java.awt.Color color)
Sets the Attribute Value foreground color. |
void |
setBackground(java.awt.Color color)
Sets the background color. |
void |
setCDATAFont(java.awt.Font font)
Sets the CDATA font. |
void |
setCDATAForeground(java.awt.Color color)
Sets the CDATA foreground color. |
void |
setCommentDataFont(java.awt.Font font)
Sets the Comment font. |
void |
setCommentDataForeground(java.awt.Color color)
Sets the Comment foreground color. |
void |
setDTDFont(java.awt.Font font)
Sets the DTD reference font. |
void |
setDTDForeground(java.awt.Color color)
Sets the DTD reference foreground color. |
void |
setDTDInternalFont(java.awt.Font font)
Sets the internal DTD font. |
void |
setDTDInternalForeground(java.awt.Color color)
Sets the internal DTD foreground color. |
void |
setEditable(boolean edit)
Sets the specified boolean to indicate whether this object should be editable. |
void |
setPCDATAFont(java.awt.Font font)
Sets the PCDATA font. |
void |
setPCDATAForeground(java.awt.Color color)
Sets the PCDATA foreground color. |
void |
setPIDataFont(java.awt.Font font)
Sets the PI Data font. |
void |
setPIDataForeground(java.awt.Color color)
Sets the PI Data foreground color. |
void |
setPINameFont(java.awt.Font font)
Sets the PI Name font. |
void |
setPINameForeground(java.awt.Color color)
Sets the PI Name foreground color. |
void |
setSelectedNode(Node node)
Sets the cursor position at the selected XML node. |
void |
setSymbolFont(java.awt.Font font)
Sets the NOTATION Symbol font. |
void |
setSymbolForeground(java.awt.Color color)
Sets the NOTATION Symbol foreground color. |
void |
setTagFont(java.awt.Font font)
Sets the Tag font. |
void |
setTagForeground(java.awt.Color color)
Sets the Tag foreground color. |
void |
setXMLDocument(Document document)
Associates the XMLviewer with a XML document. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
printComponents,
processContainerEvent,
processEvent,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected javax.swing.JTextPane jTextPane
protected javax.swing.JScrollPane jScrollPane
protected Document inputDOMDocument
protected oracle.xml.srcviewer.XMLStyledDocument xmlStyledDocument
Constructor Detail |
public XMLSourceView()
XMLSourceView
.Method Detail |
public java.awt.Font getAttributeNameFont()
Font
object.public java.awt.Color getAttributeNameForeground()
Color
object.public java.awt.Font getAttributeValueFont()
Font
object.public java.awt.Color getAttributeValueForeground()
Color
object.public java.awt.Color getBackground()
Color
object.public java.awt.Font getCDATAFont()
Font
object.public java.awt.Color getCDATAForeground()
Color
object.public java.awt.Font getCommentDataFont()
Font
object.public java.awt.Color getCommentDataForeground()
Color
object.public javax.swing.JTextPane getJTextPane()
JTextPane
component.JTextPane
object used by XMLSourceViewerpublic java.awt.Dimension getMinimumSize()
Dimension
object containing
the XMLSourceView minimum size.public Node getNodeAtOffset(int i) throws javax.swing.text.BadLocationException
i
- The node offset.Node
object from offset i
.public java.awt.Font getPCDATAFont()
Font
object.public java.awt.Color getPCDATAForeground()
Color
object.public java.awt.Font getPIDataFont()
Font
objectpublic java.awt.Color getPIDataForeground()
Color
object.public java.awt.Font getPINameFont()
Font
object.public java.awt.Color getPINameForeground()
Color
object.public java.lang.String getText()
String
object containing the XML document.public java.lang.String getEditedText()
String
object containing the edited text.public java.awt.Font getSymbolFont()
Font
object.public java.awt.Color getSymbolForeground()
Color
object.public java.awt.Font getTagFont()
Font
object.public java.awt.Color getTagForeground()
Color
object.public java.awt.Font getDTDFont()
Font
object.public java.awt.Color getDTDForeground()
Color
object.public java.awt.Font getDTDInternalFont()
Font
object.public java.awt.Color getDTDInternalForeground()
Color
object.public void selectNodeAt(int i) throws javax.swing.text.BadLocationException
i
.i
- The node offset.public void setAttributeNameFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for Attribute Name.public void setAttributeNameForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for Attribute Name.public void setAttributeValueFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for Attribute Value.public void setAttributeValueForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for Attribute Value.public void setBackground(java.awt.Color color)
color
- The new background Color
.public void setCDATAFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for CDATA.public void setCDATAForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for CDATA.public void setCommentDataFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for the XML Comments.public void setCommentDataForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for Comment.public void setEditable(boolean edit)
doc
- The new boolean
value.public boolean isEditable()
public void setXMLDocument(Document document)
doc
- The Document
document to display.getText()
public void setPCDATAFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for PCDATA.public void setPCDATAForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for PCDATA.public void setPIDataFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for PI Data.public void setPIDataForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for PI Data.public void setPINameFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for the PI Names.public void setPINameForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for PI Name.public void setSelectedNode(Node node)
node
- The selected node.public void setSymbolFont(java.awt.Font font) throws java.lang.IllegalArgumentException
color
- The new Font
for NOTATION Symbol.public void setSymbolForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for NOTATION Symbol.public void setTagFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for the XML Tags.public void setTagForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for the XML Tags.public void setDTDFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for the XML Tags.public void setDTDForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for the XML Tags.public void setDTDInternalFont(java.awt.Font font) throws java.lang.IllegalArgumentException
font
- The new Font
for the XML Tags.public void setDTDInternalForeground(java.awt.Color color) throws java.lang.IllegalArgumentException
color
- The new Color
for the XML Tags.public static java.awt.Font fontGet(javax.swing.text.AttributeSet attributeset)
attributeset
- The source Attributeset
.Font
.public static void fontSet(javax.swing.text.MutableAttributeSet mutableattributeset, java.awt.Font font)
mutableattributeset
- The mutableattributeset
to update.font
- The new Font
for the mutableattributeset.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |