| 12 |
12 |
|
| 13 |
13 |
/**
|
| 14 |
14 |
* Convenience class to create a labeled Spinner dedicated to editor parameters areas.
|
| 15 |
|
* This class also adds all the needed computing listeners.
|
|
15 |
* This class also adds all the needed computing listeners.
|
| 16 |
16 |
*
|
| 17 |
17 |
* @author sjacquot
|
| 18 |
18 |
*
|
| ... | ... | |
| 24 |
24 |
*/
|
| 25 |
25 |
protected Label label;
|
| 26 |
26 |
|
| 27 |
|
|
|
27 |
|
| 28 |
28 |
/**
|
| 29 |
29 |
* The spinner.
|
| 30 |
30 |
*/
|
| ... | ... | |
| 47 |
47 |
this.spinner = spinner;
|
| 48 |
48 |
|
| 49 |
49 |
|
| 50 |
|
if(this.label == null) {
|
|
50 |
if (this.label == null) {
|
| 51 |
51 |
this.label = new Label(parent, SWT.NONE);
|
| 52 |
52 |
}
|
| 53 |
53 |
|
| 54 |
|
if(this.spinner == null) {
|
|
54 |
if (this.spinner == null) {
|
| 55 |
55 |
this.spinner = new Spinner(parent, SWT.BORDER);
|
| 56 |
56 |
}
|
| 57 |
|
|
|
57 |
|
| 58 |
58 |
this.label.setText(labelText);
|
| 59 |
59 |
|
| 60 |
|
if(spinnerTooltip != null) {
|
|
60 |
if (spinnerTooltip != null) {
|
| 61 |
61 |
this.spinner.setToolTipText(spinnerTooltip);
|
| 62 |
62 |
}
|
| 63 |
63 |
|
| 64 |
64 |
// default parameters and range
|
| 65 |
65 |
this.spinner.setMinimum(0);
|
| 66 |
|
this.spinner.setMaximum(9999999);
|
|
66 |
this.spinner.setMaximum(Integer.MAX_VALUE);
|
| 67 |
67 |
this.spinner.setIncrement(1);
|
| 68 |
68 |
this.spinner.setPageIncrement(100);
|
| 69 |
69 |
|
| ... | ... | |
| 95 |
95 |
public LabeledSpinner(Composite parent, TXMEditor editor, String labelText, String spinnerTooltip) {
|
| 96 |
96 |
this(parent, editor, null, null, labelText, spinnerTooltip, false);
|
| 97 |
97 |
}
|
| 98 |
|
|
|
98 |
|
| 99 |
99 |
/**
|
| 100 |
100 |
*
|
| 101 |
101 |
* @param parent
|
| ... | ... | |
| 108 |
108 |
|
| 109 |
109 |
/**
|
| 110 |
110 |
* Gets the label composite.
|
|
111 |
*
|
| 111 |
112 |
* @return the label
|
| 112 |
113 |
*/
|
| 113 |
114 |
public Label getLabel() {
|
| 114 |
115 |
return label;
|
| 115 |
116 |
}
|
| 116 |
|
|
| 117 |
|
|
|
117 |
|
|
118 |
|
| 118 |
119 |
/**
|
| 119 |
120 |
* Gets the spinner composite.
|
|
121 |
*
|
| 120 |
122 |
* @return the spinner
|
| 121 |
123 |
*/
|
| 122 |
124 |
public Spinner getSpinner() {
|
| 123 |
125 |
return spinner;
|
| 124 |
126 |
}
|
| 125 |
|
|
|
127 |
|
| 126 |
128 |
}
|