001: package com.xoetrope.carousel.builder;
002:
003: import java.util.List;
004: import java.util.Map;
005: import net.xoetrope.xui.data.XModel;
006:
007: public class XFormInfoTreeTableAdapter extends XModel {
008: private List<String> propertyList;
009: private Map<String, Object> fieldProperties;
010: private XFormGeneratorInfo childPanelInfo;
011:
012: public XFormInfoTreeTableAdapter(List<String> aPropertyList,
013: Map<String, Object> aFieldProperties) {
014: propertyList = aPropertyList;
015: fieldProperties = aFieldProperties;
016: childPanelInfo = (XFormGeneratorInfo) fieldProperties
017: .get("childPanel");
018: }
019:
020: public String getId() {
021: return "id";
022: }
023:
024: public void set(String arg0, Object arg1) {
025:
026: }
027:
028: public int getAttribute(String arg0) {
029: return 0;
030: }
031:
032: public String getAttribValueAsString(int idx) {
033: String attribName = getAttribName(idx);
034: Object property = fieldProperties.get(attribName);
035: return (property != null) ? property.toString() : "null";
036: }
037:
038: public void setAttribValue(int idx, Object value) {
039: String attribName = getAttribName(idx);
040: fieldProperties.put(attribName, value.toString());
041: }
042:
043: public Object getAttribValue(int idx) {
044: String attribName = getAttribName(idx);
045: return fieldProperties.get(attribName);
046: }
047:
048: public void setAttribValue(int arg0, String arg1, Object arg2) {
049: }
050:
051: public XModel get(int idx) {
052: List<String> pl = childPanelInfo.getPropertyList();
053: Map<String, Object> fp = childPanelInfo.getFieldProperties(idx);
054: return new XFormInfoTreeTableAdapter(pl, fp);
055: }
056:
057: public int getNumChildren() {
058: return (childPanelInfo != null ? childPanelInfo.getNumFields()
059: : 0);
060: }
061:
062: public Object get() {
063: return null;
064: }
065:
066: public void set(Object arg0) {
067: }
068:
069: public String getAttribName(int idx) {
070: return propertyList.get(idx);
071: }
072:
073: public int getNumAttributes() {
074: return propertyList.size();
075: }
076:
077: public double getAttribValueAsDouble(int arg0) {
078: return 0.0;
079: }
080:
081: public double getAttribValueAsDouble(int arg0, char arg1, char arg2) {
082: return 0.0;
083: }
084:
085: public int getAttribValueAsInt(int arg0) {
086: throw new UnsupportedOperationException("Not supported yet.");
087: }
088:
089: public double getValueAsDouble(String arg0) {
090: throw new UnsupportedOperationException("Not supported yet.");
091: }
092:
093: public int getValueAsInt(String arg0) {
094: throw new UnsupportedOperationException("Not supported yet.");
095: }
096:
097: public String getValueAsString(String arg0) {
098: throw new UnsupportedOperationException("Not supported yet.");
099: }
100:
101: public int hashCode() {
102: throw new UnsupportedOperationException("Not supported yet.");
103: }
104:
105: public void append(XModel arg0) {
106: throw new UnsupportedOperationException("Not supported yet.");
107: }
108:
109: public Object append(String arg0) {
110: throw new UnsupportedOperationException("Not supported yet.");
111: }
112:
113: }
|