|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.japisoft.xmlpad.editor.XMLDocument
(c) 2003 JAPISoft Main document for the XMLEditor bean
Nested Class Summary | |
class |
XMLDocument.XMLDocumentListener
An implementation of DocumentListener that inserts and
deletes lines from the token marker's state.remove |
Nested classes inherited from class javax.swing.text.AbstractDocument |
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement |
Field Summary |
Fields inherited from class javax.swing.text.PlainDocument |
lineLimitAttribute, tabSizeAttribute |
Fields inherited from class javax.swing.text.AbstractDocument |
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
Fields inherited from interface javax.swing.text.Document |
StreamDescriptionProperty, TitleProperty |
Constructor Summary | |
XMLDocument(XMLEditor editor)
Creates a new DefaultXMLDocument instance. |
Method Summary | |
void |
enableStructureDamagedSupport(boolean structure)
Support notification for an XML structure tree change like adding or removing a tag |
boolean |
forceLocation()
For inner usage only. |
int[] |
getAttributeValueLocation(int offset)
|
java.lang.Integer[] |
getCommentDelimiters(int offset)
The starting and stopping comment position or null if no comment is found |
java.lang.StringBuffer |
getCompletionBuffer()
For inner usage |
XMLContainer |
getContainer()
|
XMLEditor |
getCurrentEditor()
|
java.lang.String[] |
getElementsFromDTD()
|
java.lang.String |
getForwardAttributeName(XMLDocument document,
int offset)
|
java.awt.Point |
getLastDTDLocation()
|
java.lang.String |
getPreviousOpeningTag(int offset)
|
java.lang.String |
getPreviousOpeningTagInsideATagPart(int offset)
|
java.lang.String |
getPreviousOpeningTagInsideATagPartWithoutPrefix(int offset)
|
java.lang.String |
getWordAt(int from)
Extract a word at this location |
SimpleNode |
getXMLPath(int location)
|
void |
insertString(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Insert a string at this offset showing if needed a syntax popup helper |
void |
insertStringWithoutHelper(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Insert a string at this offset ignore syntax popup helper |
void |
insertStringWithoutHelper(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a,
boolean caretMoved)
|
void |
insertStringWithoutStructureDamaged(int offset,
java.lang.String str,
javax.swing.text.AttributeSet a)
Insert a string at this offset ignoring the tree synchronization |
boolean |
isAutoCloseTag()
by default true |
boolean |
isBetweenTagDelimiters(int offset)
Check for usage between < or > |
boolean |
isEnableStructureDamagedSupport()
Support notification for an XML structure tree change like adding or removing a tag |
boolean |
isInProlog(int offset)
|
boolean |
isInsideAttributeValue(int offset)
|
boolean |
isInsideCDATA(int offset)
Editing in a CDATA section ? |
boolean |
isInsideComment(int offset)
Editing in a Comment section ? |
boolean |
isInsideDTDAttributeDefinition(int offset)
Inside <! |
boolean |
isInsideDTDElementDefinition(int offset)
Inside <! |
boolean |
isInsideTag(int offset)
|
boolean |
isInsideTag(int offset,
boolean exceptAttributeValue,
boolean exceptEndTag)
|
boolean |
isInsideTagExceptAttributeValue(int offset)
|
boolean |
isSyntaxPopup()
Enable a popup for < and &, by default true |
boolean |
manageCompletion(boolean insertBefore,
int offset,
java.lang.String str)
|
int |
nextTag(int from)
Find the location of the next tag |
boolean |
parseDTD()
Search and parse document DTD on the current document |
boolean |
parseSchema()
Search and parse an XML on the current document schema |
void |
remove(int offs,
int len)
Remove a text at this offset. |
void |
removeWithoutStructureDamaged(int offset,
int len)
Remove a text at this offset, it will not synchronize the tree |
void |
resetCompletionMode(boolean enabled)
For inner usage |
void |
setAutoCloseTag(boolean autoClose)
Support for automatically closing the current inserted tag |
void |
setEditor(XMLEditor editor)
|
void |
setStructureDamagedListener(StructureDamagedListener listener)
Listener for XML tree changes |
void |
setSyntaxPopup(boolean popup)
Enable a popup while entering < or & |
protected void |
structureDamaged()
Fire an event that the XML document has not the same structure |
java.awt.Point |
updateElement(java.lang.String startElement,
java.lang.String endElement,
int startOffset,
int endOffset)
Used mainly by the elementView for updating the element content |
void |
updateNode(SimpleNode sn,
java.lang.String newContent)
Replace this node by this new content |
void |
updateNodeOpeningClosing(SimpleNode node)
Update the node changed inside the editor. |
Methods inherited from class javax.swing.text.PlainDocument |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate |
Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLDocument(XMLEditor editor)
DefaultXMLDocument
instance.
Method Detail |
public XMLEditor getCurrentEditor()
public void setEditor(XMLEditor editor)
public XMLContainer getContainer()
protected void structureDamaged()
public void setStructureDamagedListener(StructureDamagedListener listener)
public boolean isInsideComment(int offset)
public boolean isInsideCDATA(int offset)
public int nextTag(int from)
public java.lang.String getWordAt(int from)
public java.lang.String getForwardAttributeName(XMLDocument document, int offset)
public SimpleNode getXMLPath(int location)
public void enableStructureDamagedSupport(boolean structure)
public boolean isEnableStructureDamagedSupport()
public void setAutoCloseTag(boolean autoClose)
public boolean isAutoCloseTag()
true
public void setSyntaxPopup(boolean popup)
public boolean isSyntaxPopup()
public int[] getAttributeValueLocation(int offset)
public boolean isInProlog(int offset)
true
if this offset is before the root nodepublic boolean isInsideAttributeValue(int offset)
public boolean isInsideTagExceptAttributeValue(int offset)
true
if the offset is inside a tag and not in an attribute valuepublic boolean isInsideTag(int offset)
public boolean isInsideTag(int offset, boolean exceptAttributeValue, boolean exceptEndTag)
public java.lang.Integer[] getCommentDelimiters(int offset)
offset
- Current document location
public void resetCompletionMode(boolean enabled)
public java.lang.StringBuffer getCompletionBuffer()
public boolean manageCompletion(boolean insertBefore, int offset, java.lang.String str)
public void insertStringWithoutStructureDamaged(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
public void insertStringWithoutHelper(int offset, java.lang.String str, javax.swing.text.AttributeSet a)
public void insertStringWithoutHelper(int offset, java.lang.String str, javax.swing.text.AttributeSet a, boolean caretMoved)
public void insertString(int offset, java.lang.String str, javax.swing.text.AttributeSet a) throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public java.lang.String getPreviousOpeningTagInsideATagPartWithoutPrefix(int offset) throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public java.lang.String getPreviousOpeningTagInsideATagPart(int offset) throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public java.lang.String getPreviousOpeningTag(int offset) throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public boolean forceLocation()
public boolean parseSchema()
public boolean parseDTD()
public java.awt.Point getLastDTDLocation()
public boolean isBetweenTagDelimiters(int offset)
public boolean isInsideDTDElementDefinition(int offset)
public boolean isInsideDTDAttributeDefinition(int offset)
public java.lang.String[] getElementsFromDTD()
public void removeWithoutStructureDamaged(int offset, int len)
public void remove(int offs, int len) throws javax.swing.text.BadLocationException
javax.swing.text.BadLocationException
public java.awt.Point updateElement(java.lang.String startElement, java.lang.String endElement, int startOffset, int endOffset)
public void updateNode(SimpleNode sn, java.lang.String newContent)
public void updateNodeOpeningClosing(SimpleNode node)
node
- Note to update
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |