Salome HOME
NewStudyAction is improved. Specific business method for creation of a new study...
[tools/siman.git] / Workspace / Siman / src / org / splat / wapp / ToolButton.java
1 package org.splat.wapp;
2
3
4 public class ToolButton extends ContextualMenu.ContextualItem {
5
6 //  ==============================================================================================================================
7 //  Construction
8 //  ==============================================================================================================================
9
10     protected ToolButton () {
11 //  -----------------------
12 //    myicon  = "image.hr.png";
13     }
14     public ToolButton (String icon) {
15 //  -------------------------------
16       myicon = icon;
17     }
18 //  Optional attributes
19     public ToolButton action (String url) {       // Enables the item
20 //  -------------------------------------
21       this.setAction(url);
22       return this;
23     }
24     public ToolButton argument (String arg) {     // In case of tool-bar button only
25 //  ---------------------------------------
26       confirm = arg;
27       return this;
28     }
29     public ToolButton tooltip (String name) {
30 //  -----------------------------------------
31       mylabel = name;
32       return this;
33     }
34         
35 //  ==============================================================================================================================
36 //  ToolButton specific getters
37 //  ==============================================================================================================================
38
39     public String getArgument () {
40 //  ----------------------------
41       return confirm;                             // Null if does no argument
42     }
43         public String getTooltip () {                 // Null if this is a separator
44 //  ---------------------------
45           return mylabel;
46         }
47 }