01: /* ZkFactory.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 16, 2007 5:44:29 PM, Created by henrichen
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zkmob.factory;
20:
21: import javax.microedition.lcdui.Command;
22:
23: import org.xml.sax.Attributes;
24: import org.zkoss.zkmob.ZkComponent;
25: import org.zkoss.zkmob.ui.ZkDesktop;
26:
27: /**
28: * Empty implementation; the root tag for MIL file.
29: * @author henrichen
30: *
31: */
32: public class ZkFactory extends AbstractUiFactory {
33: public ZkFactory(String name) {
34: super (name);
35: }
36:
37: public ZkComponent create(ZkComponent parent, String tag,
38: Attributes attrs, String hostURL, String pathURL) {
39: final String dtid = attrs.getValue("id"); //desktop id
40: final String action = attrs.getValue("za"); //zk_action
41: final String proctoStr = attrs.getValue("zp"); //zk_procto
42: final int procto = proctoStr != null ? Integer
43: .parseInt(proctoStr) : 900;
44: final String tiptoStr = attrs.getValue("zt"); //zk_tipto
45: final int tipto = tiptoStr != null ? Integer.parseInt(tiptoStr)
46: : 800;
47: final String ver = attrs.getValue("zv"); //zk_ver
48:
49: ZkDesktop zk = new ZkDesktop(dtid, action, procto, tipto, ver,
50: hostURL, pathURL);
51:
52: return zk;
53: }
54: }
|