1 package org.splat.simer;
3 import org.splat.wapp.SimpleMenu;
6 public class MenuAction extends Action {
8 private String menuname;
9 private String selection;
11 private static final long serialVersionUID = 5904292225286579036L;
13 // ==============================================================================================================================
15 // ==============================================================================================================================
17 public String doSelectItem () {
18 // -----------------------------
19 SimpleMenu menu = ApplicationSettings.getMenu(menuname);
21 if (selection == null) { // Switch back to the menu, keeping the last selection
22 getSession().put("menu.open", menu); // Activates the menu
23 selection = menu.getSelection();
24 if (selection == null) selection = "none";
25 } else { // Selection of another menu item
26 menu.selects(selection);
31 // ==============================================================================================================================
32 // Getters and setters
33 // ==============================================================================================================================
35 public String getItem () {
36 // ------------------------
39 public String getMenu () {
40 // ------------------------
44 public void setMenu (String name) {
45 // ---------------------------------
48 public void setItem (String item) {
49 // ---------------------------------
50 this.selection = item;