01: /* MilFns.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 30, 2007 4:40:28 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:
20: package org.zkoss.mil.fn;
21:
22: import org.zkoss.zk.ui.Desktop;
23: import org.zkoss.zk.ui.Executions;
24: import org.zkoss.zk.ui.WebApp;
25: import org.zkoss.zk.ui.util.Configuration;
26:
27: /**
28: * Utility for use EL.
29: *
30: * @author henrichen
31: */
32: public class MilFns {
33:
34: /**
35: * Get ZK Desktop and Page attributes.
36: */
37: public static final String desktopAttrs(String action) {
38: if (action == null)
39: throw new IllegalArgumentException("null");
40:
41: final Desktop desktop = Executions.getCurrent().getDesktop();
42: final WebApp wapp = desktop.getWebApp();
43: final Configuration config = wapp.getConfiguration();
44: final StringBuffer sb = new StringBuffer(64);
45: sb.append(" za=\"").append(action).append("\"")
46: .append(" zp=\"").append(
47: config.getProcessingPromptDelay()).append("\"")
48: .append(" zt=\"").append(config.getTooltipDelay())
49: .append("\"").append(" zv=\"")
50: .append(wapp.getVersion()).append("\"");
51: return sb.toString();
52: }
53: }
|