01: /* StringItemFactory.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 15, 2007 3:25:44 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.Form;
22: import javax.microedition.lcdui.StringItem;
23:
24: import org.xml.sax.Attributes;
25: import org.zkoss.zkmob.ZkComponent;
26: import org.zkoss.zkmob.UiManager;
27: import org.zkoss.zkmob.ui.ZkDesktop;
28: import org.zkoss.zkmob.ui.ZkStringItem;
29:
30: /**
31: * @author henrichen
32: *
33: */
34: public class StringItemFactory extends AbstractUiFactory {
35:
36: public StringItemFactory(String name) {
37: super (name);
38: }
39:
40: public ZkComponent create(ZkComponent parent, String tag,
41: Attributes attrs, String hostURL, String pathURL) {
42: final String id = attrs.getValue("id"); //id
43: final String label = attrs.getValue("lb"); //label
44: final String text = attrs.getValue("tx"); //text
45: final ZkDesktop zk = ((ZkComponent) parent).getZkDesktop();
46:
47: final ZkStringItem component = new ZkStringItem(zk, id, label,
48: text);
49:
50: UiManager.applyItemProperties(parent, component, attrs);
51:
52: return component;
53: }
54: }
|