|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.text.JTextComponent | +--javax.swing.JEditorPane | +--com.japisoft.xmlpad.bean.XMLEditor
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
XMLContainer
,
XMLEditorKit
,
JEditorPane
,
Serialized FormField 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 |
public XMLEditor()
Method Detail |
public boolean showSystemSyntaxHelperPopup(int offset)
offset
-
public boolean showTagSyntaxHelperPopup(int offset)
offset
-
public boolean showEntitySyntaxHelperPopup(int offset)
offset
-
public void setXMLContainer(XMLContainer container)
public XMLContainer getXMLContainer()
public javax.swing.text.Document getDocument()
getDocument
in class javax.swing.text.JTextComponent
public void resetDocument(DefaultXMLDocument doc)
public void focusGained(java.awt.event.FocusEvent e)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent e)
focusLost
in interface java.awt.event.FocusListener
public void setEnabledRealTimeStructureChanged(boolean support)
public boolean isEnabledRealTimeStructureChanged()
public void setAutoCloseTag(boolean autoClose)
true
by default
public boolean isAutoCloseTag()
true
by default
public void notifyStructureChanged()
public void paint(java.awt.Graphics gc)
paint
in class javax.swing.JComponent
public void setEditorContext(EditorContext context)
public void notifyError(int line, java.lang.String message)
public void notifyNoError()
public void setTemplate(XMLTemplate template)
public XMLTemplate getTemplate()
public void resetDefaultLook()
public javax.swing.text.EditorKit getEditorKit()
getEditorKit
in class javax.swing.JEditorPane
public void initKeymap()
public void setAction(javax.swing.KeyStroke key, javax.swing.Action a)
public void setFontForEntity(java.awt.Font font)
public void setFontForComment(java.awt.Font font)
public void setFontForDeclaration(java.awt.Font font)
public void setFontForDocType(java.awt.Font font)
public void setFontForLiteral(java.awt.Font font)
public void setFontForTag(java.awt.Font font)
public void setFontForInvalid(java.awt.Font font)
public void setFontForText(java.awt.Font font)
public void setFontForAttribute(java.awt.Font font)
public void setFontForTagDelimiter(java.awt.Font font)
public void setFontForAttributeSeparator(java.awt.Font font)
public void setFontForTagEnd(java.awt.Font font)
public void setFontForNameSpace(java.awt.Font font)
public java.awt.Font getFontForNameSpace()
public java.awt.Font getFontForEntity()
public java.awt.Font getFontForComment()
public java.awt.Font getFontForDeclaration()
public java.awt.Font getFontForDocType()
public java.awt.Font getFontForLiteral()
public java.awt.Font getFontForTag()
public java.awt.Font getFontForInvalid()
public java.awt.Font getFontForText()
public java.awt.Font getFontForAttribute()
public java.awt.Font getFontForTagDelimiter()
public java.awt.Font getFontForAttributeSeparator()
public java.awt.Font getFontForTagEnd()
public void setColorForEntity(java.awt.Color color)
public void setColorForComment(java.awt.Color color)
public void setColorForDeclaration(java.awt.Color color)
public void setColorForDocType(java.awt.Color color)
public void setColorForLiteral(java.awt.Color color)
public void setColorForTag(java.awt.Color color)
public void setColorForInvalid(java.awt.Color color)
public void setColorForText(java.awt.Color color)
public void setColorForAttribute(java.awt.Color color)
public void setColorForTagDelimiter(java.awt.Color color)
public void setColorForAttributeSeparator(java.awt.Color color)
public void setColorForTagEnd(java.awt.Color color)
public void setColorForNameSpace(java.awt.Color color)
public java.awt.Color getColorForNameSpace()
public java.awt.Color getColorForEntity()
public java.awt.Color getColorForComment()
public java.awt.Color getColorForDeclaration()
public java.awt.Color getColorForDocType()
public java.awt.Color getColorForLiteral()
public java.awt.Color getColorForTag()
public java.awt.Color getColorForInvalid()
public java.awt.Color getColorForText()
public java.awt.Color getColorForAttribute()
public java.awt.Color getColorForTagDelimiter()
public java.awt.Color getColorForAttributeSeparator()
public java.awt.Color getColorForTagEnd()
public void setEntityColor(java.awt.Color color)
public java.awt.Color getEntityColor()
public void setCommentColor(java.awt.Color color)
public java.awt.Color getCommentColor()
public void setDeclarationColor(java.awt.Color color)
public java.awt.Color getDeclarationColor()
public void setDocTypeColor(java.awt.Color color)
public java.awt.Color getDocTypeColor()
public void setTagColor(java.awt.Color color)
public java.awt.Color getTagColor()
public void setLiteralColor(java.awt.Color color)
public java.awt.Color getLiteralColor()
public void setSelectionLineColor(java.awt.Color color)
public java.awt.Color getSelectionLineColor()
public void setErrorLineColor(java.awt.Color color)
public java.awt.Color getErrorLineColor()
public void setUndoManager(javax.swing.undo.UndoManager undo)
public javax.swing.undo.UndoManager getUndoManager()
public void undo()
public void redo()
public void setEntityResolver(XMLEntityResolver resolver)
public XMLEntityResolver getEntityResolver()
public void setDefaultXMLExtension(java.lang.String ext)
public java.lang.String getDefaultXMLExtension()
public void setText(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public void setText(java.lang.String newText)
setText
in class javax.swing.JEditorPane
public java.lang.String getText(int from)
public java.lang.String getText()
getText
in class javax.swing.JEditorPane
public void setLineNumber(int num)
public void insertText(java.lang.String text)
public javax.swing.text.EditorKit createDefaultEditorKit()
createDefaultEditorKit
in class javax.swing.JEditorPane
public void unhighlightLine()
public int getLineStart(int caret)
public int getLineEnd(int caret)
public void highlightLine(int line)
public void setTagDelimiterHighlightColor(java.awt.Color color)
color
- Color for the tag delimiterpublic java.awt.Color getTagDelimiterHighlightColor()
public void setAttDelimiterHighlightColor(java.awt.Color color)
color
- Color for the attribute value delimiterpublic java.awt.Color getAttDelimiterHighlightColor()
public void setTagDelimiterHighlight(boolean tagDelimiterHighlight)
public boolean isTagDelimiterHighlight()
true
if tagDelimiter highlighting is enabledpublic void setAttDelimiterHighlight(boolean attDelimiterHighlight)
public boolean isAttDelimiterHighlight()
true
if color highlight for attribute valuepublic void setEnabledTreeLocationForCaret(boolean rt)
public boolean isEnabledTreeLocationForCaret()
public void caretUpdate(javax.swing.event.CaretEvent e)
caretUpdate
in interface javax.swing.event.CaretListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |