litesoft
Diff Revisions
282
vs
475
for /trunk/Java/GWT/Client/src/com/google/gwt/gen2/table/client/property/MaximumWidthProperty.java
|
@@ -18,46 +18,52 @@ |
18 |
18 |
|
/** |
19 |
19 |
|
* A {@link ColumnProperty} that provides the maximum width of a column. |
20 |
20 |
|
*/ |
21 |
|
- |
public class MaximumWidthProperty extends ColumnProperty { |
22 |
|
- |
/** |
23 |
|
- |
* The return value when no maximum width is specified. |
24 |
|
- |
*/ |
25 |
|
- |
public static final int NO_MAXIMUM_WIDTH = -1; |
|
21 |
+ |
public class MaximumWidthProperty extends ColumnProperty |
|
22 |
+ |
{ |
|
23 |
+ |
/** |
|
24 |
+ |
* The return value when no maximum width is specified. |
|
25 |
+ |
*/ |
|
26 |
+ |
public static final int NO_MAXIMUM_WIDTH = -1; |
26 |
27 |
|
|
27 |
|
- |
/** |
28 |
|
- |
* Property type. |
29 |
|
- |
*/ |
30 |
|
- |
public static final Type<MaximumWidthProperty> TYPE = new Type<MaximumWidthProperty>() { |
31 |
|
- |
private MaximumWidthProperty instance; |
|
28 |
+ |
/** |
|
29 |
+ |
* Property type. |
|
30 |
+ |
*/ |
|
31 |
+ |
public static final Type<MaximumWidthProperty> TYPE = new Type<MaximumWidthProperty>() |
|
32 |
+ |
{ |
|
33 |
+ |
private MaximumWidthProperty instance; |
32 |
34 |
|
|
33 |
|
- |
@Override |
34 |
|
- |
public MaximumWidthProperty getDefault() { |
35 |
|
- |
if (instance == null) { |
36 |
|
- |
instance = new MaximumWidthProperty(NO_MAXIMUM_WIDTH); |
37 |
|
- |
} |
38 |
|
- |
return instance; |
39 |
|
- |
} |
40 |
|
- |
}; |
|
35 |
+ |
@Override |
|
36 |
+ |
public MaximumWidthProperty getDefault() |
|
37 |
+ |
{ |
|
38 |
+ |
if ( instance == null ) |
|
39 |
+ |
{ |
|
40 |
+ |
instance = new MaximumWidthProperty( NO_MAXIMUM_WIDTH ); |
|
41 |
+ |
} |
|
42 |
+ |
return instance; |
|
43 |
+ |
} |
|
44 |
+ |
}; |
41 |
45 |
|
|
42 |
|
- |
private int maxWidth; |
|
46 |
+ |
private int maxWidth; |
43 |
47 |
|
|
44 |
|
- |
/** |
45 |
|
- |
* Construct a new {@link MaximumWidthProperty}. |
46 |
|
- |
* |
47 |
|
- |
* @param maxWidth the maximum column width |
48 |
|
- |
*/ |
49 |
|
- |
public MaximumWidthProperty(int maxWidth) { |
50 |
|
- |
this.maxWidth = maxWidth; |
51 |
|
- |
} |
|
48 |
+ |
/** |
|
49 |
+ |
* Construct a new {@link MaximumWidthProperty}. |
|
50 |
+ |
* |
|
51 |
+ |
* @param maxWidth the maximum column width |
|
52 |
+ |
*/ |
|
53 |
+ |
public MaximumWidthProperty( int maxWidth ) |
|
54 |
+ |
{ |
|
55 |
+ |
this.maxWidth = maxWidth; |
|
56 |
+ |
} |
52 |
57 |
|
|
53 |
|
- |
/** |
54 |
|
- |
* Get the maximum width of the column. A return value of |
55 |
|
- |
* {@link #NO_MAXIMUM_WIDTH} indicates that the column has no maximum width, |
56 |
|
- |
* but the consumer of the data may impose one anyway. |
57 |
|
- |
* |
58 |
|
- |
* @return the maximum allowable width of the column |
59 |
|
- |
*/ |
60 |
|
- |
public int getMaximumColumnWidth() { |
61 |
|
- |
return maxWidth; |
62 |
|
- |
} |
|
58 |
+ |
/** |
|
59 |
+ |
* Get the maximum width of the column. A return value of |
|
60 |
+ |
* {@link #NO_MAXIMUM_WIDTH} indicates that the column has no maximum width, |
|
61 |
+ |
* but the consumer of the data may impose one anyway. |
|
62 |
+ |
* |
|
63 |
+ |
* @return the maximum allowable width of the column |
|
64 |
+ |
*/ |
|
65 |
+ |
public int getMaximumColumnWidth() |
|
66 |
+ |
{ |
|
67 |
+ |
return maxWidth; |
|
68 |
+ |
} |
63 |
69 |
|
} |