01: package com.salmonllc.examples.example10;
02:
03: import com.salmonllc.jsp.*;
04: import com.salmonllc.localizer.LanguagePreferences;
05: import com.salmonllc.html.events.*;
06:
07: public class InterController extends JspController implements
08: SubmitListener {
09:
10: public com.salmonllc.html.HtmlSubmitButton _english;
11: public com.salmonllc.html.HtmlSubmitButton _spanish;
12: public com.salmonllc.html.HtmlSubmitButton _turkish;
13: public com.salmonllc.html.HtmlSubmitButton _default;
14:
15: public void initialize() {
16: _english.addSubmitListener(this );
17: _spanish.addSubmitListener(this );
18: _turkish.addSubmitListener(this );
19: _default.addSubmitListener(this );
20: }
21:
22: public boolean submitPerformed(SubmitEvent e) throws Exception {
23: LanguagePreferences pr = null;
24: if (e.getSource() == _english)
25: pr = new LanguagePreferences("en");
26: else if (e.getSource() == _spanish)
27: pr = new LanguagePreferences("es");
28: else if (e.getSource() == _turkish)
29: pr = new LanguagePreferences("tr");
30:
31: if (pr != null)
32: setLanguagePrefrence(pr);
33: else
34: clearLanguagePreferences();
35:
36: clearPageFromSession();
37: return true;
38: }
39:
40: }
|