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
50 // ==============================================================================================================================
51 // Getters and setters
52 // ==============================================================================================================================
55 * Get selected menu item.
56 * @return the selected menu item
58 public String getItem() {
63 * Get current menu name.
64 * @return the menu name
66 public String getMenu() {
71 * Set current menu name.
72 * @param name the menu name
74 public void setMenu(final String name) {
79 * Set the selected menu item.
80 * @param item the selected item
82 public void setItem(final String item) {