|
@@ -1,253 +1,253 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.widgets.nonpublic; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.widgets.*; |
5 |
|
- |
import org.litesoft.render.*; |
6 |
|
- |
import org.litesoft.uispecification.*; |
7 |
|
- |
|
8 |
|
- |
import com.google.gwt.user.client.*; |
9 |
|
- |
import com.google.gwt.user.client.ui.*; |
10 |
|
- |
|
11 |
|
- |
public abstract class AbstractSizableVerticalPanel extends VerticalPanel implements RenderableContainer, |
12 |
|
- |
GwtRenderableRect { |
13 |
|
- |
private Element mOuterElement; |
14 |
|
- |
private Element mStyleElement; |
15 |
|
- |
private Element mSizingElement = null; |
16 |
|
- |
|
17 |
|
- |
/** |
18 |
|
- |
* DANGER - Newer GWT does NOT really support replacing the "main" "Element", but VerticalPanel |
19 |
|
- |
* does not support passing in the "main" "Element"! |
20 |
|
- |
*/ |
21 |
|
- |
@Override |
22 |
|
- |
public Element getElement() { |
23 |
|
- |
return mOuterElement; |
24 |
|
- |
} |
25 |
|
- |
|
26 |
|
- |
/** |
27 |
|
- |
* DANGER - Newer GWT does NOT really support replacing the "main" "Element", but VerticalPanel |
28 |
|
- |
* does not support passing in the "main" "Element"! |
29 |
|
- |
*/ |
30 |
|
- |
private void LLsetElement( Element pElement ) { |
31 |
|
- |
mOuterElement = pElement; |
32 |
|
- |
} |
33 |
|
- |
|
34 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproachX, |
35 |
|
- |
RenderContainmentApproach pContainmentApproachY ) { |
36 |
|
- |
mSizingElement = mOuterElement = super.getElement(); |
37 |
|
- |
|
38 |
|
- |
pContainmentApproachX = RenderContainmentApproach.deNull( pContainmentApproachX ); |
39 |
|
- |
pContainmentApproachY = RenderContainmentApproach.deNull( pContainmentApproachY ); |
40 |
|
- |
|
41 |
|
- |
Overflow zCombinedOverflow = ContainerSupport.getAppropriateCombinedOverflow( pContainmentApproachX, pContainmentApproachY ); |
42 |
|
- |
|
43 |
|
- |
if ( (pStyleSet == null) && zCombinedOverflow.isNone() ) // Not Stylable & Overflow == _None |
44 |
|
- |
{ |
45 |
|
- |
mStyleElement = StyleContainerElements.NO_STYLING_ELEMENT; |
46 |
|
- |
} else { |
47 |
|
- |
Element zOldOuterElement = mOuterElement; |
48 |
|
- |
DIVconstrainer zDIVconstrainer = CommonElementHelper.createDIVconstrainer(); |
49 |
|
- |
LLsetElement( zDIVconstrainer.getOuterElement() ); |
50 |
|
- |
StyleContainerElements zSCEs = ContainerSupport.createSCEs( zDIVconstrainer.getInnerElement(), pStyleSet ); |
51 |
|
- |
mStyleElement = zSCEs.getStyleElement(); |
52 |
|
- |
Element zContainerParentElement = zSCEs.getContainerParentElement(); |
53 |
|
- |
|
54 |
|
- |
if ( zCombinedOverflow.isScrolledOrClipped() ) { |
55 |
|
- |
zContainerParentElement = CommonElementHelper.appendToParent( mSizingElement = DOM.createDiv(), zContainerParentElement ); |
56 |
|
- |
String zOverflowClass = CommonElementHelper.determineOverflowClass( zCombinedOverflow.isClipped() ); |
57 |
|
- |
CommonElementHelper.setStyleClass( zContainerParentElement, zOverflowClass ); |
58 |
|
- |
} |
59 |
|
- |
DOM.appendChild( zContainerParentElement, zOldOuterElement ); |
60 |
|
- |
} |
61 |
|
- |
|
62 |
|
- |
mRenderHelperX = new Gwt1dContainerRenderHelperX( this, pContainmentApproachX, RenderContainerChildrenPolicy.Propogate ) { |
63 |
|
- |
@Override |
64 |
|
- |
protected Object[] getChildObjects() { |
65 |
|
- |
return ContainerSupport.toArray( getChildren() ); |
66 |
|
- |
} |
67 |
|
- |
}; |
68 |
|
- |
mRenderHelperY = new Gwt1dContainerRenderHelperY( this, pContainmentApproachY, RenderContainerChildrenPolicy.Distribute ) { |
69 |
|
- |
@Override |
70 |
|
- |
protected Object[] getChildObjects() { |
71 |
|
- |
return ContainerSupport.toArray( getChildren() ); |
72 |
|
- |
} |
73 |
|
- |
}; |
74 |
|
- |
} |
75 |
|
- |
|
76 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RCApair pRCApair ) { |
77 |
|
- |
this( pStyleSet, RCApair.deNull( pRCApair ).getRCA_X(), RCApair.deNull( pRCApair ).getRCA_Y() ); |
78 |
|
- |
} |
79 |
|
- |
|
80 |
|
- |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproach ) { |
81 |
|
- |
this( pStyleSet, pContainmentApproach, pContainmentApproach ); |
82 |
|
- |
} |
83 |
|
- |
|
84 |
|
- |
private RenderContainerHelper mRenderHelperX; |
85 |
|
- |
private RenderContainerHelper mRenderHelperY; |
86 |
|
- |
|
87 |
|
- |
@Override |
88 |
|
- |
protected Element getStyleElement() { |
89 |
|
- |
return mStyleElement; |
90 |
|
- |
} |
91 |
|
- |
|
92 |
|
- |
/** |
93 |
|
- |
* This method is called to attach a widget browser's document (if there are any child widgets they are |
94 |
|
- |
* also attached AFTER the attached flag is set). |
95 |
|
- |
* <p/> |
96 |
|
- |
* This method is normally overiden, and after a call to super, "renderingParticipationChanged()" is notified. |
97 |
|
- |
* |
98 |
|
- |
* @see Widget#onAttach() |
99 |
|
- |
*/ |
100 |
|
- |
@Override |
101 |
|
- |
public void onAttach() { |
102 |
|
- |
super.onAttach(); |
103 |
|
- |
renderingParticipationChanged(); |
104 |
|
- |
} |
105 |
|
- |
|
106 |
|
- |
/** |
107 |
|
- |
* This method is called to detach the widget from the browser's document (if there are any child widgets |
108 |
|
- |
* they are deattached BEFORE the attached flag is set). |
109 |
|
- |
* <p/> |
110 |
|
- |
* This method is normally overiden, and after a call to super, "renderingParticipationChanged()" is notified. |
111 |
|
- |
* |
112 |
|
- |
* @see Widget#onDetach() |
113 |
|
- |
*/ |
114 |
|
- |
@Override |
115 |
|
- |
public void onDetach() { |
116 |
|
- |
super.onDetach(); |
117 |
|
- |
renderingParticipationChanged(); |
118 |
|
- |
} |
119 |
|
- |
|
120 |
|
- |
/** |
121 |
|
- |
* Sets whether this object is visible - normally overiden from "UIObject" so that "renderingParticipationChanged()" can be notified. |
122 |
|
- |
* |
123 |
|
- |
* @param pVisible <code>true</code> to show the object, <code>false</code> |
124 |
|
- |
* to hide it |
125 |
|
- |
*/ |
126 |
|
- |
@Override |
127 |
|
- |
public void setVisible( boolean pVisible ) { |
128 |
|
- |
if ( isVisible() != pVisible ) { |
129 |
|
- |
super.setVisible( pVisible ); |
130 |
|
- |
renderingParticipationChanged(); |
131 |
|
- |
} |
132 |
|
- |
} |
133 |
|
- |
|
134 |
|
- |
/** |
135 |
|
- |
* Sets the widget's width, overiding the method in "UIObject". Unlike the standard GWT "UIObject" method, the |
136 |
|
- |
* pWidth is "assumed" to include ALL decorations (such as border, margin, and padding). This means that a |
137 |
|
- |
* subsequent call to "getOffsetWidth()" will "eventually" return the value "set"! |
138 |
|
- |
* <p/> |
139 |
|
- |
* This method is normally delegated to the 'X' RenderHelper |
140 |
|
- |
* |
141 |
|
- |
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
142 |
|
- |
*/ |
143 |
|
- |
@Override |
144 |
|
- |
public void setWidth( String pWidth ) { |
145 |
|
- |
Parse.andSetSize( getRenderHelperX(), pWidth ); |
146 |
|
- |
} |
147 |
|
- |
|
148 |
|
- |
/** |
149 |
|
- |
* Sets the widget's width, unlike the standard GWT "UIObject" method, this pWidth is "assumed" to include ALL |
150 |
|
- |
* decorations (such as border, margin, and padding). This means that a subsequent call to "getOffsetWidth()" |
151 |
|
- |
* will "eventually" return the value "set"! |
152 |
|
- |
* <p/> |
153 |
|
- |
* This method is used by the 'X' RenderHelper via the GwtRenderDimensionAdapterX to bypass the normal delegation |
154 |
|
- |
* on "setWidth()" to the 'X' RenderHelper. |
155 |
|
- |
* |
156 |
|
- |
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
157 |
|
- |
*/ |
158 |
|
- |
@Override |
159 |
|
- |
public void LLsetWidgetWidth( int pWidth ) { |
160 |
|
- |
Size.set( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement, pWidth, getDecorationSizeX() ); |
161 |
|
- |
} |
162 |
|
- |
|
163 |
|
- |
/** |
164 |
|
- |
* Remove the Widget's width, after this call subsequent calls to "getOffsetWidth()" will "eventually" return the |
165 |
|
- |
* "natural" width of the Widget! |
166 |
|
- |
*/ |
167 |
|
- |
@Override |
168 |
|
- |
public void clearWidth() { |
169 |
|
- |
Size.clear( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement ); |
170 |
|
- |
} |
171 |
|
- |
|
172 |
|
- |
/** |
173 |
|
- |
* Sets the widget's height, overiding the method in "UIObject". Unlike the standard GWT "UIObject" method, this |
174 |
|
- |
* pHeight is "assumed" to include ALL decorations (such as border, margin, and padding). This means that a |
175 |
|
- |
* subsequent call to "getOffsetHeight()" will "eventually" return the value "set"! |
176 |
|
- |
* <p/> |
177 |
|
- |
* This method is normally delegated to the 'Y' RenderHelper |
178 |
|
- |
* |
179 |
|
- |
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
180 |
|
- |
*/ |
181 |
|
- |
@Override |
182 |
|
- |
public void setHeight( String pHeight ) { |
183 |
|
- |
Parse.andSetSize( getRenderHelperY(), pHeight ); |
184 |
|
- |
} |
185 |
|
- |
|
186 |
|
- |
/** |
187 |
|
- |
* Sets the widget's height, unlike the standard GWT "UIObject" method, this pHeight is "assumed" to include ALL |
188 |
|
- |
* decorations (such as border, margin, and padding). This means that a subsequent call to "getOffsetHeight()" |
189 |
|
- |
* will "eventually" return the value "set"! |
190 |
|
- |
* <p/> |
191 |
|
- |
* This method is used by the 'Y' RenderHelper via the GwtRenderDimensionAdapterY to bypass the normal delegation |
192 |
|
- |
* on "setHeight()" to the 'Y' RenderHelper. |
193 |
|
- |
* |
194 |
|
- |
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
195 |
|
- |
*/ |
196 |
|
- |
@Override |
197 |
|
- |
public void LLsetWidgetHeight( int pHeight ) { |
198 |
|
- |
Size.set( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement, pHeight, getDecorationSizeY() ); |
199 |
|
- |
} |
200 |
|
- |
|
201 |
|
- |
/** |
202 |
|
- |
* Remove the Widget's height, after this call subsequent calls to "getOffsetHeight()" will "eventually" return the |
203 |
|
- |
* "natural" height of the Widget! |
204 |
|
- |
*/ |
205 |
|
- |
@Override |
206 |
|
- |
public void clearHeight() { |
207 |
|
- |
Size.clear( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement ); |
208 |
|
- |
} |
209 |
|
- |
|
210 |
|
- |
@Override |
211 |
|
- |
public void renderingParticipationChanged() { |
212 |
|
- |
RenderingParticipationChangedHelper.participationChanged( this, ContainerSupport.toArray( getChildren() ) ); |
213 |
|
- |
} |
214 |
|
- |
|
215 |
|
- |
@Override |
216 |
|
- |
public RenderHelper getRenderHelperX() { |
217 |
|
- |
return mRenderHelperX; |
218 |
|
- |
} |
219 |
|
- |
|
220 |
|
- |
@Override |
221 |
|
- |
public RenderHelper getRenderHelperY() { |
222 |
|
- |
return mRenderHelperY; |
223 |
|
- |
} |
224 |
|
- |
|
225 |
|
- |
/** |
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) |
228 |
|
- |
* <p/> |
229 |
|
- |
* Note: this will NOT be called until the Container is reporting proper sizes! |
230 |
|
- |
*/ |
231 |
|
- |
@Override |
232 |
|
- |
public int getDecorationSizeX() { |
233 |
|
- |
return DecorationSize.calculate( this, GwtElementDimensionHelperX.INSTANCE, // |
234 |
|
- |
getElement(), mSizingElement ); |
235 |
|
- |
} |
236 |
|
- |
|
237 |
|
- |
/** |
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) |
240 |
|
- |
* <p/> |
241 |
|
- |
* Note: this will NOT be called until the Container is reporting proper sizes! |
242 |
|
- |
*/ |
243 |
|
- |
@Override |
244 |
|
- |
public int getDecorationSizeY() { |
245 |
|
- |
return DecorationSize.calculate( this, GwtElementDimensionHelperY.INSTANCE, // |
246 |
|
- |
getElement(), mSizingElement ); |
247 |
|
- |
} |
248 |
|
- |
|
249 |
|
- |
public void relayout() { |
250 |
|
- |
getRenderHelperX().layout(); |
251 |
|
- |
getRenderHelperY().layout(); |
252 |
|
- |
} |
253 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.widgets.nonpublic; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.widgets.*; |
|
5 |
+ |
import org.litesoft.render.*; |
|
6 |
+ |
import org.litesoft.uispecification.*; |
|
7 |
+ |
|
|
8 |
+ |
import com.google.gwt.user.client.*; |
|
9 |
+ |
import com.google.gwt.user.client.ui.*; |
|
10 |
+ |
|
|
11 |
+ |
public abstract class AbstractSizableVerticalPanel extends VerticalPanel implements RenderableContainer, |
|
12 |
+ |
GwtRenderableRect { |
|
13 |
+ |
private Element mOuterElement; |
|
14 |
+ |
private Element mStyleElement; |
|
15 |
+ |
private Element mSizingElement = null; |
|
16 |
+ |
|
|
17 |
+ |
/** |
|
18 |
+ |
* DANGER - Newer GWT does NOT really support replacing the "main" "Element", but VerticalPanel |
|
19 |
+ |
* does not support passing in the "main" "Element"! |
|
20 |
+ |
*/ |
|
21 |
+ |
@Override |
|
22 |
+ |
public Element getElement() { |
|
23 |
+ |
return mOuterElement; |
|
24 |
+ |
} |
|
25 |
+ |
|
|
26 |
+ |
/** |
|
27 |
+ |
* DANGER - Newer GWT does NOT really support replacing the "main" "Element", but VerticalPanel |
|
28 |
+ |
* does not support passing in the "main" "Element"! |
|
29 |
+ |
*/ |
|
30 |
+ |
private void LLsetElement( Element pElement ) { |
|
31 |
+ |
mOuterElement = pElement; |
|
32 |
+ |
} |
|
33 |
+ |
|
|
34 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproachX, |
|
35 |
+ |
RenderContainmentApproach pContainmentApproachY ) { |
|
36 |
+ |
mSizingElement = mOuterElement = super.getElement(); |
|
37 |
+ |
|
|
38 |
+ |
pContainmentApproachX = RenderContainmentApproach.deNull( pContainmentApproachX ); |
|
39 |
+ |
pContainmentApproachY = RenderContainmentApproach.deNull( pContainmentApproachY ); |
|
40 |
+ |
|
|
41 |
+ |
Overflow zCombinedOverflow = ContainerSupport.getAppropriateCombinedOverflow( pContainmentApproachX, pContainmentApproachY ); |
|
42 |
+ |
|
|
43 |
+ |
if ( (pStyleSet == null) && zCombinedOverflow.isNone() ) // Not Stylable & Overflow == _None |
|
44 |
+ |
{ |
|
45 |
+ |
mStyleElement = StyleContainerElements.NO_STYLING_ELEMENT; |
|
46 |
+ |
} else { |
|
47 |
+ |
Element zOldOuterElement = mOuterElement; |
|
48 |
+ |
DIVconstrainer zDIVconstrainer = CommonElementHelper.createDIVconstrainer(); |
|
49 |
+ |
LLsetElement( zDIVconstrainer.getOuterElement() ); |
|
50 |
+ |
StyleContainerElements zSCEs = ContainerSupport.createSCEs( zDIVconstrainer.getInnerElement(), pStyleSet ); |
|
51 |
+ |
mStyleElement = zSCEs.getStyleElement(); |
|
52 |
+ |
Element zContainerParentElement = zSCEs.getContainerParentElement(); |
|
53 |
+ |
|
|
54 |
+ |
if ( zCombinedOverflow.isScrolledOrClipped() ) { |
|
55 |
+ |
zContainerParentElement = CommonElementHelper.appendToParent( mSizingElement = DOM.createDiv(), zContainerParentElement ); |
|
56 |
+ |
String zOverflowClass = CommonElementHelper.determineOverflowClass( zCombinedOverflow.isClipped() ); |
|
57 |
+ |
CommonElementHelper.setStyleClass( zContainerParentElement, zOverflowClass ); |
|
58 |
+ |
} |
|
59 |
+ |
DOM.appendChild( zContainerParentElement, zOldOuterElement ); |
|
60 |
+ |
} |
|
61 |
+ |
|
|
62 |
+ |
mRenderHelperX = new Gwt1dContainerRenderHelperX( this, pContainmentApproachX, RenderContainerChildrenPolicy.Propogate ) { |
|
63 |
+ |
@Override |
|
64 |
+ |
protected Object[] getChildObjects() { |
|
65 |
+ |
return ContainerSupport.toArray( getChildren() ); |
|
66 |
+ |
} |
|
67 |
+ |
}; |
|
68 |
+ |
mRenderHelperY = new Gwt1dContainerRenderHelperY( this, pContainmentApproachY, RenderContainerChildrenPolicy.Distribute ) { |
|
69 |
+ |
@Override |
|
70 |
+ |
protected Object[] getChildObjects() { |
|
71 |
+ |
return ContainerSupport.toArray( getChildren() ); |
|
72 |
+ |
} |
|
73 |
+ |
}; |
|
74 |
+ |
} |
|
75 |
+ |
|
|
76 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RCApair pRCApair ) { |
|
77 |
+ |
this( pStyleSet, RCApair.deNull( pRCApair ).getRCA_X(), RCApair.deNull( pRCApair ).getRCA_Y() ); |
|
78 |
+ |
} |
|
79 |
+ |
|
|
80 |
+ |
protected AbstractSizableVerticalPanel( StyleSet pStyleSet, RenderContainmentApproach pContainmentApproach ) { |
|
81 |
+ |
this( pStyleSet, pContainmentApproach, pContainmentApproach ); |
|
82 |
+ |
} |
|
83 |
+ |
|
|
84 |
+ |
private RenderContainerHelper mRenderHelperX; |
|
85 |
+ |
private RenderContainerHelper mRenderHelperY; |
|
86 |
+ |
|
|
87 |
+ |
@Override |
|
88 |
+ |
protected Element getStyleElement() { |
|
89 |
+ |
return mStyleElement; |
|
90 |
+ |
} |
|
91 |
+ |
|
|
92 |
+ |
/** |
|
93 |
+ |
* This method is called to attach a widget browser's document (if there are any child widgets they are |
|
94 |
+ |
* also attached AFTER the attached flag is set). |
|
95 |
+ |
* <p/> |
|
96 |
+ |
* This method is normally overiden, and after a call to super, "renderingParticipationChanged()" is notified. |
|
97 |
+ |
* |
|
98 |
+ |
* @see Widget#onAttach() |
|
99 |
+ |
*/ |
|
100 |
+ |
@Override |
|
101 |
+ |
public void onAttach() { |
|
102 |
+ |
super.onAttach(); |
|
103 |
+ |
renderingParticipationChanged(); |
|
104 |
+ |
} |
|
105 |
+ |
|
|
106 |
+ |
/** |
|
107 |
+ |
* This method is called to detach the widget from the browser's document (if there are any child widgets |
|
108 |
+ |
* they are deattached BEFORE the attached flag is set). |
|
109 |
+ |
* <p/> |
|
110 |
+ |
* This method is normally overiden, and after a call to super, "renderingParticipationChanged()" is notified. |
|
111 |
+ |
* |
|
112 |
+ |
* @see Widget#onDetach() |
|
113 |
+ |
*/ |
|
114 |
+ |
@Override |
|
115 |
+ |
public void onDetach() { |
|
116 |
+ |
super.onDetach(); |
|
117 |
+ |
renderingParticipationChanged(); |
|
118 |
+ |
} |
|
119 |
+ |
|
|
120 |
+ |
/** |
|
121 |
+ |
* Sets whether this object is visible - normally overiden from "UIObject" so that "renderingParticipationChanged()" can be notified. |
|
122 |
+ |
* |
|
123 |
+ |
* @param pVisible <code>true</code> to show the object, <code>false</code> |
|
124 |
+ |
* to hide it |
|
125 |
+ |
*/ |
|
126 |
+ |
@Override |
|
127 |
+ |
public void setVisible( boolean pVisible ) { |
|
128 |
+ |
if ( isVisible() != pVisible ) { |
|
129 |
+ |
super.setVisible( pVisible ); |
|
130 |
+ |
renderingParticipationChanged(); |
|
131 |
+ |
} |
|
132 |
+ |
} |
|
133 |
+ |
|
|
134 |
+ |
/** |
|
135 |
+ |
* Sets the widget's width, overiding the method in "UIObject". Unlike the standard GWT "UIObject" method, the |
|
136 |
+ |
* pWidth is "assumed" to include ALL decorations (such as border, margin, and padding). This means that a |
|
137 |
+ |
* subsequent call to "getOffsetWidth()" will "eventually" return the value "set"! |
|
138 |
+ |
* <p/> |
|
139 |
+ |
* This method is normally delegated to the 'X' RenderHelper |
|
140 |
+ |
* |
|
141 |
+ |
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
|
142 |
+ |
*/ |
|
143 |
+ |
@Override |
|
144 |
+ |
public void setWidth( String pWidth ) { |
|
145 |
+ |
Parse.andSetSize( getRenderHelperX(), pWidth ); |
|
146 |
+ |
} |
|
147 |
+ |
|
|
148 |
+ |
/** |
|
149 |
+ |
* Sets the widget's width, unlike the standard GWT "UIObject" method, this pWidth is "assumed" to include ALL |
|
150 |
+ |
* decorations (such as border, margin, and padding). This means that a subsequent call to "getOffsetWidth()" |
|
151 |
+ |
* will "eventually" return the value "set"! |
|
152 |
+ |
* <p/> |
|
153 |
+ |
* This method is used by the 'X' RenderHelper via the GwtRenderDimensionAdapterX to bypass the normal delegation |
|
154 |
+ |
* on "setWidth()" to the 'X' RenderHelper. |
|
155 |
+ |
* |
|
156 |
+ |
* @param pWidth the Widget's new width, in CSS px (e.g. "10") |
|
157 |
+ |
*/ |
|
158 |
+ |
@Override |
|
159 |
+ |
public void LLsetWidgetWidth( int pWidth ) { |
|
160 |
+ |
Size.set( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement, pWidth, getDecorationSizeX() ); |
|
161 |
+ |
} |
|
162 |
+ |
|
|
163 |
+ |
/** |
|
164 |
+ |
* Remove the Widget's width, after this call subsequent calls to "getOffsetWidth()" will "eventually" return the |
|
165 |
+ |
* "natural" width of the Widget! |
|
166 |
+ |
*/ |
|
167 |
+ |
@Override |
|
168 |
+ |
public void clearWidth() { |
|
169 |
+ |
Size.clear( this, GwtElementDimensionHelperX.INSTANCE, mSizingElement ); |
|
170 |
+ |
} |
|
171 |
+ |
|
|
172 |
+ |
/** |
|
173 |
+ |
* Sets the widget's height, overiding the method in "UIObject". Unlike the standard GWT "UIObject" method, this |
|
174 |
+ |
* pHeight is "assumed" to include ALL decorations (such as border, margin, and padding). This means that a |
|
175 |
+ |
* subsequent call to "getOffsetHeight()" will "eventually" return the value "set"! |
|
176 |
+ |
* <p/> |
|
177 |
+ |
* This method is normally delegated to the 'Y' RenderHelper |
|
178 |
+ |
* |
|
179 |
+ |
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
|
180 |
+ |
*/ |
|
181 |
+ |
@Override |
|
182 |
+ |
public void setHeight( String pHeight ) { |
|
183 |
+ |
Parse.andSetSize( getRenderHelperY(), pHeight ); |
|
184 |
+ |
} |
|
185 |
+ |
|
|
186 |
+ |
/** |
|
187 |
+ |
* Sets the widget's height, unlike the standard GWT "UIObject" method, this pHeight is "assumed" to include ALL |
|
188 |
+ |
* decorations (such as border, margin, and padding). This means that a subsequent call to "getOffsetHeight()" |
|
189 |
+ |
* will "eventually" return the value "set"! |
|
190 |
+ |
* <p/> |
|
191 |
+ |
* This method is used by the 'Y' RenderHelper via the GwtRenderDimensionAdapterY to bypass the normal delegation |
|
192 |
+ |
* on "setHeight()" to the 'Y' RenderHelper. |
|
193 |
+ |
* |
|
194 |
+ |
* @param pHeight the Widget's new height, in CSS px (e.g. "10") |
|
195 |
+ |
*/ |
|
196 |
+ |
@Override |
|
197 |
+ |
public void LLsetWidgetHeight( int pHeight ) { |
|
198 |
+ |
Size.set( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement, pHeight, getDecorationSizeY() ); |
|
199 |
+ |
} |
|
200 |
+ |
|
|
201 |
+ |
/** |
|
202 |
+ |
* Remove the Widget's height, after this call subsequent calls to "getOffsetHeight()" will "eventually" return the |
|
203 |
+ |
* "natural" height of the Widget! |
|
204 |
+ |
*/ |
|
205 |
+ |
@Override |
|
206 |
+ |
public void clearHeight() { |
|
207 |
+ |
Size.clear( this, GwtElementDimensionHelperY.INSTANCE, mSizingElement ); |
|
208 |
+ |
} |
|
209 |
+ |
|
|
210 |
+ |
@Override |
|
211 |
+ |
public void renderingParticipationChanged() { |
|
212 |
+ |
RenderingParticipationChangedHelper.participationChanged( this, ContainerSupport.toArray( getChildren() ) ); |
|
213 |
+ |
} |
|
214 |
+ |
|
|
215 |
+ |
@Override |
|
216 |
+ |
public RenderHelper getRenderHelperX() { |
|
217 |
+ |
return mRenderHelperX; |
|
218 |
+ |
} |
|
219 |
+ |
|
|
220 |
+ |
@Override |
|
221 |
+ |
public RenderHelper getRenderHelperY() { |
|
222 |
+ |
return mRenderHelperY; |
|
223 |
+ |
} |
|
224 |
+ |
|
|
225 |
+ |
/** |
|
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) |
|
228 |
+ |
* <p/> |
|
229 |
+ |
* Note: this will NOT be called until the Container is reporting proper sizes! |
|
230 |
+ |
*/ |
|
231 |
+ |
@Override |
|
232 |
+ |
public int getDecorationSizeX() { |
|
233 |
+ |
return DecorationSize.calculate( this, GwtElementDimensionHelperX.INSTANCE, // |
|
234 |
+ |
getElement(), mSizingElement ); |
|
235 |
+ |
} |
|
236 |
+ |
|
|
237 |
+ |
/** |
|
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) |
|
240 |
+ |
* <p/> |
|
241 |
+ |
* Note: this will NOT be called until the Container is reporting proper sizes! |
|
242 |
+ |
*/ |
|
243 |
+ |
@Override |
|
244 |
+ |
public int getDecorationSizeY() { |
|
245 |
+ |
return DecorationSize.calculate( this, GwtElementDimensionHelperY.INSTANCE, // |
|
246 |
+ |
getElement(), mSizingElement ); |
|
247 |
+ |
} |
|
248 |
+ |
|
|
249 |
+ |
public void relayout() { |
|
250 |
+ |
getRenderHelperX().layout(); |
|
251 |
+ |
getRenderHelperY().layout(); |
|
252 |
+ |
} |
|
253 |
+ |
} |