|
@@ -1,57 +1,57 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.widgets.nonpublic; |
3 |
|
- |
|
4 |
|
- |
import com.google.gwt.user.client.*; |
5 |
|
- |
|
6 |
|
- |
public class AbstractSizeableVerticalPanel extends AbstractSizeableOneDimensionalPanel { |
7 |
|
- |
@Override |
8 |
|
- |
protected Element unwrap( Element pTD ) { |
9 |
|
- |
return DOM.getParent( pTD ); // TR |
10 |
|
- |
} |
11 |
|
- |
|
12 |
|
- |
@Override |
13 |
|
- |
protected Element wrap( Element pTD ) { |
14 |
|
- |
return addParent( DOM.createTR(), pTD ); |
15 |
|
- |
} |
16 |
|
- |
|
17 |
|
- |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
18 |
|
- |
|
19 |
|
- |
@Override |
20 |
|
- |
public void setWidth( String width ) { |
21 |
|
- |
if ( (mMinimumWidth == null) && anyChildren() ) { |
22 |
|
- |
Element elem = DOM.getParent( getContainerElement() ); |
23 |
|
- |
int currentWidth = DOM.getElementPropertyInt( elem, "offsetWidth" ); |
24 |
|
- |
if ( currentWidth > 0 ) { |
25 |
|
- |
getHelper().setDimensionOnChildren( this, getWidthHelper(), currentWidth ); |
26 |
|
- |
mMinimumWidth = currentWidth; |
27 |
|
- |
} |
28 |
|
- |
} |
29 |
|
- |
super.setWidth( width ); |
30 |
|
- |
} |
31 |
|
- |
|
32 |
|
- |
private Integer mMinimumWidth = null; |
33 |
|
- |
|
34 |
|
- |
@Override |
35 |
|
- |
public void setHeight( String height ) { |
36 |
|
- |
super.setHeight( height ); // for stacktrace Debugging |
37 |
|
- |
} |
38 |
|
- |
|
39 |
|
- |
@Override |
40 |
|
- |
protected void distributeToChildrenChangedWidth() { |
41 |
|
- |
if ( anyChildren() ) { |
42 |
|
- |
getHelper().applyChangedDimensionToChildren( this, getWidthHelper() ); |
43 |
|
- |
} |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
@Override |
47 |
|
- |
protected void distributeToChildrenChangedHeight() { |
48 |
|
- |
if ( anyChildren() ) { |
49 |
|
- |
AbstractSizeableHelper asHelper = getHelper(); |
50 |
|
- |
if ( asHelper.isOverflowHidden() ) { |
51 |
|
- |
asHelper.distributeDimensionOnChildren( this, getHeightHelper() ); |
52 |
|
- |
} else { |
53 |
|
- |
asHelper.setDimensionOnChildren( this, getHeightHelper(), 400 ); |
54 |
|
- |
} |
55 |
|
- |
} |
56 |
|
- |
} |
57 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.widgets.nonpublic; |
|
3 |
+ |
|
|
4 |
+ |
import com.google.gwt.user.client.*; |
|
5 |
+ |
|
|
6 |
+ |
public class AbstractSizeableVerticalPanel extends AbstractSizeableOneDimensionalPanel { |
|
7 |
+ |
@Override |
|
8 |
+ |
protected Element unwrap( Element pTD ) { |
|
9 |
+ |
return DOM.getParent( pTD ); // TR |
|
10 |
+ |
} |
|
11 |
+ |
|
|
12 |
+ |
@Override |
|
13 |
+ |
protected Element wrap( Element pTD ) { |
|
14 |
+ |
return addParent( DOM.createTR(), pTD ); |
|
15 |
+ |
} |
|
16 |
+ |
|
|
17 |
+ |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
|
18 |
+ |
|
|
19 |
+ |
@Override |
|
20 |
+ |
public void setWidth( String width ) { |
|
21 |
+ |
if ( (mMinimumWidth == null) && anyChildren() ) { |
|
22 |
+ |
Element elem = DOM.getParent( getContainerElement() ); |
|
23 |
+ |
int currentWidth = DOM.getElementPropertyInt( elem, "offsetWidth" ); |
|
24 |
+ |
if ( currentWidth > 0 ) { |
|
25 |
+ |
getHelper().setDimensionOnChildren( this, getWidthHelper(), currentWidth ); |
|
26 |
+ |
mMinimumWidth = currentWidth; |
|
27 |
+ |
} |
|
28 |
+ |
} |
|
29 |
+ |
super.setWidth( width ); |
|
30 |
+ |
} |
|
31 |
+ |
|
|
32 |
+ |
private Integer mMinimumWidth = null; |
|
33 |
+ |
|
|
34 |
+ |
@Override |
|
35 |
+ |
public void setHeight( String height ) { |
|
36 |
+ |
super.setHeight( height ); // for stacktrace Debugging |
|
37 |
+ |
} |
|
38 |
+ |
|
|
39 |
+ |
@Override |
|
40 |
+ |
protected void distributeToChildrenChangedWidth() { |
|
41 |
+ |
if ( anyChildren() ) { |
|
42 |
+ |
getHelper().applyChangedDimensionToChildren( this, getWidthHelper() ); |
|
43 |
+ |
} |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
@Override |
|
47 |
+ |
protected void distributeToChildrenChangedHeight() { |
|
48 |
+ |
if ( anyChildren() ) { |
|
49 |
+ |
AbstractSizeableHelper asHelper = getHelper(); |
|
50 |
+ |
if ( asHelper.isOverflowHidden() ) { |
|
51 |
+ |
asHelper.distributeDimensionOnChildren( this, getHeightHelper() ); |
|
52 |
+ |
} else { |
|
53 |
+ |
asHelper.setDimensionOnChildren( this, getHeightHelper(), 400 ); |
|
54 |
+ |
} |
|
55 |
+ |
} |
|
56 |
+ |
} |
|
57 |
+ |
} |