1 package org.splat.simer;
3 import org.splat.wapp.SimpleMenu;
6 * Menu selection action.
8 public class MenuAction extends Action {
12 private static final long serialVersionUID = 5904292225286579036L;
23 // ==============================================================================================================================
25 // ==============================================================================================================================
28 * Activate the menu and select the menu item.
30 * @return the selected menu item
32 public String doSelectItem() {
33 SimpleMenu menu = getApplicationSettings().getMenu(_menu);
35 if (_item == null) { // Switch back to the menu, keeping the last selection
36 getSession().put("menu.open", menu); // Activates the menu
38 _item = menu.getSelection();
39 if (_item == null) { // Select default menu item if nothing has been selected
40 _item = menu.getDefaultSelection();
44 } else { // Selection of another menu item
45 getSession().put("menu.open", menu); // Activates the menu
53 // ==============================================================================================================================
54 // Getters and setters
55 // ==============================================================================================================================
58 * Get selected menu item.
59 * @return the selected menu item
61 public String getItem() {
66 * Get current menu name.
67 * @return the menu name
69 public String getMenu() {
74 * Set current menu name.
75 * @param name the menu name
77 public void setMenu(final String name) {
82 * Set the selected menu item.
83 * @param item the selected item
85 public void setItem(final String item) {