Subversion Repository Public Repository

litesoft

Diff Revisions 947 vs 948 for /trunk/Java/GWT/Client/src/com/google/gwt/gen2/table/client/Gen2TablePanel.java

Diff revisions: vs.
  @@ -15,11 +15,11 @@
15 15 */
16 16 package com.google.gwt.gen2.table.client;
17 17
18 - import java.util.*;
19 -
20 18 import com.google.gwt.user.client.*;
21 19 import com.google.gwt.user.client.ui.*;
22 20
21 + import java.util.*;
22 +
23 23 /**
24 24 * Abstract base class for all panels, which are widgets that can contain other
25 25 * widgets.
  @@ -27,8 +27,7 @@
27 27 * @deprecated as of Jan 26 2009, No longer needed as events have graduated to gwt.
28 28 */
29 29 @Deprecated
30 - public abstract class Gen2TablePanel extends Gen2TableWidget implements HasWidgets
31 - {
30 + public abstract class Gen2TablePanel extends Gen2TableWidget implements HasWidgets {
32 31
33 32 /**
34 33 * Adds a child widget.
  @@ -69,17 +68,14 @@
69 68 * @see HasWidgets#add(Widget)
70 69 */
71 70 @Override
72 - public void add( Widget child )
73 - {
71 + public void add( Widget child ) {
74 72 throw new UnsupportedOperationException( "This panel does not support no-arg add()" );
75 73 }
76 74
77 75 @Override
78 - public void clear()
79 - {
76 + public void clear() {
80 77 Iterator<Widget> it = iterator();
81 - while ( it.hasNext() )
82 - {
78 + while ( it.hasNext() ) {
83 79 it.next();
84 80 it.remove();
85 81 }
  @@ -127,8 +123,7 @@
127 123 *
128 124 * @see #add(Widget)
129 125 */
130 - protected final void adopt( Widget child )
131 - {
126 + protected final void adopt( Widget child ) {
132 127 assert (child.getParent() == null);
133 128 WidgetAdaptorImpl.setParent( child, this );
134 129 }
  @@ -140,14 +135,12 @@
140 135 * @deprecated Use {@link #adopt(Widget)}.
141 136 */
142 137 @Deprecated
143 - protected void adopt( Widget w, Element container )
144 - {
138 + protected void adopt( Widget w, Element container ) {
145 139 // Remove the widget from its current parent, if any.
146 140 w.removeFromParent();
147 141
148 142 // Attach it at the DOM and GWT levels.
149 - if ( container != null )
150 - {
143 + if ( container != null ) {
151 144 DOM.appendChild( container, w.getElement() );
152 145 }
153 146 WidgetAdaptorImpl.setParent( w, this );
  @@ -160,11 +153,9 @@
160 153 * @deprecated Use {@link #orphan(Widget)}.
161 154 */
162 155 @Deprecated
163 - protected void disown( Widget w )
164 - {
156 + protected void disown( Widget w ) {
165 157 // Only disown it if it's actually contained in this panel.
166 - if ( w.getParent() != this )
167 - {
158 + if ( w.getParent() != this ) {
168 159 throw new IllegalArgumentException( "w is not a child of this panel" );
169 160 }
170 161
  @@ -176,22 +167,18 @@
176 167 }
177 168
178 169 @Override
179 - protected void doAttachChildren()
180 - {
170 + protected void doAttachChildren() {
181 171 // Ensure that all child widgets are attached.
182 - for ( Iterator<Widget> it = iterator(); it.hasNext(); )
183 - {
172 + for ( Iterator<Widget> it = iterator(); it.hasNext(); ) {
184 173 Widget child = it.next();
185 174 WidgetAdaptorImpl.onAttach( child );
186 175 }
187 176 }
188 177
189 178 @Override
190 - protected void doDetachChildren()
191 - {
179 + protected void doDetachChildren() {
192 180 // Ensure that all child widgets are detached.
193 - for ( Iterator<Widget> it = iterator(); it.hasNext(); )
194 - {
181 + for ( Iterator<Widget> it = iterator(); it.hasNext(); ) {
195 182 Widget child = it.next();
196 183 WidgetAdaptorImpl.onDetach( child );
197 184 }
  @@ -204,8 +191,7 @@
204 191 * @see Widget#onLoad()
205 192 */
206 193 @Override
207 - protected void onLoad()
208 - {
194 + protected void onLoad() {
209 195 }
210 196
211 197 /**
  @@ -215,8 +201,7 @@
215 201 * @see Widget#onLoad()
216 202 */
217 203 @Override
218 - protected void onUnload()
219 - {
204 + protected void onUnload() {
220 205 }
221 206
222 207 /**
  @@ -231,8 +216,7 @@
231 216 *
232 217 * @see #add(Widget)
233 218 */
234 - protected final void orphan( Widget child )
235 - {
219 + protected final void orphan( Widget child ) {
236 220 assert (child.getParent() == this);
237 221 WidgetAdaptorImpl.setParent( child, null );
238 222 }