01: /* SpacerFactory.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 15, 2007 3:31:58 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.Spacer;
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.ZkSpacer;
29:
30: /**
31: * @author henrichen
32: *
33: */
34: public class SpacerFactory extends AbstractUiFactory {
35:
36: public SpacerFactory(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 minWidthStr = attrs.getValue("mw"); //minWidth
44: final String minHeightStr = attrs.getValue("mh"); //minHeight
45: final int minWidth = Integer.parseInt(minWidthStr);
46: final int minHeight = Integer.parseInt(minHeightStr);
47: final ZkDesktop zk = ((ZkComponent) parent).getZkDesktop();
48:
49: final ZkSpacer component = new ZkSpacer(zk, id, minWidth,
50: minHeight);
51:
52: UiManager.applyItemProperties(parent, component, attrs);
53:
54: return component;
55: }
56:
57: }
|