|
@@ -9,8 +9,7 @@ |
9 |
9 |
|
import com.google.gwt.user.client.ui.*; |
10 |
10 |
|
|
11 |
11 |
|
public abstract class AbstractSizableVerticalPanel extends VerticalPanel implements RenderableContainer, |
12 |
|
- |
GwtRenderableRect |
13 |
|
- |
{ |
|
12 |
+ |
GwtRenderableRect { |
14 |
13 |
|
private Element mOuterElement; |
15 |
14 |
|
private Element mStyleElement; |
16 |
15 |
|
private Element mSizingElement = null; |
|
@@ -20,8 +19,7 @@ |
20 |
19 |
|
* does not support passing in the "main" "Element"! |
21 |
20 |
|
*/ |
22 |
21 |
|
@Override |
23 |
|
- |
public Element getElement() |
24 |
|
- |
{ |
|
22 |
+ |
public Element getElement() { |
25 |
23 |
|
return mOuterElement; |
26 |
24 |
|
} |
27 |
25 |
|
|
|
@@ -29,13 +27,12 @@ |
29 |
27 |
|
* DANGER - Newer GWT does NOT really support replacing the "main" "Element", but VerticalPanel |
30 |
28 |
|
* does not support passing in the "main" "Element"! |
31 |
29 |
|
*/ |
32 |
|
- |
private void LLsetElement( Element pElement ) |
33 |
|
- |
{ |
|
30 |
+ |
private void LLsetElement( Element pElement ) { |
34 |
31 |
|
mOuterElement = pElement; |
35 |
32 |
|
} |
36 |
33 |
|
|
37 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproachX, RenderContainmentApproach pContainmentApproachY ) |
38 |
|
- |
{ |
|
34 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproachX, |
|
35 |
+ |
RenderContainmentApproach pContainmentApproachY ) { |
39 |
36 |
|
mSizingElement = mOuterElement = super.getElement(); |
40 |
37 |
|
|
41 |
38 |
|
pContainmentApproachX = RenderContainmentApproach.deNull( pContainmentApproachX ); |
|
@@ -46,9 +43,7 @@ |
46 |
43 |
|
if ( (pStyleSet == null) && zCombinedOverflow.isNone() ) // Not Stylable & Overflow == _None |
47 |
44 |
|
{ |
48 |
45 |
|
mStyleElement = StyleContainerElements.NO_STYLING_ELEMENT; |
49 |
|
- |
} |
50 |
|
- |
else |
51 |
|
- |
{ |
|
46 |
+ |
} else { |
52 |
47 |
|
Element zOldOuterElement = mOuterElement; |
53 |
48 |
|
DIVconstrainer zDIVconstrainer = CommonElementHelper.createDIVconstrainer(); |
54 |
49 |
|
LLsetElement( zDIVconstrainer.getOuterElement() ); |
|
@@ -56,8 +51,7 @@ |
56 |
51 |
|
mStyleElement = zSCEs.getStyleElement(); |
57 |
52 |
|
Element zContainerParentElement = zSCEs.getContainerParentElement(); |
58 |
53 |
|
|
59 |
|
- |
if ( zCombinedOverflow.isScrolledOrClipped() ) |
60 |
|
- |
{ |
|
54 |
+ |
if ( zCombinedOverflow.isScrolledOrClipped() ) { |
61 |
55 |
|
zContainerParentElement = CommonElementHelper.appendToParent( mSizingElement = DOM.createDiv(), zContainerParentElement ); |
62 |
56 |
|
String zOverflowClass = CommonElementHelper.determineOverflowClass( zCombinedOverflow.isClipped() ); |
63 |
57 |
|
CommonElementHelper.setStyleClass( zContainerParentElement, zOverflowClass ); |
|
@@ -65,31 +59,25 @@ |
65 |
59 |
|
DOM.appendChild( zContainerParentElement, zOldOuterElement ); |
66 |
60 |
|
} |
67 |
61 |
|
|
68 |
|
- |
mRenderHelperX = new Gwt1dContainerRenderHelperX( this, pContainmentApproachX, RenderContainerChildrenPolicy.Propogate ) |
69 |
|
- |
{ |
|
62 |
+ |
mRenderHelperX = new Gwt1dContainerRenderHelperX( this, pContainmentApproachX, RenderContainerChildrenPolicy.Propogate ) { |
70 |
63 |
|
@Override |
71 |
|
- |
protected Object[] getChildObjects() |
72 |
|
- |
{ |
|
64 |
+ |
protected Object[] getChildObjects() { |
73 |
65 |
|
return ContainerSupport.toArray( getChildren() ); |
74 |
66 |
|
} |
75 |
67 |
|
}; |
76 |
|
- |
mRenderHelperY = new Gwt1dContainerRenderHelperY( this, pContainmentApproachY, RenderContainerChildrenPolicy.Distribute ) |
77 |
|
- |
{ |
|
68 |
+ |
mRenderHelperY = new Gwt1dContainerRenderHelperY( this, pContainmentApproachY, RenderContainerChildrenPolicy.Distribute ) { |
78 |
69 |
|
@Override |
79 |
|
- |
protected Object[] getChildObjects() |
80 |
|
- |
{ |
|
70 |
+ |
protected Object[] getChildObjects() { |
81 |
71 |
|
return ContainerSupport.toArray( getChildren() ); |
82 |
72 |
|
} |
83 |
73 |
|
}; |
84 |
74 |
|
} |
85 |
75 |
|
|
86 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RCApair pRCApair ) |
87 |
|
- |
{ |
|
76 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RCApair pRCApair ) { |
88 |
77 |
|
this( pStyleSet, RCApair.deNull( pRCApair ).getRCA_X(), RCApair.deNull( pRCApair ).getRCA_Y() ); |
89 |
78 |
|
} |
90 |
79 |
|
|
91 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproach ) |
92 |
|
- |
{ |
|
80 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproach ) { |
93 |
81 |
|
this( pStyleSet, pContainmentApproach, pContainmentApproach ); |
94 |
82 |
|
} |
95 |
83 |
|
|
|
@@ -97,8 +85,7 @@ |
97 |
85 |
|
private RenderContainerHelper mRenderHelperY; |
98 |
86 |
|
|
99 |
87 |
|
@Override |
100 |
|
- |
protected Element getStyleElement() |
101 |
|
- |
{ |
|
88 |
+ |
protected Element getStyleElement() { |
102 |
89 |
|
return mStyleElement; |
103 |
90 |
|
} |
104 |
91 |
|
|
|
@@ -111,8 +98,7 @@ |
111 |
98 |
|
* @see Widget#onAttach() |
112 |
99 |
|
*/ |
113 |
100 |
|
@Override |
114 |
|
- |
public void onAttach() |
115 |
|
- |
{ |
|
101 |
+ |
public void onAttach() { |
116 |
102 |
|
super.onAttach(); |
117 |
103 |
|
renderingParticipationChanged(); |
118 |
104 |
|
} |
|
@@ -126,8 +112,7 @@ |
126 |
112 |
|
* @see Widget#onDetach() |
127 |
113 |
|
*/ |
128 |
114 |
|
@Override |
129 |
|
- |
public void onDetach() |
130 |
|
- |
{ |
|
115 |
+ |
public void onDetach() { |
131 |
116 |
|
super.onDetach(); |
132 |
117 |
|
renderingParticipationChanged(); |
133 |
118 |
|
} |
|
@@ -139,10 +124,8 @@ |
139 |
124 |
|
* to hide it |
140 |
125 |
|
*/ |
141 |
126 |
|
@Override |
142 |
|
- |
public void setVisible( boolean pVisible ) |
143 |
|
- |
{ |
144 |
|
- |
if ( isVisible() != pVisible ) |
145 |
|
- |
{ |
|
127 |
+ |
public void setVisible( boolean pVisible ) { |
|
128 |
+ |
if ( isVisible() != pVisible ) { |
146 |
129 |
|
super.setVisible( pVisible ); |
147 |
130 |
|
renderingParticipationChanged(); |
148 |
131 |
|
} |
|
@@ -158,8 +141,7 @@ |
158 |
141 |
|
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
159 |
142 |
|
*/ |
160 |
143 |
|
@Override |
161 |
|
- |
public void setWidth( String pWidth ) |
162 |
|
- |
{ |
|
144 |
+ |
public void setWidth( String pWidth ) { |
163 |
145 |
|
Parse.andSetSize( getRenderHelperX(), pWidth ); |
164 |
146 |
|
} |
165 |
147 |
|
|
|
@@ -174,8 +156,7 @@ |
174 |
156 |
|
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
175 |
157 |
|
*/ |
176 |
158 |
|
@Override |
177 |
|
- |
public void LLsetWidgetWidth( int pWidth ) |
178 |
|
- |
{ |
|
159 |
+ |
public void LLsetWidgetWidth( int pWidth ) { |
179 |
160 |
|
Size.set( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement, pWidth, getDecorationSizeX() ); |
180 |
161 |
|
} |
181 |
162 |
|
|
|
@@ -184,8 +165,7 @@ |
184 |
165 |
|
* "natural" width of the Widget! |
185 |
166 |
|
*/ |
186 |
167 |
|
@Override |
187 |
|
- |
public void clearWidth() |
188 |
|
- |
{ |
|
168 |
+ |
public void clearWidth() { |
189 |
169 |
|
Size.clear( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement ); |
190 |
170 |
|
} |
191 |
171 |
|
|
|
@@ -199,8 +179,7 @@ |
199 |
179 |
|
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
200 |
180 |
|
*/ |
201 |
181 |
|
@Override |
202 |
|
- |
public void setHeight( String pHeight ) |
203 |
|
- |
{ |
|
182 |
+ |
public void setHeight( String pHeight ) { |
204 |
183 |
|
Parse.andSetSize( getRenderHelperY(), pHeight ); |
205 |
184 |
|
} |
206 |
185 |
|
|
|
@@ -215,8 +194,7 @@ |
215 |
194 |
|
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
216 |
195 |
|
*/ |
217 |
196 |
|
@Override |
218 |
|
- |
public void LLsetWidgetHeight( int pHeight ) |
219 |
|
- |
{ |
|
197 |
+ |
public void LLsetWidgetHeight( int pHeight ) { |
220 |
198 |
|
Size.set( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement, pHeight, getDecorationSizeY() ); |
221 |
199 |
|
} |
222 |
200 |
|
|
|
@@ -225,55 +203,50 @@ |
225 |
203 |
|
* "natural" height of the Widget! |
226 |
204 |
|
*/ |
227 |
205 |
|
@Override |
228 |
|
- |
public void clearHeight() |
229 |
|
- |
{ |
|
206 |
+ |
public void clearHeight() { |
230 |
207 |
|
Size.clear( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement ); |
231 |
208 |
|
} |
232 |
209 |
|
|
233 |
210 |
|
@Override |
234 |
|
- |
public void renderingParticipationChanged() |
235 |
|
- |
{ |
|
211 |
+ |
public void renderingParticipationChanged() { |
236 |
212 |
|
RenderingParticipationChangedHelper.participationChanged( this, ContainerSupport.toArray( getChildren() ) ); |
237 |
213 |
|
} |
238 |
214 |
|
|
239 |
215 |
|
@Override |
240 |
|
- |
public RenderHelper getRenderHelperX() |
241 |
|
- |
{ |
|
216 |
+ |
public RenderHelper getRenderHelperX() { |
242 |
217 |
|
return mRenderHelperX; |
243 |
218 |
|
} |
244 |
219 |
|
|
245 |
220 |
|
@Override |
246 |
|
- |
public RenderHelper getRenderHelperY() |
247 |
|
- |
{ |
|
221 |
+ |
public RenderHelper getRenderHelperY() { |
248 |
222 |
|
return mRenderHelperY; |
249 |
223 |
|
} |
250 |
224 |
|
|
251 |
225 |
|
/** |
252 |
|
- |
* Get a Container's Decoration (or Overhead) Size in the 'X' dimension - the difference between the outside size and the inside size (what is available for child widgets) |
|
226 |
+ |
* Get a Container's Decoration (or Overhead) Size in the 'X' dimension - the difference between the outside size and the inside size (what is available |
|
227 |
+ |
* for child widgets) |
253 |
228 |
|
* <p/> |
254 |
229 |
|
* Note: this will NOT be called until the Container is reporting proper sizes! |
255 |
230 |
|
*/ |
256 |
231 |
|
@Override |
257 |
|
- |
public int getDecorationSizeX() |
258 |
|
- |
{ |
|
232 |
+ |
public int getDecorationSizeX() { |
259 |
233 |
|
return DecorationSize.calculate( this, GwtElementDimensionHelperX.INSTANCE, // |
260 |
234 |
|
getElement(), mSizingElement ); |
261 |
235 |
|
} |
262 |
236 |
|
|
263 |
237 |
|
/** |
264 |
|
- |
* Get a Container's Decoration (or Overhead) Size in the 'Y' dimension - the difference between the outside size and the inside size (what is available for child widgets) |
|
238 |
+ |
* Get a Container's Decoration (or Overhead) Size in the 'Y' dimension - the difference between the outside size and the inside size (what is available |
|
239 |
+ |
* for child widgets) |
265 |
240 |
|
* <p/> |
266 |
241 |
|
* Note: this will NOT be called until the Container is reporting proper sizes! |
267 |
242 |
|
*/ |
268 |
243 |
|
@Override |
269 |
|
- |
public int getDecorationSizeY() |
270 |
|
- |
{ |
|
244 |
+ |
public int getDecorationSizeY() { |
271 |
245 |
|
return DecorationSize.calculate( this, GwtElementDimensionHelperY.INSTANCE, // |
272 |
246 |
|
getElement(), mSizingElement ); |
273 |
247 |
|
} |
274 |
248 |
|
|
275 |
|
- |
public void relayout() |
276 |
|
- |
{ |
|
249 |
+ |
public void relayout() { |
277 |
250 |
|
getRenderHelperX().layout(); |
278 |
251 |
|
getRenderHelperY().layout(); |
279 |
252 |
|
} |