Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/nonpublic/WidthStretchableAdjustor.java

Diff revisions: vs.
  @@ -1,21 +1,21 @@
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 -
6 - import com.google.gwt.user.client.ui.*;
7 -
8 - public class WidthStretchableAdjustor implements StretchabilityAdjustor {
9 - public static final StretchabilityAdjustor INSTANCE = new WidthStretchableAdjustor();
10 -
11 - @Override
12 - public Widget adjustStretchability( Widget pWidget ) {
13 - return isStretchable( pWidget ) ? //
14 - pWidget : //
15 - new SizeableSimplePanel( true, pWidget ).stretchableHorizontally();
16 - }
17 -
18 - public static boolean isStretchable( Widget pWidget ) {
19 - return (pWidget instanceof ISizeableWidget) && ((ISizeableWidget) pWidget).getWidthHelper().isStretchable();
20 - }
21 - }
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 +
6 + import com.google.gwt.user.client.ui.*;
7 +
8 + public class WidthStretchableAdjustor implements StretchabilityAdjustor {
9 + public static final StretchabilityAdjustor INSTANCE = new WidthStretchableAdjustor();
10 +
11 + @Override
12 + public Widget adjustStretchability( Widget pWidget ) {
13 + return isStretchable( pWidget ) ? //
14 + pWidget : //
15 + new SizeableSimplePanel( true, pWidget ).stretchableHorizontally();
16 + }
17 +
18 + public static boolean isStretchable( Widget pWidget ) {
19 + return (pWidget instanceof ISizeableWidget) && ((ISizeableWidget) pWidget).getWidthHelper().isStretchable();
20 + }
21 + }