Revision 8225 trunk/extensions/extWFS2/src/com/iver/cit/gvsig/gui/panels/AttributesTableModel.java

View differences:

AttributesTableModel.java
57 57
 *
58 58
 * $Id$
59 59
 * $Log$
60
 * Revision 1.1  2006-10-23 07:37:04  jorpiell
60
 * Revision 1.2  2006-10-23 08:17:18  jorpiell
61
 * Algunos cambios realizados para tener un ?rbol com m?s de una ra?z
62
 *
63
 * Revision 1.1  2006/10/23 07:37:04  jorpiell
61 64
 * Ya funciona el filterEncoding
62 65
 *
63 66
 *
......
75 78
	private Object[] attributes = null;
76 79
	
77 80
	public AttributesTableModel(Object[] attributes) { 
78
		super(attributes[2]); 
81
		super(attributes); 
79 82
		this.attributes = attributes;
80 83
	}	
81 84

  
......
96 99
	//
97 100
	
98 101
	public int getChildCount(Object node) { 
102
		if (node instanceof AbstractTreeTableModel.Root){
103
			return ((AbstractTreeTableModel.Root)node).getChildCount();
104
		}
99 105
		XMLElement element = (XMLElement)node;			
100 106
		if (element.getEntityType().getType() == IXMLType.COMPLEX){
101 107
			return ((XMLComplexType)element.getEntityType()).getAttributes().size();
......
105 111
	}
106 112
	
107 113
	public Object getChild(Object node, int i) { 
114
		if (node instanceof AbstractTreeTableModel.Root){
115
			return ((AbstractTreeTableModel.Root)node).getChildren()[i];
116
		}
108 117
		XMLElement element = (XMLElement)node;			
109 118
		if (element.getEntityType().getType() == IXMLType.COMPLEX){
110 119
			Vector vector = ((XMLComplexType)element.getEntityType()).getAttributes();
......
115 124
	
116 125
	// The superclass's implementation would work, but this is more efficient. 
117 126
	public boolean isLeaf(Object node) { 
127
		if (node instanceof AbstractTreeTableModel.Root){
128
			return false;
129
		}
118 130
		XMLElement element = (XMLElement)node;			
119 131
		if (element.getEntityType().getType() == IXMLType.COMPLEX){
120 132
			return false;
......
139 151
	}
140 152
	
141 153
	public Object getValueAt(Object node, int column) {
154
		if (node instanceof AbstractTreeTableModel.Root){
155
			return "";
156
		}
142 157
		XMLElement element = (XMLElement)node;	
143 158
		try {
144 159
			switch(column) {

Also available in: Unified diff