com.japisoft.xmlpad.bean
Class XMLEditor

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.text.JTextComponent
                          |
                          +--javax.swing.JEditorPane
                                |
                                +--com.japisoft.xmlpad.bean.XMLEditor
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.CaretListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

public class XMLEditor
extends javax.swing.JEditorPane
implements javax.swing.event.CaretListener, java.awt.event.FocusListener

Main class for the XMLEditor. This class uses the XMLEditorKit for working.

This class is a part of the XMLContainer. It manages a standard swing document and a view for XML

For general usage, it is adviced to use the XMLContainer and not this class

Version:
1.9
Author:
(c)JAPISoft 2002
See Also:
XMLContainer, XMLEditorKit, JEditorPane, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
XMLEditor()
           
 
Method Summary
 void caretUpdate(javax.swing.event.CaretEvent e)
          Structure computing
 javax.swing.text.EditorKit createDefaultEditorKit()
           
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 java.awt.Color getAttDelimiterHighlightColor()
           
 java.awt.Color getColorForAttribute()
          Colorize attribute <tag ATTRIBUTE="..." ...
 java.awt.Color getColorForAttributeSeparator()
          Colorize '='
 java.awt.Color getColorForComment()
          Colorize XML comment <!
 java.awt.Color getColorForDeclaration()
          Colorize XML declaration <?
 java.awt.Color getColorForDocType()
          Colorize DocType declaration <!
 java.awt.Color getColorForEntity()
          Colorize entity &ENTITY;
 java.awt.Color getColorForInvalid()
          Colorize error
 java.awt.Color getColorForLiteral()
          Colorize literal "..."
 java.awt.Color getColorForNameSpace()
          Colorize NameSpace
 java.awt.Color getColorForTag()
          Colorize tag <Tag...
 java.awt.Color getColorForTagDelimiter()
          Colorize tag delimiter < or >
 java.awt.Color getColorForTagEnd()
          Colorize '/'
 java.awt.Color getColorForText()
          Colorize text
 java.awt.Color getCommentColor()
          Deprecated.  
 java.awt.Color getDeclarationColor()
          Deprecated.  
 java.lang.String getDefaultXMLExtension()
          Deprecated. USe the XMLDocumentInfo from the XMLContainer for that
 java.awt.Color getDocTypeColor()
          Deprecated.  
 javax.swing.text.Document getDocument()
           
 javax.swing.text.EditorKit getEditorKit()
           
 java.awt.Color getEntityColor()
          Deprecated.  
 XMLEntityResolver getEntityResolver()
           
 java.awt.Color getErrorLineColor()
          Deprecated.  
 java.awt.Font getFontForAttribute()
          Fontize attribute <tag ATTRIBUTE="..." ...
 java.awt.Font getFontForAttributeSeparator()
          Fontize '='
 java.awt.Font getFontForComment()
          Fontize XML comment <!
 java.awt.Font getFontForDeclaration()
          Fontize XML declaration <?
 java.awt.Font getFontForDocType()
          Fontize DocType declaration <!
 java.awt.Font getFontForEntity()
          Fontize entity &ENTITY;
 java.awt.Font getFontForInvalid()
          Fontize error
 java.awt.Font getFontForLiteral()
          Fontize literal "..."
 java.awt.Font getFontForNameSpace()
          Fontize namespace
 java.awt.Font getFontForTag()
          Fontize tag <Tag...
 java.awt.Font getFontForTagDelimiter()
          Fontize tag delimiter < or >
 java.awt.Font getFontForTagEnd()
          Fontize '/'
 java.awt.Font getFontForText()
          Fontize text
 int getLineEnd(int caret)
           
 int getLineStart(int caret)
           
 java.awt.Color getLiteralColor()
          Deprecated.  
 java.awt.Color getSelectionLineColor()
          Deprecated.  
 java.awt.Color getTagColor()
          Deprecated.  
 java.awt.Color getTagDelimiterHighlightColor()
           
 XMLTemplate getTemplate()
           
 java.lang.String getText()
           
 java.lang.String getText(int from)
           
 javax.swing.undo.UndoManager getUndoManager()
           
 XMLContainer getXMLContainer()
           
 void highlightLine(int line)
          Highlight the line with the "selectionColor" property
 void initKeymap()
           
 void insertText(java.lang.String text)
          Insert a string at the current caret location
 boolean isAttDelimiterHighlight()
           
 boolean isAutoCloseTag()
          Does the closing tag is inserted automatically : true by default
 boolean isEnabledRealTimeStructureChanged()
          Notify in real time any tree structure change.
 boolean isEnabledTreeLocationForCaret()
          Is Enabled the current tree location for a caret change ?.
 boolean isTagDelimiterHighlight()
           
 void notifyError(int line, java.lang.String message)
          Notify an error to the following line with the tied message
 void notifyNoError()
          Notify no error found
 void notifyStructureChanged()
          Notify that the structure has changed.
 void paint(java.awt.Graphics gc)
           
 void redo()
          Redo last action
 void resetDefaultLook()
          Reset the default color of the editor
 void resetDocument(DefaultXMLDocument doc)
           
 void setAction(javax.swing.KeyStroke key, javax.swing.Action a)
           
 void setAttDelimiterHighlight(boolean attDelimiterHighlight)
          Enable Color for attribute value
 void setAttDelimiterHighlightColor(java.awt.Color color)
           
 void setAutoCloseTag(boolean autoClose)
          Insert the closing tag while the user inserts the opening tag : true by default
 void setColorForAttribute(java.awt.Color color)
          Colorize attribute <tag ATTRIBUTE="..." ...
 void setColorForAttributeSeparator(java.awt.Color color)
          Colorize '='
 void setColorForComment(java.awt.Color color)
          Colorize XML comment <!
 void setColorForDeclaration(java.awt.Color color)
          Colorize XML declaration <?
 void setColorForDocType(java.awt.Color color)
          Colorize DocType declaration <!
 void setColorForEntity(java.awt.Color color)
          Colorize entity &ENTITY;
 void setColorForInvalid(java.awt.Color color)
          Colorize error
 void setColorForLiteral(java.awt.Color color)
          Colorize literal "..."
 void setColorForNameSpace(java.awt.Color color)
          Colorize NameSpace
 void setColorForTag(java.awt.Color color)
          Colorize tag <Tag...
 void setColorForTagDelimiter(java.awt.Color color)
          Colorize tag delimiter < or >
 void setColorForTagEnd(java.awt.Color color)
          Colorize '/'
 void setColorForText(java.awt.Color color)
          Colorize text
 void setCommentColor(java.awt.Color color)
          Deprecated.  
 void setDeclarationColor(java.awt.Color color)
          Deprecated.  
 void setDefaultXMLExtension(java.lang.String ext)
          Deprecated. Use the XMLDocumentInfo from the XMLContainer for that
 void setDocTypeColor(java.awt.Color color)
          Deprecated.  
 void setEditorContext(EditorContext context)
          Case for communication with the container
 void setEnabledRealTimeStructureChanged(boolean support)
          Notify in real time any tree structure change.
 void setEnabledTreeLocationForCaret(boolean rt)
          Enabled the current tree location for a caret change.
 void setEntityColor(java.awt.Color color)
          Deprecated.  
 void setEntityResolver(XMLEntityResolver resolver)
          Update the current entity resolver, it is useful for traducing char to entity while reading and the contrary when getting the current text
 void setErrorLineColor(java.awt.Color color)
          Deprecated.  
 void setFontForAttribute(java.awt.Font font)
          Fontize attribute <tag ATTRIBUTE="..." ...
 void setFontForAttributeSeparator(java.awt.Font font)
          Fontize '='
 void setFontForComment(java.awt.Font font)
          Fontize XML comment <!
 void setFontForDeclaration(java.awt.Font font)
          Fontize XML declaration <?
 void setFontForDocType(java.awt.Font font)
          Fontize DocType declaration <!
 void setFontForEntity(java.awt.Font font)
          Fontize entity &ENTITY;
 void setFontForInvalid(java.awt.Font font)
          Fontize error
 void setFontForLiteral(java.awt.Font font)
          Fontize literal "..."
 void setFontForNameSpace(java.awt.Font font)
          Fontize namespace
 void setFontForTag(java.awt.Font font)
          Fontize tag <Tag...
 void setFontForTagDelimiter(java.awt.Font font)
          Fontize tag delimiter < or >
 void setFontForTagEnd(java.awt.Font font)
          Fontize '/'
 void setFontForText(java.awt.Font font)
          Fontize text
 void setLineNumber(int num)
          reset the cart to the current line number
 void setLiteralColor(java.awt.Color color)
          Deprecated.  
 void setSelectionLineColor(java.awt.Color color)
          Deprecated.  
 void setTagColor(java.awt.Color color)
          Deprecated.  
 void setTagDelimiterHighlight(boolean tagDelimiterHighlight)
          Enable Color for tag delimited "<" and ">"
 void setTagDelimiterHighlightColor(java.awt.Color color)
           
 void setTemplate(XMLTemplate template)
          Template for the 'new' operation
 void setText(java.io.InputStream input)
          Load the text from the inputstream
 void setText(java.lang.String newText)
          Reset the XML text
 void setUndoManager(javax.swing.undo.UndoManager undo)
          Reset the undo manager
 void setXMLContainer(XMLContainer container)
          Reset the container for this editor
 boolean showEntitySyntaxHelperPopup(int offset)
          Show a popup for entities syntax helping at this offset.
 boolean showSystemSyntaxHelperPopup(int offset)
          Show the popup for system syntax helping at this offset like comment or cdata
 boolean showTagSyntaxHelperPopup(int offset)
          Show the popup for tags syntax helping at this offset.
 void undo()
          Undo last action
 void unhighlightLine()
          Remove the highlight of the current line
 
Methods inherited from class javax.swing.JEditorPane
addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getUIClassID, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, replaceSelection, scrollToReference, setContentType, setEditorKit, setEditorKitForContentType, setPage, setPage
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, read, removeCaretListener, removeKeymap, removeNotify, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDocument, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLEditor

public XMLEditor()
Method Detail

showSystemSyntaxHelperPopup

public boolean showSystemSyntaxHelperPopup(int offset)
Show the popup for system syntax helping at this offset like comment or cdata

Parameters:
offset -
Returns:
false if the popup can't be show

showTagSyntaxHelperPopup

public boolean showTagSyntaxHelperPopup(int offset)
Show the popup for tags syntax helping at this offset.

Parameters:
offset -
Returns:
false if the popup can't be shown

showEntitySyntaxHelperPopup

public boolean showEntitySyntaxHelperPopup(int offset)
Show a popup for entities syntax helping at this offset.

Parameters:
offset -
Returns:
false if the popup can't be shown

setXMLContainer

public void setXMLContainer(XMLContainer container)
Reset the container for this editor


getXMLContainer

public XMLContainer getXMLContainer()
Returns:
the container for this editor

getDocument

public javax.swing.text.Document getDocument()
Overrides:
getDocument in class javax.swing.text.JTextComponent

resetDocument

public void resetDocument(DefaultXMLDocument doc)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

setEnabledRealTimeStructureChanged

public void setEnabledRealTimeStructureChanged(boolean support)
Notify in real time any tree structure change. This is needed for real time tree synchronization


isEnabledRealTimeStructureChanged

public boolean isEnabledRealTimeStructureChanged()
Notify in real time any tree structure change. This is needed for real time tree synchronization


setAutoCloseTag

public void setAutoCloseTag(boolean autoClose)
Insert the closing tag while the user inserts the opening tag : true by default


isAutoCloseTag

public boolean isAutoCloseTag()
Does the closing tag is inserted automatically : true by default


notifyStructureChanged

public void notifyStructureChanged()
Notify that the structure has changed. This method should only appear in particular case like load a new document ...


paint

public void paint(java.awt.Graphics gc)
Overrides:
paint in class javax.swing.JComponent

setEditorContext

public void setEditorContext(EditorContext context)
Case for communication with the container


notifyError

public void notifyError(int line,
                        java.lang.String message)
Notify an error to the following line with the tied message


notifyNoError

public void notifyNoError()
Notify no error found


setTemplate

public void setTemplate(XMLTemplate template)
Template for the 'new' operation


getTemplate

public XMLTemplate getTemplate()
Returns:
the default template for the 'new' operation

resetDefaultLook

public void resetDefaultLook()
Reset the default color of the editor


getEditorKit

public javax.swing.text.EditorKit getEditorKit()
Overrides:
getEditorKit in class javax.swing.JEditorPane

initKeymap

public void initKeymap()

setAction

public void setAction(javax.swing.KeyStroke key,
                      javax.swing.Action a)

setFontForEntity

public void setFontForEntity(java.awt.Font font)
Fontize entity &ENTITY;


setFontForComment

public void setFontForComment(java.awt.Font font)
Fontize XML comment <!-- ... -->


setFontForDeclaration

public void setFontForDeclaration(java.awt.Font font)
Fontize XML declaration <? ... ?>


setFontForDocType

public void setFontForDocType(java.awt.Font font)
Fontize DocType declaration <! ... >


setFontForLiteral

public void setFontForLiteral(java.awt.Font font)
Fontize literal "..."


setFontForTag

public void setFontForTag(java.awt.Font font)
Fontize tag <Tag...


setFontForInvalid

public void setFontForInvalid(java.awt.Font font)
Fontize error


setFontForText

public void setFontForText(java.awt.Font font)
Fontize text


setFontForAttribute

public void setFontForAttribute(java.awt.Font font)
Fontize attribute <tag ATTRIBUTE="..." ...


setFontForTagDelimiter

public void setFontForTagDelimiter(java.awt.Font font)
Fontize tag delimiter < or >


setFontForAttributeSeparator

public void setFontForAttributeSeparator(java.awt.Font font)
Fontize '='


setFontForTagEnd

public void setFontForTagEnd(java.awt.Font font)
Fontize '/'


setFontForNameSpace

public void setFontForNameSpace(java.awt.Font font)
Fontize namespace


getFontForNameSpace

public java.awt.Font getFontForNameSpace()
Fontize namespace


getFontForEntity

public java.awt.Font getFontForEntity()
Fontize entity &ENTITY;


getFontForComment

public java.awt.Font getFontForComment()
Fontize XML comment <!-- ... -->


getFontForDeclaration

public java.awt.Font getFontForDeclaration()
Fontize XML declaration <? ... ?>


getFontForDocType

public java.awt.Font getFontForDocType()
Fontize DocType declaration <! ... >


getFontForLiteral

public java.awt.Font getFontForLiteral()
Fontize literal "..."


getFontForTag

public java.awt.Font getFontForTag()
Fontize tag <Tag...


getFontForInvalid

public java.awt.Font getFontForInvalid()
Fontize error


getFontForText

public java.awt.Font getFontForText()
Fontize text


getFontForAttribute

public java.awt.Font getFontForAttribute()
Fontize attribute <tag ATTRIBUTE="..." ...


getFontForTagDelimiter

public java.awt.Font getFontForTagDelimiter()
Fontize tag delimiter < or >


getFontForAttributeSeparator

public java.awt.Font getFontForAttributeSeparator()
Fontize '='


getFontForTagEnd

public java.awt.Font getFontForTagEnd()
Fontize '/'


setColorForEntity

public void setColorForEntity(java.awt.Color color)
Colorize entity &ENTITY;


setColorForComment

public void setColorForComment(java.awt.Color color)
Colorize XML comment <!-- ... -->


setColorForDeclaration

public void setColorForDeclaration(java.awt.Color color)
Colorize XML declaration <? ... ?>


setColorForDocType

public void setColorForDocType(java.awt.Color color)
Colorize DocType declaration <! ... >


setColorForLiteral

public void setColorForLiteral(java.awt.Color color)
Colorize literal "..."


setColorForTag

public void setColorForTag(java.awt.Color color)
Colorize tag <Tag...


setColorForInvalid

public void setColorForInvalid(java.awt.Color color)
Colorize error


setColorForText

public void setColorForText(java.awt.Color color)
Colorize text


setColorForAttribute

public void setColorForAttribute(java.awt.Color color)
Colorize attribute <tag ATTRIBUTE="..." ...


setColorForTagDelimiter

public void setColorForTagDelimiter(java.awt.Color color)
Colorize tag delimiter < or >


setColorForAttributeSeparator

public void setColorForAttributeSeparator(java.awt.Color color)
Colorize '='


setColorForTagEnd

public void setColorForTagEnd(java.awt.Color color)
Colorize '/'


setColorForNameSpace

public void setColorForNameSpace(java.awt.Color color)
Colorize NameSpace


getColorForNameSpace

public java.awt.Color getColorForNameSpace()
Colorize NameSpace


getColorForEntity

public java.awt.Color getColorForEntity()
Colorize entity &ENTITY;


getColorForComment

public java.awt.Color getColorForComment()
Colorize XML comment <!-- ... -->


getColorForDeclaration

public java.awt.Color getColorForDeclaration()
Colorize XML declaration <? ... ?>


getColorForDocType

public java.awt.Color getColorForDocType()
Colorize DocType declaration <! ... >


getColorForLiteral

public java.awt.Color getColorForLiteral()
Colorize literal "..."


getColorForTag

public java.awt.Color getColorForTag()
Colorize tag <Tag...


getColorForInvalid

public java.awt.Color getColorForInvalid()
Colorize error


getColorForText

public java.awt.Color getColorForText()
Colorize text


getColorForAttribute

public java.awt.Color getColorForAttribute()
Colorize attribute <tag ATTRIBUTE="..." ...


getColorForTagDelimiter

public java.awt.Color getColorForTagDelimiter()
Colorize tag delimiter < or >


getColorForAttributeSeparator

public java.awt.Color getColorForAttributeSeparator()
Colorize '='


getColorForTagEnd

public java.awt.Color getColorForTagEnd()
Colorize '/'


setEntityColor

public void setEntityColor(java.awt.Color color)
Deprecated.  

set the color for entity


getEntityColor

public java.awt.Color getEntityColor()
Deprecated.  

Returns:
Color for entity

setCommentColor

public void setCommentColor(java.awt.Color color)
Deprecated.  

set the color for XML comment <!--...


getCommentColor

public java.awt.Color getCommentColor()
Deprecated.  

Returns:
the color for XML comment <!--...

setDeclarationColor

public void setDeclarationColor(java.awt.Color color)
Deprecated.  

set the Color for declaration <?xml version="1.0"...


getDeclarationColor

public java.awt.Color getDeclarationColor()
Deprecated.  

Returns:
the color for declaration <?xml version="1.0"...

setDocTypeColor

public void setDocTypeColor(java.awt.Color color)
Deprecated.  

set the Color for DocType declaration <!DOCTYPE ...


getDocTypeColor

public java.awt.Color getDocTypeColor()
Deprecated.  

Returns:
the color for DocType declaration <!DOCTYPE ...

setTagColor

public void setTagColor(java.awt.Color color)
Deprecated.  

Color for tag


getTagColor

public java.awt.Color getTagColor()
Deprecated.  

Returns:
the color of tag

setLiteralColor

public void setLiteralColor(java.awt.Color color)
Deprecated.  

Set the color for text


getLiteralColor

public java.awt.Color getLiteralColor()
Deprecated.  

Returns:
the color for text

setSelectionLineColor

public void setSelectionLineColor(java.awt.Color color)
Deprecated.  

Set the color for the selected line


getSelectionLineColor

public java.awt.Color getSelectionLineColor()
Deprecated.  

Returns:
the color for the line selected

setErrorLineColor

public void setErrorLineColor(java.awt.Color color)
Deprecated.  

Set the color for error line


getErrorLineColor

public java.awt.Color getErrorLineColor()
Deprecated.  

Returns:
the color for error line

setUndoManager

public void setUndoManager(javax.swing.undo.UndoManager undo)
Reset the undo manager


getUndoManager

public javax.swing.undo.UndoManager getUndoManager()
Returns:
the current undo manager

undo

public void undo()
Undo last action


redo

public void redo()
Redo last action


setEntityResolver

public void setEntityResolver(XMLEntityResolver resolver)
Update the current entity resolver, it is useful for traducing char to entity while reading and the contrary when getting the current text


getEntityResolver

public XMLEntityResolver getEntityResolver()
Returns:
the current entity resolver

setDefaultXMLExtension

public void setDefaultXMLExtension(java.lang.String ext)
Deprecated. Use the XMLDocumentInfo from the XMLContainer for that


getDefaultXMLExtension

public java.lang.String getDefaultXMLExtension()
Deprecated. USe the XMLDocumentInfo from the XMLContainer for that


setText

public void setText(java.io.InputStream input)
             throws java.io.IOException
Load the text from the inputstream

java.io.IOException

setText

public void setText(java.lang.String newText)
Reset the XML text

Overrides:
setText in class javax.swing.JEditorPane

getText

public java.lang.String getText(int from)
Returns:
a text starting from

getText

public java.lang.String getText()
Overrides:
getText in class javax.swing.JEditorPane
Returns:
the current text

setLineNumber

public void setLineNumber(int num)
reset the cart to the current line number


insertText

public void insertText(java.lang.String text)
Insert a string at the current caret location


createDefaultEditorKit

public javax.swing.text.EditorKit createDefaultEditorKit()
Overrides:
createDefaultEditorKit in class javax.swing.JEditorPane
Returns:
the current editor kit

unhighlightLine

public void unhighlightLine()
Remove the highlight of the current line


getLineStart

public int getLineStart(int caret)
Returns:
the start of the line for the caret position

getLineEnd

public int getLineEnd(int caret)
Returns:
the end of the line for the caret position

highlightLine

public void highlightLine(int line)
Highlight the line with the "selectionColor" property


setTagDelimiterHighlightColor

public void setTagDelimiterHighlightColor(java.awt.Color color)
Parameters:
color - Color for the tag delimiter

getTagDelimiterHighlightColor

public java.awt.Color getTagDelimiterHighlightColor()
Returns:
the Color for the tag delimiter

setAttDelimiterHighlightColor

public void setAttDelimiterHighlightColor(java.awt.Color color)
Parameters:
color - Color for the attribute value delimiter

getAttDelimiterHighlightColor

public java.awt.Color getAttDelimiterHighlightColor()
Returns:
the Color for the attribute value delimiter

setTagDelimiterHighlight

public void setTagDelimiterHighlight(boolean tagDelimiterHighlight)
Enable Color for tag delimited "<" and ">"


isTagDelimiterHighlight

public boolean isTagDelimiterHighlight()
Returns:
true if tagDelimiter highlighting is enabled

setAttDelimiterHighlight

public void setAttDelimiterHighlight(boolean attDelimiterHighlight)
Enable Color for attribute value


isAttDelimiterHighlight

public boolean isAttDelimiterHighlight()
Returns:
true if color highlight for attribute value

setEnabledTreeLocationForCaret

public void setEnabledTreeLocationForCaret(boolean rt)
Enabled the current tree location for a caret change. This feature can reduce the velocity. So it should be disabled for heavy XML document


isEnabledTreeLocationForCaret

public boolean isEnabledTreeLocationForCaret()
Is Enabled the current tree location for a caret change ?. True by default


caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent e)
Structure computing

Specified by:
caretUpdate in interface javax.swing.event.CaretListener