]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/src/org/splat/simer/MenuAction.java
Salome HOME
Refactoring of Database, replacing SQL by DAOs calls. Methods for search by criteria...
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / MenuAction.java
1 package org.splat.simer;
2
3 import org.splat.wapp.SimpleMenu;
4
5
6 public class MenuAction extends Action {
7
8     private String menuname;
9         private String selection;
10
11         /**
12          * Serial version ID.
13          */
14         private static final long serialVersionUID = 5904292225286579036L;
15
16 //  ==============================================================================================================================
17 //  Action methods
18 //  ==============================================================================================================================
19
20     public String doSelectItem () {
21 //  -----------------------------
22       SimpleMenu  menu = ApplicationSettings.getMenu(menuname);
23         
24       if (selection == null) {                 // Switch back to the menu, keeping the last selection
25                 getSession().put("menu.open", menu);   // Activates the menu
26         selection = menu.getSelection();
27         if (selection == null) selection = "none";
28       } else {                                     // Selection of another menu item
29         menu.selects(selection);
30       }
31       return selection;
32     }
33
34 //  ==============================================================================================================================
35 //  Getters and setters
36 //  ==============================================================================================================================
37
38     public String getItem () {
39 //  ------------------------
40       return selection;
41     }
42     public String getMenu () {
43 //  ------------------------
44       return menuname;
45     }
46
47     public void setMenu (String name) {
48 //  ---------------------------------
49       this.menuname = name;
50     }
51     public void setItem (String item) {
52 //  ---------------------------------
53       this.selection = item;
54     }
55 }