com.japisoft.xmlpad.bean
Class XMLEditorKit

java.lang.Object
  |
  +--javax.swing.text.EditorKit
        |
        +--javax.swing.text.DefaultEditorKit
              |
              +--com.japisoft.xmlpad.bean.XMLEditorKit
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, javax.swing.text.ViewFactory

public class XMLEditorKit
extends javax.swing.text.DefaultEditorKit
implements javax.swing.text.ViewFactory

Here a swing EditorKit for XML

Version:
1.2
Author:
(c) 2002 JAPISoft
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.text.DefaultEditorKit
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deletePrevCharAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction
 
Constructor Summary
XMLEditorKit(DefaultXMLDocument doc)
           
 
Method Summary
 javax.swing.text.View create(javax.swing.text.Element elem)
           
 javax.swing.text.Document createDefaultDocument()
           
 java.util.Hashtable getColorsForAttributes()
           
 java.util.Hashtable getColorsForPrefix()
           
 java.util.Hashtable getColorsForTags()
           
 java.lang.String getContentType()
           
 javax.swing.text.ViewFactory getViewFactory()
          View factory for text element
 void setColorForAttribute(java.util.Hashtable htAttColor)
          Define colors for all attributes
 void setColorForAttribute(java.lang.String attributeName, java.awt.Color c)
          Choose a particular color for an attribute
 void setColorForPrefix(java.util.Hashtable htPrefixColor)
          Define colors for all tag prefix
 void setColorForPrefix(java.lang.String prefixName, java.awt.Color c)
          Choose a particular color for a tag prefix
 void setColorForTag(java.util.Hashtable htTagColor)
          Define colors for all tagName
 void setColorForTag(java.lang.String tagName, java.awt.Color c)
          Define a color for this tagName
 
Methods inherited from class javax.swing.text.DefaultEditorKit
createCaret, getActions, read, read, write, write
 
Methods inherited from class javax.swing.text.EditorKit
clone, deinstall, install
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEditorKit

public XMLEditorKit(DefaultXMLDocument doc)
Method Detail

getViewFactory

public javax.swing.text.ViewFactory getViewFactory()
View factory for text element

Overrides:
getViewFactory in class javax.swing.text.DefaultEditorKit

create

public javax.swing.text.View create(javax.swing.text.Element elem)
Specified by:
create in interface javax.swing.text.ViewFactory
Parameters:
elem - element to draw

createDefaultDocument

public javax.swing.text.Document createDefaultDocument()
Overrides:
createDefaultDocument in class javax.swing.text.DefaultEditorKit
Returns:
the default document

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class javax.swing.text.DefaultEditorKit

getColorsForTags

public java.util.Hashtable getColorsForTags()

setColorForTag

public void setColorForTag(java.lang.String tagName,
                           java.awt.Color c)
Define a color for this tagName


setColorForTag

public void setColorForTag(java.util.Hashtable htTagColor)
Define colors for all tagName


setColorForAttribute

public void setColorForAttribute(java.lang.String attributeName,
                                 java.awt.Color c)
Choose a particular color for an attribute


setColorForAttribute

public void setColorForAttribute(java.util.Hashtable htAttColor)
Define colors for all attributes


getColorsForAttributes

public java.util.Hashtable getColorsForAttributes()

setColorForPrefix

public void setColorForPrefix(java.lang.String prefixName,
                              java.awt.Color c)
Choose a particular color for a tag prefix


setColorForPrefix

public void setColorForPrefix(java.util.Hashtable htPrefixColor)
Define colors for all tag prefix


getColorsForPrefix

public java.util.Hashtable getColorsForPrefix()