]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman/src/org/splat/wapp/Item.java
Salome HOME
929f399035f16b01853f6a5e0fad5d81e4425073
[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         private static final long serialVersionUID = -3505572710372809913L;
14
15 //  ==============================================================================================================================
16 //  Construction
17 //  ==============================================================================================================================
18
19     public Item (String label) {
20 //  -------------------------
21       mylabel = label;
22       myicon  = null;
23       myurl   = null;
24     }
25     public Item (String label, String url) {
26 //  -------------------------------------
27       mylabel = label;
28       myicon  = null;
29       myurl   = url;
30     }
31     public Item (String label, String icon, String url) {
32 //  ---------------------------------------------------
33       mylabel = label;
34       myicon  = icon;
35       myurl   = url;
36     }
37     public Item action (String url) {
38 //  -------------------------------
39       myurl  = url;
40       return this;
41     }
42     public Item icon (String icon) {
43 //  ------------------------------
44       myicon = icon;
45       return this;
46     }
47
48 //  ==============================================================================================================================
49 //  Member functions
50 //  ==============================================================================================================================
51
52     public String getAction () {
53 //  --------------------------
54       return myurl;                // Null if not enabled
55     }
56
57     public String getIcon () {
58 //  ------------------------
59       return myicon;
60     }
61
62         public String getLabel () {
63 //  -------------------------
64       return mylabel;
65     }
66
67     public boolean isEnabled () {
68 //  ---------------------------
69       return (myurl != null);
70     }
71
72     public boolean isSelected () {
73 //  ----------------------------
74       return selected;
75     }
76
77     protected void select () {
78 //  ------------------------
79       selected = true;
80     }
81
82     protected void unselect () {
83 //  --------------------------
84       selected = false;
85     }
86 }