com.doitnext.swing.widgets.json
Class JSONJTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.doitnext.swing.widgets.json.JSONJTreeNode
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode

public class JSONJTreeNode
extends javax.swing.tree.DefaultMutableTreeNode

Provides the model for translating JsonElement into JTree data nodes. This class is not thread safe.

Author:
Stephen Owens

Provides the model for translating JsonElement into JTree data nodes.

Copyright 2011 Stephen P. Owens : steve@doitnext.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See Also:
Serialized Form

Nested Class Summary
static class JSONJTreeNode.DataType
           
 
Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
JSONJTreeNode(java.lang.String fieldName, int index, com.google.gson.JsonElement jsonElement)
           
 
Method Summary
 com.google.gson.JsonElement asJsonElement()
           
 java.lang.String toString()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSONJTreeNode

public JSONJTreeNode(java.lang.String fieldName,
                     int index,
                     com.google.gson.JsonElement jsonElement)
Parameters:
fieldName - - name of field if applicable or null
index - - index of element in the array or -1 if not part of an array
jsonElement - - element to represent
Method Detail

asJsonElement

public com.google.gson.JsonElement asJsonElement()

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode


Copyright © 2011 Stephen P. Owens. All Rights Reserved.