KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > ejosa > piggybank > presentation > enhydra > FoundationSessionData


1 /**
2  * Title: OpenUSS - Open Source University Support System
3  * My Piggy Bank Example
4  * Description: Enhydra Presentation Object
5  * Copyright: Copyright (c) 2003 by B. Lofi Dewanto, T. Menzel
6  * Company: University of Muenster, HTWK Leipzig
7  * @author B. Lofi Dewanto, T. Menzel
8  * @version 1.1
9  */

10 package net.sourceforge.ejosa.piggybank.presentation.enhydra;
11
12 import java.util.*;
13
14 import org.openuss.presentation.enhydra.framework.*;
15
16
17 /**
18  * The base session object for foundation components.
19  *
20  * @author B. Lofi Dewanto, T. Menzel
21  * @version 1.1
22  */

23 public class FoundationSessionData extends BaseSessionData {
24     /**
25      * Session key for foundation components.
26      */

27     public static final String JavaDoc SESSION_KEY = "FoundationSessionData";
28
29     /**
30      * Data for the base session.
31      */

32
33     // English and USA are the standard locale
34
protected Locale myLocale = new Locale("en", "US");
35     protected String JavaDoc userMessage = null;
36
37     /**
38      * Sets the locale.
39      */

40     public void setLocale(Locale locale) {
41         this.myLocale = locale;
42     }
43
44     /**
45      * Gets the locale.
46      */

47     public Locale getLocale() {
48         return this.myLocale;
49     }
50
51     /**
52      * Set the message.
53      * This should be used for a short use.
54      */

55     public void setUserMessage(String JavaDoc msg) {
56         this.userMessage = msg;
57     }
58
59     /**
60      * Retrieve the most recent user message and then clear it so no
61      * other app tries to use it.
62      * This should be used for a short use.
63      */

64     public String JavaDoc getAndClearUserMessage() {
65         String JavaDoc msg = this.userMessage;
66         this.userMessage = null;
67
68         return msg;
69     }
70 }
Popular Tags