01: package org.wings.macro;
02:
03: import org.wings.io.Device;
04: import org.wings.SComponent;
05:
06: import java.util.HashMap;
07:
08: /**
09: * <code>MacroContext<code>.
10: * <p/>
11: * User: rrd
12: * Date: 13.08.2007
13: * Time: 11:37:00
14: *
15: * @author rrd
16: * @version $Id
17: */
18: public class MacroContext extends HashMap {
19:
20: private enum MacroContextKey {
21: DEVICE, COMPONENT
22: }
23:
24: public void setDevice(Device device) {
25: //noinspection unchecked
26: put(MacroContextKey.DEVICE, device);
27: }
28:
29: public Device getDevice() {
30: return (Device) get(MacroContextKey.DEVICE);
31: }
32:
33: public void setComponent(SComponent component) {
34: // noinspection unchecked
35: put(MacroContextKey.COMPONENT, component);
36: }
37:
38: public SComponent getComponent() {
39: return (SComponent) get(MacroContextKey.COMPONENT);
40: }
41: }
|