Salome HOME
SIMAN Eclipse workspace first version
[tools/siman.git] / Workspace / Siman / src / org / splat / wapp / PopupItem.java
1 package org.splat.wapp;
2
3
4 public class PopupItem extends ContextualMenu.ContextualItem {
5
6 //  ==============================================================================================================================
7 //  Construction
8 //  ==============================================================================================================================
9
10     protected PopupItem () {
11 //  ----------------------
12 //    myicon  = "image.hr.png";
13     }
14     public PopupItem (String label) {
15 //  -------------------------------
16       mylabel = label;
17       myicon  = "image.hold.gif";              // Default icon
18     }
19 //  Optional attributes
20     public PopupItem action (String url) {     // Enables the item
21 //  --------------------------------------
22       this.setAction(url);
23       return this;
24     }
25     public PopupItem confirmation (String message) {
26 //  ----------------------------------------------
27       confirm = message;
28       return this;
29     }
30     public PopupItem icon (String icon) {
31 //  -----------------------------------
32       myicon = icon;
33       return this;
34     }
35     public PopupItem rename (String label) {
36 //  --------------------------------------
37       mylabel = label;
38       return this;
39     }
40         
41 //  ==============================================================================================================================
42 //  PopupItem specific getters
43 //  ==============================================================================================================================
44
45         public String getConfirmationMessage () {
46 //  ---------------------------------------
47       return confirm;                          // Null if does not need any confirmation
48     }
49         public String getLabel () {
50 //  ------------------------
51           return mylabel;                          // Null if this is a separator
52         }
53     public boolean needConfirmation () {
54 //  ----------------------------------
55       return (confirm != null);
56     }
57 }