01: /* FormFactory.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Tue May 15 14:58:13 2007, 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.Form;
22:
23: import org.xml.sax.Attributes;
24: import org.zkoss.zkmob.ZkComponent;
25: import org.zkoss.zkmob.ui.ZkDesktop;
26: import org.zkoss.zkmob.ui.ZkForm;
27:
28: /**
29: * A UiFactory that create a Form Ui component.
30: *
31: * @author henrichen
32: */
33: public class FormFactory extends AbstractUiFactory {
34: public FormFactory(String name) {
35: super (name);
36: }
37:
38: public ZkComponent create(ZkComponent parent, String tag,
39: Attributes attrs, String hostURL, String pathURL) {
40: final String id = attrs.getValue("id"); //id
41: final String title = attrs.getValue("tt"); //title
42:
43: ZkForm form = new ZkForm(((ZkComponent) parent).getZkDesktop(),
44: id, title);
45:
46: form.setItemStateListener(((ZkDesktop) parent)
47: .getItemStateListener());
48:
49: return form;
50: }
51: }
|