1 19 20 package org.netbeans.modules.websvc.registry.ui; 21 22 import com.sun.xml.rpc.processor.model.java.JavaArrayType; 23 import java.lang.reflect.Array ; 24 import org.netbeans.swing.outline.RowModel; 25 import org.openide.ErrorManager; 26 27 28 import com.sun.xml.rpc.processor.model.java.JavaType; 29 import com.sun.xml.rpc.processor.model.java.JavaSimpleType; 30 import com.sun.xml.rpc.processor.model.java.JavaEnumerationType; 31 32 import org.openide.util.NbBundle; 33 import javax.swing.tree.DefaultMutableTreeNode ; 34 35 39 public class ResultRowModel implements RowModel { 40 41 42 public ResultRowModel() { 43 } 44 45 public Class getColumnClass(int column) { 46 switch(column) { 47 case 0: return Object .class; 49 default: return String .class; 50 } 51 } 52 53 public int getColumnCount() { 54 return 1; 55 } 56 57 public String getColumnName(int column) { 58 switch(column) { 59 case 0: return NbBundle.getMessage(this.getClass(), "PARAM_VALUE"); 61 default: return ""; 62 } 63 64 } 65 66 public Object getValueFor(Object inNode, int column) { 67 if(null == inNode) return null; 68 DefaultMutableTreeNode node = (DefaultMutableTreeNode )inNode; 69 if(null == node.getUserObject()) return null; 70 NodeData data = (NodeData)node.getUserObject(); 71 72 switch(column) { 73 case 0: { 75 if (data.getNodeType() instanceof JavaArrayType) { 76 return "[]"; 77 } 78 Object val = data.getNodeValue(); 79 if (val instanceof java.util.Calendar ) 80 return java.text.DateFormat.getDateTimeInstance().format(((java.util.Calendar )val).getTime()); 81 return val; 82 } 83 default: return ""; 84 } 85 86 } 87 88 public boolean isCellEditable(Object inNode, int column) { 89 return true; 90 } 91 92 public void setValueFor(Object inNode, int column, Object value) { 93 return; 94 } 95 } 96 | Popular Tags |