Salome HOME
Addition of a new scenario to a study is fixed. StudyMenu and NewScenarioMenu are...
[tools/siman.git] / Workspace / Siman / src / org / splat / wapp / Item.java
1 package org.splat.wapp;
2
3 import java.io.Serializable;
4
5
6 public class Item implements Serializable {
7
8         private String  mylabel;
9     private String  myicon;
10     private String  myurl;
11     private boolean selected = false;
12
13         /**
14          * Serial version ID.
15          */
16         private static final long serialVersionUID = -3505572710372809913L;
17
18 //  ==============================================================================================================================
19 //  Construction
20 //  ==============================================================================================================================
21
22     public Item (String label) {
23 //  -------------------------
24       mylabel = label;
25       myicon  = null;
26       myurl   = null;
27     }
28     public Item (String label, String url) {
29 //  -------------------------------------
30       mylabel = label;
31       myicon  = null;
32       myurl   = url;
33     }
34     public Item (String label, String icon, String url) {
35 //  ---------------------------------------------------
36       mylabel = label;
37       myicon  = icon;
38       myurl   = url;
39     }
40     public Item action (String url) {
41 //  -------------------------------
42       myurl  = url;
43       return this;
44     }
45     public Item icon (String icon) {
46 //  ------------------------------
47       myicon = icon;
48       return this;
49     }
50
51 //  ==============================================================================================================================
52 //  Member functions
53 //  ==============================================================================================================================
54
55     public String getAction () {
56 //  --------------------------
57       return myurl;                // Null if not enabled
58     }
59
60     public String getIcon () {
61 //  ------------------------
62       return myicon;
63     }
64
65         public String getLabel () {
66 //  -------------------------
67       return mylabel;
68     }
69
70     public boolean isEnabled () {
71 //  ---------------------------
72       return (myurl != null);
73     }
74
75     public boolean isSelected () {
76 //  ----------------------------
77       return selected;
78     }
79
80     protected void select () {
81 //  ------------------------
82       selected = true;
83     }
84
85     protected void unselect () {
86 //  --------------------------
87       selected = false;
88     }
89 }