com.japisoft.xmlpad.bean
Class XMLEditor

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.text.JTextComponent
                  extended byjavax.swing.JEditorPane
                      extended bycom.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 an 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,2003 / Alexandre Brillant
See Also:
XMLContainer, XMLEditorKit, JEditorPane, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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 addNotify()
          This method will call the init method
 void caretUpdate(javax.swing.event.CaretEvent e)
          Structure computing
 javax.swing.text.EditorKit createDefaultEditorKit()
           
 void dispose()
           
 void focusGained(java.awt.event.FocusEvent e)
          Each time the editor take the focus.
 void focusLost(java.awt.event.FocusEvent e)
          For the moment, nothing is done
 java.awt.Color getAttDelimiterHighlightColor()
           
 java.awt.Color getColorForAttribute()
          Colorize attribute <tag ATTRIBUTE="..." ...
 java.awt.Color getColorForAttributeSeparator()
          Colorize '='
 java.awt.Color getColorForCDATA()
          Color for CDATA section
 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 getColorForTagBorderLine()
           
 java.awt.Color getColorForTagDelimiter()
          Colorize tag delimiter < or >
 java.awt.Color getColorForTagEnd()
          Colorize '/'
 java.awt.Color getColorForTagUnderline()
          Color for tag underline
 java.awt.Color getColorForText()
          Colorize text
 com.japisoft.fastparser.node.SimpleNode getCurrentNodeLocation()
           
 javax.swing.text.Document getDocument()
           
 javax.swing.text.EditorKit getEditorKit()
           
 XMLEntityResolver getEntityResolver()
           
 java.awt.Font getFontForAttribute()
          Deprecated. Fontize attribute <tag ATTRIBUTE="..." ...
 java.awt.Font getFontForAttributeSeparator()
          Deprecated. Fontize '='
 java.awt.Font getFontForComment()
          Deprecated. Fontize XML comment <!-- ... -->
 java.awt.Font getFontForDeclaration()
          Deprecated. Fontize XML declaration <? ... ?>
 java.awt.Font getFontForDocType()
          Deprecated. Fontize DocType declaration <! ... >
 java.awt.Font getFontForEntity()
          Deprecated. Fontize entity &ENTITY;
 java.awt.Font getFontForInvalid()
          Deprecated. Fontize error
 java.awt.Font getFontForLiteral()
          Deprecated. Fontize literal "..."
 java.awt.Font getFontForNameSpace()
          Deprecated. Fontize namespace
 java.awt.Font getFontForTag()
          Deprecated. Fontize tag <Tag...
 java.awt.Font getFontForTagDelimiter()
          Deprecated. Fontize tag delimiter < or >
 java.awt.Font getFontForTagEnd()
          Deprecated. Fontize '/'
 java.awt.Font getFontForText()
          Deprecated. Fontize text
 int getLineEnd(int caret)
           
 int getLineStart(int caret)
           
 java.awt.Color getTagDelimiterHighlightColor()
           
 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 isAutoResetAction()
           
 boolean isDocumentModified()
           
 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 notifyCurrentLocation()
          Notify to listener the current document location from the caret position.
 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 removeNotify()
          This method will call the dispose method
 void resetDefaultLook()
          Reset the default color of the editor
 void resetDocument(XMLDocument doc)
           
 void resetDocumentState(boolean modified)
          Only for internal usage.
 void select(int selectionStart, int selectionEnd)
          Override of the standard JTextComponent.select Move caret to the start of the selection instead of the end
 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 setAutoResetAction(boolean reset)
          By default to true.
 void setColorForAttribute(java.awt.Color color)
          Colorize attribute <tag ATTRIBUTE="..." ...
 void setColorForAttributeSeparator(java.awt.Color color)
          Colorize '='
 void setColorForCDATA(java.awt.Color color)
          Colorize CDATA section
 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 setColorForTagBorderLine(java.awt.Color color)
          Colorize the border line for tag delimiter
 void setColorForTagDelimiter(java.awt.Color color)
          Colorize tag delimiter < or >
 void setColorForTagEnd(java.awt.Color color)
          Colorize '/'
 void setColorForTagUnderline(java.awt.Color color)
          Colorize underline for current selection
 void setColorForText(java.awt.Color color)
          Colorize text
 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 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 setFontForAttribute(java.awt.Font font)
          Deprecated. Fontize attribute <tag ATTRIBUTE="..." ...
 void setFontForAttributeSeparator(java.awt.Font font)
          Deprecated. Fontize '='
 void setFontForComment(java.awt.Font font)
          Deprecated. Fontize XML comment <!-- ... -->
 void setFontForDeclaration(java.awt.Font font)
          Deprecated. Fontize XML declaration <? ... ?>
 void setFontForDocType(java.awt.Font font)
          Deprecated. Fontize DocType declaration <! ... >
 void setFontForEntity(java.awt.Font font)
          Deprecated. Fontize entity &ENTITY;
 void setFontForInvalid(java.awt.Font font)
          Deprecated. Fontize error
 void setFontForLiteral(java.awt.Font font)
          Deprecated. Fontize literal "..."
 void setFontForNameSpace(java.awt.Font font)
          Deprecated. Fontize namespace
 void setFontForTag(java.awt.Font font)
          Deprecated. Fontize tag <Tag...
 void setFontForTagDelimiter(java.awt.Font font)
          Deprecated. Fontize tag delimiter < or >
 void setFontForTagEnd(java.awt.Font font)
          Deprecated. Fontize '/'
 void setFontForText(java.awt.Font font)
          Deprecated. Fontize text
 void setLineNumber(int num)
          reset the cart to the current line number
 void setTagDelimiterHighlight(boolean tagDelimiterHighlight)
          Enable Color for tag delimited "<" and ">"
 void setTagDelimiterHighlightColor(java.awt.Color color)
           
 void setText(java.io.InputStream input)
          Note : You must use setText on the XMLContainer rather than on this class Load the text from the inputstream.
 void setText(java.lang.String newText)
          Note : You must use setText on the XMLContainer rather than on this class
 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 synchronousCurrentLocation(boolean waitTreeSynchro)
          Synchronous action for refreshing the current document location from the caret position
 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, 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, 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

dispose

public void dispose()

addNotify

public void addNotify()
This method will call the init method


select

public void select(int selectionStart,
                   int selectionEnd)
Override of the standard JTextComponent.select Move caret to the start of the selection instead of the end


removeNotify

public void removeNotify()
This method will call the dispose method


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

getCurrentNodeLocation

public com.japisoft.fastparser.node.SimpleNode getCurrentNodeLocation()
Returns:
the current document location from the caret position

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()

resetDocument

public void resetDocument(XMLDocument doc)

setAutoResetAction

public void setAutoResetAction(boolean reset)
By default to true. This method will enable to reset the ActionModel each time the current editor take the focus. Thus all XMLAction will work with the good one.


isAutoResetAction

public boolean isAutoResetAction()
Returns:
true if a focusGained resets the ActionModel

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Each time the editor take the focus. The actionModel wil be used to active all action on the current editor. User can change this behavior calling setAutoResetAction

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
For the moment, nothing is done

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


resetDocumentState

public void resetDocumentState(boolean modified)
Only for internal usage. User shouldn't call it or override it


isDocumentModified

public boolean isDocumentModified()
Returns:
true if the current document has been modified once

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)

setEditorContext

public void setEditorContext(EditorContext context)
Case for communication with the container. User shouldn't use it. Look at the LocationListener


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


resetDefaultLook

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


getEditorKit

public javax.swing.text.EditorKit getEditorKit()

initKeymap

public void initKeymap()

setAction

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

setFontForEntity

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


setFontForComment

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


setFontForDeclaration

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


setFontForDocType

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


setFontForLiteral

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


setFontForTag

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


setFontForInvalid

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


setFontForText

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


setFontForAttribute

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


setFontForTagDelimiter

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


setFontForAttributeSeparator

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


setFontForTagEnd

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


setFontForNameSpace

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


getFontForNameSpace

public java.awt.Font getFontForNameSpace()
Deprecated. Fontize namespace


getFontForEntity

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


getFontForComment

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


getFontForDeclaration

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


getFontForDocType

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


getFontForLiteral

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


getFontForTag

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


getFontForInvalid

public java.awt.Font getFontForInvalid()
Deprecated. Fontize error


getFontForText

public java.awt.Font getFontForText()
Deprecated. Fontize text


getFontForAttribute

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


getFontForTagDelimiter

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


getFontForAttributeSeparator

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


getFontForTagEnd

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


setColorForTagBorderLine

public void setColorForTagBorderLine(java.awt.Color color)
Colorize the border line for tag delimiter


getColorForTagBorderLine

public java.awt.Color getColorForTagBorderLine()
Returns:
the color for the border line

setColorForCDATA

public void setColorForCDATA(java.awt.Color color)
Colorize CDATA section


setColorForTagUnderline

public void setColorForTagUnderline(java.awt.Color color)
Colorize underline for current selection


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


getColorForCDATA

public java.awt.Color getColorForCDATA()
Color for CDATA section


getColorForTagUnderline

public java.awt.Color getColorForTagUnderline()
Color for tag underline


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 '/'


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

setText

public void setText(java.io.InputStream input)
             throws java.io.IOException
Note : You must use setText on the XMLContainer rather than on this class Load the text from the inputstream. The stream is closed after reading

Throws:
java.io.IOException

setText

public void setText(java.lang.String newText)
Note : You must use setText on the XMLContainer rather than on this class


getText

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

getText

public java.lang.String getText()
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()
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


notifyCurrentLocation

public void notifyCurrentLocation()
Notify to listener the current document location from the caret position. Note that this method shouldn't be called because this is done for caret changes and this is asynchronous. For instant action call rather reforceCurrentLocation


synchronousCurrentLocation

public void synchronousCurrentLocation(boolean waitTreeSynchro)
Synchronous action for refreshing the current document location from the caret position

Parameters:
waitTreeSynchro - if true, the current thread will wait for a good text/tree synchro

caretUpdate

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

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