01: /* ListFactory.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 15, 2007 3:12:00 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 org.xml.sax.Attributes;
22: import org.zkoss.zkmob.ZkComponent;
23: import org.zkoss.zkmob.ui.ZkList;
24:
25: /**
26: * An UiFactory used to create a List Ui component.
27: *
28: * @author henrichen
29: *
30: */
31: public class ListFactory extends AbstractUiFactory {
32: public ListFactory(String name) {
33: super (name);
34: }
35:
36: public ZkComponent create(ZkComponent parent, String tag,
37: Attributes attrs, String hostURL, String pathURL) {
38: final String id = attrs.getValue("id"); //id
39: final String title = attrs.getValue("tt"); //title
40: final String listTypeStr = attrs.getValue("tp"); //listType
41: final int listType = Integer.parseInt(listTypeStr);
42:
43: final ZkList list = new ZkList(((ZkComponent) parent)
44: .getZkDesktop(), id, title, listType);
45: return list;
46: }
47:
48: }
|