package org.tizen.webuibuilder.model.app.io;
import java.util.ArrayList;
-import java.util.Iterator;
+ import java.util.HashMap;
import java.util.List;
+ import java.util.Map;
--import org.w3c.dom.Attr;
--import org.w3c.dom.Document;
--import org.w3c.dom.Element;
--import org.w3c.dom.NamedNodeMap;
--import org.w3c.dom.Node;
--import org.w3c.dom.NodeList;
import org.tizen.webuibuilder.BuilderConstants;
import org.tizen.webuibuilder.model.Part;
import org.tizen.webuibuilder.model.PartFactory;
import org.tizen.webuibuilder.model.css.CssSelector;
import org.tizen.webuibuilder.model.filedata.HtmlMetaFileData;
import org.tizen.webuibuilder.model.io.file.TizenFileFormatter;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.Scan;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingData;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingObject;
-import org.tizen.webuibuilder.ui.views.nscreen.model.NScreenModel;
++import org.w3c.dom.Attr;
++import org.w3c.dom.Document;
++import org.w3c.dom.Element;
++import org.w3c.dom.NamedNodeMap;
++import org.w3c.dom.Node;
++import org.w3c.dom.NodeList;
public class HtmlMetaReader_ver_1 {
Part childpart = null;
for (int i = 0; i < elem.getChildNodes().getLength(); i++) {
child = elem.getChildNodes().item(i);
- if (child instanceof Element) {
- if (child.getNodeName().equals("event")) {
- attrList = child.getAttributes();
- for (int j = 0; j < attrList.getLength(); j++) {
- Attr eventAttr = (Attr) attrList.item(j);
- part.setEventValue(eventAttr.getName(), eventAttr.getValue());
- }
- } else if (child.getNodeName().equals("gotoPage")) {
- List<String> strList = new ArrayList<String>();
-
- attrList = child.getAttributes();
- for (int j = 0; j < attrList.getLength(); j++) {
- Attr eventAttr = (Attr) attrList.item(j);
- strList.add(eventAttr.getValue());
- }
- part.setGotoPageEventValue(strList.get(0), strList.get(1), strList.get(2));
-
- } else {
- childpart = parseElement(fileData, (Element) child, partFactory, selectors);
- part.addChildWhenPageRead(childpart);
- }
- }
+ if(child instanceof Element){
+ if (child.getNodeName().equals("event")) {
+ attrList = child.getAttributes();
+ for (int j = 0; j < attrList.getLength(); j++) {
+ Attr eventAttr = (Attr) attrList.item(j);
+ part.setEventValue(eventAttr.getName(), eventAttr.getValue());
+ }
+ } else if (child.getNodeName().equals("gotoPage")) {
+ attrList = child.getAttributes();
+ String event = ((Attr)attrList.getNamedItem("event")).getValue();
+ String destinationPage = ((Attr)attrList.getNamedItem("destinationPage")).getValue();
+ String transition = ((Attr)attrList.getNamedItem("transition")).getValue();
+
+ part.setGotoPageEventValue(event, destinationPage, transition);
+ } else if (child.getNodeName().equals("openUrl")) {
+ attrList = child.getAttributes();
+ String event = ((Attr)attrList.getNamedItem("event")).getValue();
+ String url = ((Attr)attrList.getNamedItem("url")).getValue();
+
+ part.setOpenUrlEventValue(event, url);
+ } else {
+ childpart = parseElement(fileData, (Element)child, partFactory, selectors);
+ part.addChildWhenPageRead(childpart);
+ }
+ }
}
}
--
return part;
}
-
+
}