|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTree
com.lightdev.lib.xml.ui.JXmlTree
public class JXmlTree
Component to show and manipulate a given XML tag structure in a tree.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTree |
|---|
JTree.DropLocation, JTree.DynamicUtilTreeNode |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
static String |
ENCODING_ATTR
|
| 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 | |
|---|---|
JXmlTree(File file)
constructor |
|
| Method Summary | |
|---|---|
void |
buildTreeFromFile(File file)
read a given file and build tree content from it |
void |
editingCanceled(ChangeEvent e)
unused here |
void |
editingStopped(ChangeEvent e)
use this event handler to update the node title |
String |
getEncoding(File file)
get the encoding for a given XML string |
XmlTag |
getTagForNode(DefaultMutableTreeNode node)
get the XmlTag for a particular tree node |
void |
handleEndTag(String tagName)
this method is called by XmlParser when an end tag is encountered in the data that
is being parsed. |
void |
handleStartTag(String tagName,
AttributeSet a)
this method is called by XmlParser when a start tag is encountered in the data that
is being parsed. |
void |
handleText(String text)
this method is called by XmlParser when a portion of content text has been parsed. |
void |
saveTreeToFile(File file)
save tree content to an XML file |
void |
valueChanged(TreeSelectionEvent e)
Called whenever the value of the selection changes. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ENCODING_ATTR
| Constructor Detail |
|---|
public JXmlTree(File file)
file - File the file to construct an XML tree from| Method Detail |
|---|
public String getEncoding(File file)
file - File the file to get encoding for
public void buildTreeFromFile(File file)
file - File the file to read frompublic void saveTreeToFile(File file)
file - File the file to write topublic XmlTag getTagForNode(DefaultMutableTreeNode node)
node - DefaultMutableTreeNode the node to get the tag for
public void handleStartTag(String tagName,
AttributeSet a)
XmlParser when a start tag is encountered in the data that
is being parsed.
handleStartTag in interface XmlParserCallbacktagName - the name of the tag that has been encountereda - the attributes of the tag that has been encounteredXmlParserpublic void handleEndTag(String tagName)
XmlParser when an end tag is encountered in the data that
is being parsed.
handleEndTag in interface XmlParserCallbacktagName - the name of the tag that has been encounteredXmlParserpublic void handleText(String text)
XmlParser when a portion of content text has been parsed.
handleText in interface XmlParserCallbacktext - the text portion that has been parsedXmlParserpublic void editingStopped(ChangeEvent e)
editingStopped in interface CellEditorListenere - ChangeEventpublic void editingCanceled(ChangeEvent e)
editingCanceled in interface CellEditorListenere - ChangeEventpublic void valueChanged(TreeSelectionEvent e)
valueChanged in interface TreeSelectionListenere - the event that characterizes the change.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||