ix.util.xml
Class XMLTreeEditPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by ix.util.xml.XMLTreeEditPanel
All Implemented Interfaces:
NamespaceListener, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TreeSelectionListener
Direct Known Subclasses:
XMLTreeViewPanel

public class XMLTreeEditPanel
extends javax.swing.JPanel
implements NamespaceListener, java.awt.event.ActionListener, javax.swing.event.TreeSelectionListener

A panel that contains an XML tree-editor.

See Also:
XMLTreeEditor, XMLTreeEditFrame, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String ATTRIBUTES
           
protected  javax.swing.tree.DefaultTreeModel docModel
           
protected  javax.swing.JSplitPane docSplit
           
protected  ix.util.xml.XMLTreeEditPanel.EditorTree docTree
           
protected  org.jdom.Document document
          The document this panel is editing.
protected  ix.util.xml.XMLTreeEditPanel.EditingTextArea editText
           
protected static ix.util.xml.XMLTreeEditPanel.EditorTree mostRecentlySelectedTree
           
protected  ix.util.xml.XMLTreeEditPanel.TNodeFactory nodeFactory
           
protected  ix.util.xml.XMLTreeEditPanel.TNodeParser nodeParser
           
protected  javax.swing.JButton submitButton
           
protected  ix.util.xml.XMLTreeEditPanel.TemplateSyntax syntax
           
protected  ix.util.xml.XMLTreeEditPanel.EditorTree templateTree
           
protected  javax.swing.JSplitPane textSplit
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
XMLTreeEditPanel()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Action interpreter for panel buttons
 void addChild()
          Adds a new node after the existing children of the selected node.
 void addRootChild(org.jdom.Document doc)
           
 void addTemplate(ix.util.xml.XMLTreeEditPanel.TNode template)
           
 void addTemplates()
           
 void addTemplatesFor(java.lang.Class[] classes)
           
protected  void complain(java.lang.Object message)
           
 void copySubtree()
          Copy the subtree below and including the currently selected node.
 void cutSubtree()
          "Cut" the subtree below and including the currently selected node.
 void editDocument(org.jdom.Document doc)
           
 void editObject(java.lang.Object object)
           
 void expandDocument(int depth)
           
 void findInTree(java.lang.String targetText)
          Finds text in the most recently selected tree even if the tree is not in this panel.
 org.jdom.Document getDocument()
           
protected  XMLTreeEditFrame getEditFrame()
           
protected  java.awt.Color getNamespaceColor(org.jdom.Namespace n)
           
 java.lang.Object getObject()
           
 void hideTemplates()
           
protected  javax.swing.JButton makeButton(java.lang.String command)
           
protected  javax.swing.JPanel makeButtonPanel()
           
protected  ix.util.xml.XMLTreeEditPanel.EditorTree makeTemplateTree()
           
 void namespaceEvent(NamespaceEvent e)
          Something has happened, releted to the source Namespace.
protected  void noteNamespace(org.jdom.Namespace n)
           
protected  void reset()
           
protected  void setDocRoot(ix.util.xml.XMLTreeEditPanel.TNode root)
           
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          Required by the TreeSelectionListener interface.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

document

protected org.jdom.Document document
The document this panel is editing.


ATTRIBUTES

protected static final java.lang.String ATTRIBUTES
See Also:
Constant Field Values

mostRecentlySelectedTree

protected static ix.util.xml.XMLTreeEditPanel.EditorTree mostRecentlySelectedTree

nodeFactory

protected ix.util.xml.XMLTreeEditPanel.TNodeFactory nodeFactory

nodeParser

protected ix.util.xml.XMLTreeEditPanel.TNodeParser nodeParser

syntax

protected ix.util.xml.XMLTreeEditPanel.TemplateSyntax syntax

docTree

protected ix.util.xml.XMLTreeEditPanel.EditorTree docTree

docModel

protected javax.swing.tree.DefaultTreeModel docModel

templateTree

protected ix.util.xml.XMLTreeEditPanel.EditorTree templateTree

editText

protected ix.util.xml.XMLTreeEditPanel.EditingTextArea editText

submitButton

protected javax.swing.JButton submitButton

docSplit

protected javax.swing.JSplitPane docSplit

textSplit

protected javax.swing.JSplitPane textSplit
Constructor Detail

XMLTreeEditPanel

public XMLTreeEditPanel()
Method Detail

reset

protected void reset()

getEditFrame

protected XMLTreeEditFrame getEditFrame()

setDocRoot

protected void setDocRoot(ix.util.xml.XMLTreeEditPanel.TNode root)

editDocument

public void editDocument(org.jdom.Document doc)

getDocument

public org.jdom.Document getDocument()

expandDocument

public void expandDocument(int depth)

addRootChild

public void addRootChild(org.jdom.Document doc)

editObject

public void editObject(java.lang.Object object)

getObject

public java.lang.Object getObject()

findInTree

public void findInTree(java.lang.String targetText)
Finds text in the most recently selected tree even if the tree is not in this panel.


getNamespaceColor

protected java.awt.Color getNamespaceColor(org.jdom.Namespace n)

noteNamespace

protected void noteNamespace(org.jdom.Namespace n)

namespaceEvent

public void namespaceEvent(NamespaceEvent e)
Description copied from interface: NamespaceListener
Something has happened, releted to the source Namespace. For now, we don't quite need anything more specific.

Specified by:
namespaceEvent in interface NamespaceListener

addTemplates

public void addTemplates()

addTemplatesFor

public void addTemplatesFor(java.lang.Class[] classes)

addTemplate

public void addTemplate(ix.util.xml.XMLTreeEditPanel.TNode template)

hideTemplates

public void hideTemplates()

makeTemplateTree

protected ix.util.xml.XMLTreeEditPanel.EditorTree makeTemplateTree()

makeButtonPanel

protected javax.swing.JPanel makeButtonPanel()

makeButton

protected javax.swing.JButton makeButton(java.lang.String command)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Action interpreter for panel buttons

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addChild

public void addChild()
Adds a new node after the existing children of the selected node.


copySubtree

public void copySubtree()
Copy the subtree below and including the currently selected node. This is essentially the same as a "Cut" without deletion, but it also takes a copy of the subtree rather than taking those very nodes.


cutSubtree

public void cutSubtree()
"Cut" the subtree below and including the currently selected node.


complain

protected void complain(java.lang.Object message)

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
Required by the TreeSelectionListener interface. Called for both the document and the template trees.

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener