01: package net.sf.memoranda.util;
02:
03: import java.awt.event.ActionEvent;
04: import java.awt.event.ActionListener;
05:
06: import net.sf.memoranda.ui.AppFrame;
07:
08: /**
09: * <p>Title: </p>
10: * <p>Description: </p>
11: * <p>Copyright: Copyright (c) 2002</p>
12: * <p>Company: </p>
13: * @author unascribed
14: * @version 1.0
15: */
16:
17: /*$Id: Context.java,v 1.3 2004/01/30 12:17:42 alexeya Exp $*/
18: public class Context {
19:
20: public static LoadableProperties context = new LoadableProperties();
21:
22: static {
23: CurrentStorage.get().restoreContext();
24: AppFrame.addExitListener(new ActionListener() {
25: public void actionPerformed(ActionEvent e) {
26: CurrentStorage.get().storeContext();
27: }
28: });
29: }
30:
31: public static Object get(Object key) {
32: return context.get(key);
33: }
34:
35: public static void put(Object key, Object value) {
36: context.put(key, value);
37: }
38:
39: }
|