|
@@ -1,62 +1,62 @@ |
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.logger.*; |
5 |
|
- |
|
6 |
|
- |
import com.google.gwt.user.client.*; |
7 |
|
- |
|
8 |
|
- |
public class AbstractSizeableHorizontalPanel extends AbstractSizeableOneDimensionalPanel { |
9 |
|
- |
private static final Logger LOGGER_SHP = LoggerFactory.getLogger( "SHP" ); |
10 |
|
- |
|
11 |
|
- |
@Override |
12 |
|
- |
protected Element unwrap( Element pTD ) { |
13 |
|
- |
return pTD; |
14 |
|
- |
} |
15 |
|
- |
|
16 |
|
- |
@Override |
17 |
|
- |
protected Element wrap( Element pTD ) { |
18 |
|
- |
return pTD; |
19 |
|
- |
} |
20 |
|
- |
|
21 |
|
- |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
22 |
|
- |
|
23 |
|
- |
@Override |
24 |
|
- |
public void setWidth( String width ) { |
25 |
|
- |
super.setWidth( width ); // for stacktrace Debugging |
26 |
|
- |
} |
27 |
|
- |
|
28 |
|
- |
@Override |
29 |
|
- |
public void setHeight( String height ) { |
30 |
|
- |
if ( (mMinimumHeight == null) && anyChildren() ) { |
31 |
|
- |
int currentHeight = DOM.getElementPropertyInt( getContainerElement(), "offsetHeight" ); |
32 |
|
- |
LOGGER_SHP.debug().log( "setHeight: " + height + " | " + currentHeight ); |
33 |
|
- |
if ( currentHeight > 0 ) { |
34 |
|
- |
getHelper().setDimensionOnChildren( this, getHeightHelper(), currentHeight ); |
35 |
|
- |
mMinimumHeight = currentHeight; |
36 |
|
- |
} |
37 |
|
- |
} |
38 |
|
- |
super.setHeight( height ); |
39 |
|
- |
} |
40 |
|
- |
|
41 |
|
- |
private Integer mMinimumHeight = null; |
42 |
|
- |
|
43 |
|
- |
@Override |
44 |
|
- |
protected void distributeToChildrenChangedWidth() { |
45 |
|
- |
if ( anyChildren() ) { |
46 |
|
- |
AbstractSizeableHelper asHelper = getHelper(); |
47 |
|
- |
if ( asHelper.isOverflowHidden() ) { |
48 |
|
- |
asHelper.distributeDimensionOnChildren( this, getWidthHelper() ); |
49 |
|
- |
} else { |
50 |
|
- |
asHelper.setDimensionOnChildren( this, getWidthHelper(), 500 ); |
51 |
|
- |
} |
52 |
|
- |
} |
53 |
|
- |
} |
54 |
|
- |
|
55 |
|
- |
@Override |
56 |
|
- |
protected void distributeToChildrenChangedHeight() { |
57 |
|
- |
if ( anyChildren() ) { |
58 |
|
- |
LOGGER_SHP.debug().log( "distributeToChildrenChangedHeight: " + getOffsetHeight() ); |
59 |
|
- |
getHelper().applyChangedDimensionToChildren( this, getHeightHelper() ); |
60 |
|
- |
} |
61 |
|
- |
} |
62 |
|
- |
} |
|
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.logger.*; |
|
5 |
+ |
|
|
6 |
+ |
import com.google.gwt.user.client.*; |
|
7 |
+ |
|
|
8 |
+ |
public class AbstractSizeableHorizontalPanel extends AbstractSizeableOneDimensionalPanel { |
|
9 |
+ |
private static final Logger LOGGER_SHP = LoggerFactory.getLogger( "SHP" ); |
|
10 |
+ |
|
|
11 |
+ |
@Override |
|
12 |
+ |
protected Element unwrap( Element pTD ) { |
|
13 |
+ |
return pTD; |
|
14 |
+ |
} |
|
15 |
+ |
|
|
16 |
+ |
@Override |
|
17 |
+ |
protected Element wrap( Element pTD ) { |
|
18 |
+ |
return pTD; |
|
19 |
+ |
} |
|
20 |
+ |
|
|
21 |
+ |
//****** Implementation Code Block to support delegation to AbsoluteSizeHelper |
|
22 |
+ |
|
|
23 |
+ |
@Override |
|
24 |
+ |
public void setWidth( String width ) { |
|
25 |
+ |
super.setWidth( width ); // for stacktrace Debugging |
|
26 |
+ |
} |
|
27 |
+ |
|
|
28 |
+ |
@Override |
|
29 |
+ |
public void setHeight( String height ) { |
|
30 |
+ |
if ( (mMinimumHeight == null) && anyChildren() ) { |
|
31 |
+ |
int currentHeight = DOM.getElementPropertyInt( getContainerElement(), "offsetHeight" ); |
|
32 |
+ |
LOGGER_SHP.debug().log( "setHeight: " + height + " | " + currentHeight ); |
|
33 |
+ |
if ( currentHeight > 0 ) { |
|
34 |
+ |
getHelper().setDimensionOnChildren( this, getHeightHelper(), currentHeight ); |
|
35 |
+ |
mMinimumHeight = currentHeight; |
|
36 |
+ |
} |
|
37 |
+ |
} |
|
38 |
+ |
super.setHeight( height ); |
|
39 |
+ |
} |
|
40 |
+ |
|
|
41 |
+ |
private Integer mMinimumHeight = null; |
|
42 |
+ |
|
|
43 |
+ |
@Override |
|
44 |
+ |
protected void distributeToChildrenChangedWidth() { |
|
45 |
+ |
if ( anyChildren() ) { |
|
46 |
+ |
AbstractSizeableHelper asHelper = getHelper(); |
|
47 |
+ |
if ( asHelper.isOverflowHidden() ) { |
|
48 |
+ |
asHelper.distributeDimensionOnChildren( this, getWidthHelper() ); |
|
49 |
+ |
} else { |
|
50 |
+ |
asHelper.setDimensionOnChildren( this, getWidthHelper(), 500 ); |
|
51 |
+ |
} |
|
52 |
+ |
} |
|
53 |
+ |
} |
|
54 |
+ |
|
|
55 |
+ |
@Override |
|
56 |
+ |
protected void distributeToChildrenChangedHeight() { |
|
57 |
+ |
if ( anyChildren() ) { |
|
58 |
+ |
LOGGER_SHP.debug().log( "distributeToChildrenChangedHeight: " + getOffsetHeight() ); |
|
59 |
+ |
getHelper().applyChangedDimensionToChildren( this, getHeightHelper() ); |
|
60 |
+ |
} |
|
61 |
+ |
} |
|
62 |
+ |
} |