Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/datatables/TableColumnDefinition.java

Diff revisions: vs.
  @@ -7,98 +7,79 @@
7 7 import com.google.gwt.user.client.ui.HasHorizontalAlignment.*;
8 8 import com.google.gwt.user.client.ui.HasVerticalAlignment.*;
9 9
10 - public abstract class TableColumnDefinition<RowType> extends AbstractColumnDefinition<RowType, Object>
11 - {
12 - public TableColumnDefinition()
13 - {
10 + public abstract class TableColumnDefinition<RowType> extends AbstractColumnDefinition<RowType, Object> {
11 + public TableColumnDefinition() {
14 12 this( null );
15 13 }
16 14
17 - public TableColumnDefinition( String pHeaderText, TableCellRenderer<RowType> pCellRenderer )
18 - {
19 - if ( pHeaderText != null )
20 - {
15 + public TableColumnDefinition( String pHeaderText, TableCellRenderer<RowType> pCellRenderer ) {
16 + if ( pHeaderText != null ) {
21 17 header( pHeaderText );
22 18 }
23 19 setCellRenderer( pCellRenderer );
24 20 setPreferredColumnWidth( 10000 );
25 21 }
26 22
27 - public TableColumnDefinition( String pHeaderText )
28 - {
23 + public TableColumnDefinition( String pHeaderText ) {
29 24 this( pHeaderText, new TableCellRenderer<RowType>() );
30 25 }
31 26
32 27 @Override
33 - public void setCellValue( RowType rowValue, Object cellValue )
34 - {
28 + public void setCellValue( RowType rowValue, Object cellValue ) {
35 29 throw new UnsupportedOperationException( "setCellValue(" + cellValue + ")" );
36 30 }
37 31
38 - public HorizontalAlignmentConstant getHorizontalAlignment()
39 - {
32 + public HorizontalAlignmentConstant getHorizontalAlignment() {
40 33 return getColumnProperty( HorizontalAlignmentProperty.TYPE ).getValue();
41 34 }
42 35
43 - public void setHorizontalAlignment( HorizontalAlignmentConstant pAlignment )
44 - {
36 + public void setHorizontalAlignment( HorizontalAlignmentConstant pAlignment ) {
45 37 setColumnProperty( HorizontalAlignmentProperty.TYPE, HorizontalAlignmentProperty.getInstance( pAlignment ) );
46 38 }
47 39
48 - public VerticalAlignmentConstant getVerticalAlignment()
49 - {
40 + public VerticalAlignmentConstant getVerticalAlignment() {
50 41 return getColumnProperty( VerticalAlignmentProperty.TYPE ).getValue();
51 42 }
52 43
53 - public void setVerticalAlignment( VerticalAlignmentConstant pAlignment )
54 - {
44 + public void setVerticalAlignment( VerticalAlignmentConstant pAlignment ) {
55 45 setColumnProperty( VerticalAlignmentProperty.TYPE, VerticalAlignmentProperty.getInstance( pAlignment ) );
56 46 }
57 47
58 - public String getColStyleName()
59 - {
48 + public String getColStyleName() {
60 49 return getColumnProperty( ColStyleNameProperty.TYPE ).getValue();
61 50 }
62 51
63 - public void setColStyleName( String pStyleName )
64 - {
65 - if ( null != (pStyleName = Strings.noEmpty( pStyleName )) )
66 - {
52 + public void setColStyleName( String pStyleName ) {
53 + if ( null != (pStyleName = Strings.noEmpty( pStyleName )) ) {
67 54 setColumnProperty( ColStyleNameProperty.TYPE, new ColStyleNameProperty( pStyleName ) );
68 55 }
69 56 }
70 57
71 58 @SuppressWarnings("unchecked")
72 - public CellClickHandler<RowType> getCellClickHandler()
73 - {
59 + public CellClickHandler<RowType> getCellClickHandler() {
74 60 return (CellClickHandler<RowType>) getColumnProperty( ClickHandlerProperty.TYPE ).getValue();
75 61 }
76 62
77 - public void setCellClickHandler( CellClickHandler<RowType> pHandler )
78 - {
63 + public void setCellClickHandler( CellClickHandler<RowType> pHandler ) {
79 64 setColumnProperty( ClickHandlerProperty.TYPE, new ClickHandlerProperty( pHandler ) );
80 65 }
81 66
82 - public TableColumnDefinition<RowType> header( String pHtml )
83 - {
67 + public TableColumnDefinition<RowType> header( String pHtml ) {
84 68 setHeader( 0, pHtml );
85 69 return this;
86 70 }
87 71
88 - public TableColumnDefinition<RowType> align( HorizontalAlignmentConstant pAlignment )
89 - {
72 + public TableColumnDefinition<RowType> align( HorizontalAlignmentConstant pAlignment ) {
90 73 setHorizontalAlignment( pAlignment );
91 74 return this;
92 75 }
93 76
94 - public TableColumnDefinition<RowType> align( VerticalAlignmentConstant pAlignment )
95 - {
77 + public TableColumnDefinition<RowType> align( VerticalAlignmentConstant pAlignment ) {
96 78 setVerticalAlignment( pAlignment );
97 79 return this;
98 80 }
99 81
100 - public TableColumnDefinition<RowType> label( String pLabel )
101 - {
82 + public TableColumnDefinition<RowType> label( String pLabel ) {
102 83 setHeader( 0, pLabel );
103 84 return this;
104 85 }
  @@ -109,28 +90,23 @@
109 90 * <p/>
110 91 * <a href="http://www.quirksmode.org/css/columns.html">COL doc</a>
111 92 */
112 - public TableColumnDefinition<RowType> colStyleName( String pStyleName )
113 - {
93 + public TableColumnDefinition<RowType> colStyleName( String pStyleName ) {
114 94 setColStyleName( pStyleName );
115 95 return this;
116 96 }
117 97
118 - public TableColumnDefinition<RowType> renderer( TableCellRenderer<RowType> pRenderer )
119 - {
98 + public TableColumnDefinition<RowType> renderer( TableCellRenderer<RowType> pRenderer ) {
120 99 setCellRenderer( pRenderer );
121 100 return this;
122 101 }
123 102
124 - public TableColumnDefinition<RowType> clickHandler( CellClickHandler<RowType> pHandler )
125 - {
103 + public TableColumnDefinition<RowType> clickHandler( CellClickHandler<RowType> pHandler ) {
126 104 setCellClickHandler( pHandler );
127 105 return this;
128 106 }
129 107
130 - public TableColumnDefinition<RowType> initialWidth( Integer pWidth )
131 - {
132 - if ( pWidth != null )
133 - {
108 + public TableColumnDefinition<RowType> initialWidth( Integer pWidth ) {
109 + if ( pWidth != null ) {
134 110 setMaximumColumnWidth( pWidth );
135 111 setMinimumColumnWidth( pWidth );
136 112 }