|
@@ -1,15 +1,13 @@ |
1 |
1 |
|
package com.temp.client.foundation.widget.table.cell; |
2 |
2 |
|
|
3 |
|
- |
|
4 |
|
- |
|
5 |
|
- |
import com.google.gwt.cell.client.CheckboxCell; |
|
3 |
+ |
import com.google.gwt.cell.client.*; |
6 |
4 |
|
|
7 |
5 |
|
public abstract class DisableableRadioCell extends AbstractDisableableBooleanEditableCell { |
8 |
6 |
|
/** |
9 |
7 |
|
* Construct a new {@link CheckboxCell}. |
10 |
8 |
|
*/ |
11 |
|
- |
public DisableableRadioCell(String name) { |
12 |
|
- |
this(name, false); |
|
9 |
+ |
public DisableableRadioCell( String name ) { |
|
10 |
+ |
this( name, false ); |
13 |
11 |
|
} |
14 |
12 |
|
|
15 |
13 |
|
/** |
|
@@ -17,30 +15,30 @@ |
17 |
15 |
|
* |
18 |
16 |
|
* @param isSelectBox true if the cell controls the selection state |
19 |
17 |
|
*/ |
20 |
|
- |
public DisableableRadioCell(String name, boolean isSelectBox) { |
21 |
|
- |
this(name, isSelectBox, isSelectBox); |
|
18 |
+ |
public DisableableRadioCell( String name, boolean isSelectBox ) { |
|
19 |
+ |
this( name, isSelectBox, isSelectBox ); |
22 |
20 |
|
} |
23 |
21 |
|
|
24 |
22 |
|
/** |
25 |
23 |
|
* Construct a new {@link CheckboxCell} that optionally controls selection. |
26 |
24 |
|
* |
27 |
25 |
|
* @param dependsOnSelection true if the cell depends on the selection state |
28 |
|
- |
* @param handlesSelection true if the cell modifies the selection state |
|
26 |
+ |
* @param handlesSelection true if the cell modifies the selection state |
29 |
27 |
|
*/ |
30 |
|
- |
public DisableableRadioCell(String name, boolean dependsOnSelection, boolean handlesSelection) { |
31 |
|
- |
super(dependsOnSelection, handlesSelection, new CellHtmlProvider( // |
32 |
|
- |
radioButton(name, false, true), // |
33 |
|
- |
radioButton(name, false, false), // |
34 |
|
- |
radioButton(name, true, true), // |
35 |
|
- |
radioButton(name, true, false))); |
|
28 |
+ |
public DisableableRadioCell( String name, boolean dependsOnSelection, boolean handlesSelection ) { |
|
29 |
+ |
super( dependsOnSelection, handlesSelection, new CellHtmlProvider( // |
|
30 |
+ |
radioButton( name, false, true ), // |
|
31 |
+ |
radioButton( name, false, false ), // |
|
32 |
+ |
radioButton( name, true, true ), // |
|
33 |
+ |
radioButton( name, true, false ) ) ); |
36 |
34 |
|
} |
37 |
35 |
|
|
38 |
|
- |
private static String radioButton(String name, boolean disabled, boolean checked) { |
|
36 |
+ |
private static String radioButton( String name, boolean disabled, boolean checked ) { |
39 |
37 |
|
String rv = "<input type='radio' tabindex='-1' name='" + name + "'"; |
40 |
|
- |
if (disabled) { |
|
38 |
+ |
if ( disabled ) { |
41 |
39 |
|
rv += " disabled='disabled'"; |
42 |
40 |
|
} |
43 |
|
- |
if (checked) { |
|
41 |
+ |
if ( checked ) { |
44 |
42 |
|
rv += " checked"; |
45 |
43 |
|
} |
46 |
44 |
|
return rv + "/>"; |