use of com.twinsoft.convertigo.eclipse.views.projectexplorer.PropertyData in project convertigo by convertigo.
the class PropertyTableTreeObject method read.
public static Object read(Node node) throws EngineException {
String classname = null;
XMLVector<Object> xmlv = null;
try {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
classname = element.getAttribute("classname");
xmlv = new XMLVector<Object>();
}
} catch (Exception e) {
String message = "Unable to set the object properties from the serialized XML data.\n" + "Object class: '" + classname;
EngineException ee = new EngineException(message, e);
throw ee;
}
if (xmlv != null)
return new PropertyData(PropertyTableTreeObject.class, xmlv);
return null;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.PropertyData in project convertigo by convertigo.
the class PropertyTableTreeObject method add.
public IPropertyTreeObject add(Object object, boolean bChangeName) {
if (object instanceof PropertyData) {
PropertyData propertyData = (PropertyData) object;
Class<? extends TreeParent> c = propertyData.getOwnerClass();
if (c.equals(getRowClass())) {
XMLVector<Object> row = propertyData.getData();
if (bChangeName)
row.set(0, getAvailableRowName((String) row.get(0), 0));
return addRow(newRow(row));
} else if (c.equals(getClass())) {
reloadRows();
return this;
}
} else if (object instanceof PropertyTableRowTreeObject) {
return addRow((PropertyTableRowTreeObject) object);
}
return null;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.PropertyData in project convertigo by convertigo.
the class PropertyTableColumnTreeObject method add.
public IPropertyTreeObject add(Object object, boolean bChangeName) {
if (object instanceof PropertyData) {
PropertyData propertyData = (PropertyData) object;
Class<? extends TreeParent> c = propertyData.getOwnerClass();
if (c.equals(getClass())) {
PropertyTableRowTreeObject row = getParentRow();
if (row != null)
return row.add(object, bChangeName);
}
} else if (object instanceof PropertyTableColumnTreeObject) {
PropertyTableRowTreeObject row = getParentRow();
if (row != null)
return row.add(object, false);
}
return null;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.PropertyData in project convertigo by convertigo.
the class PropertyTableColumnTreeObject method read.
public static Object read(Node node) throws EngineException {
String classname = null;
XMLVector<Object> xmlv = null;
try {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
classname = element.getAttribute("classname");
xmlv = new XMLVector<Object>();
NodeList childNodes = node.getChildNodes();
int len = childNodes.getLength();
for (int i = 0; i < len; i++) {
Node childNode = childNodes.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE)
continue;
String childNodeName = childNode.getNodeName();
if ((childNodeName.equalsIgnoreCase("property"))) {
NodeList childValues = childNode.getChildNodes();
for (int j = 0; j < childValues.getLength(); j++) {
Node childValue = childValues.item(j);
if (childValue.getNodeType() != Node.ELEMENT_NODE)
continue;
Object value = XMLUtils.readObjectFromXml((Element) childValue);
xmlv.add(value);
break;
}
}
}
}
} catch (Exception e) {
String message = "Unable to set the object properties from the serialized XML data.\n" + "Object class: '" + classname;
EngineException ee = new EngineException(message, e);
throw ee;
}
if (xmlv != null)
return new PropertyData(PropertyTableColumnTreeObject.class, xmlv);
return null;
}
use of com.twinsoft.convertigo.eclipse.views.projectexplorer.PropertyData in project convertigo by convertigo.
the class PropertyTableRowTreeObject method read.
public static Object read(Node node) throws EngineException {
String classname = null;
XMLVector<Object> xmlv = null;
try {
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
classname = element.getAttribute("classname");
xmlv = new XMLVector<Object>();
NodeList childNodes = node.getChildNodes();
int len = childNodes.getLength();
Node childNode, childValue;
String childNodeName, propertyName;
for (int i = 0; i < len; i++) {
childNode = childNodes.item(i);
if (childNode.getNodeType() != Node.ELEMENT_NODE)
continue;
childNodeName = childNode.getNodeName();
if ((childNodeName.equalsIgnoreCase("property"))) {
propertyName = ((Element) childNode).getAttribute("name");
if (propertyName.equalsIgnoreCase("columns")) {
xmlv.add(new XMLVector<Object>());
} else {
NodeList childValues = childNode.getChildNodes();
for (int j = 0; j < childValues.getLength(); j++) {
childValue = childValues.item(j);
if (childValue.getNodeType() != Node.ELEMENT_NODE)
continue;
Object value = XMLUtils.readObjectFromXml((Element) childValue);
xmlv.add(value);
break;
}
}
}
}
}
} catch (Exception e) {
String message = "Unable to set the object properties from the serialized XML data.\n" + "Object class: '" + classname;
EngineException ee = new EngineException(message, e);
throw ee;
}
if (xmlv != null) {
return new PropertyData(PropertyTableRowTreeObject.class, xmlv);
}
return null;
}
Aggregations