litesoft
@ 950
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
package org.litesoft.GWT.client.widgets; import org.litesoft.commonfoundation.base.*; import com.google.gwt.dom.client.Style.*; import com.google.gwt.user.client.ui.*; public class Spacer extends Composite { private static final String BLANK_TEXT = " "; public Spacer( int pWidth, int pHeight ) { HTML widget = new HTML( BLANK_TEXT ); widget.getElement().getStyle().setOverflow( Overflow.HIDDEN ); initWidget( widget ); //noinspection GWTStyleCheck setStyleName( "LayoutSpacer" ); width( pWidth ); height( pHeight ); } public Spacer( int pWidthAndHeight ) { this( pWidthAndHeight, pWidthAndHeight ); } public Spacer() { this( 1 ); } /** * add a style "classname", and allow chaining calls. * * @param pStyle "classname" * * @return this */ public Spacer style( String pStyle ) { if ( null != (pStyle = ConstrainTo.significantOrNull( pStyle )) ) { addStyleName( pStyle ); } return this; } /** * Set the width, and allow chaining calls. */ public Spacer width( String pWidth ) { if ( pWidth != null ) { setWidth( pWidth ); } return this; } /** * Set the height, and allow chaining calls. */ public Spacer height( String pHeight ) { if ( pHeight != null ) { setHeight( pHeight ); } return this; } /** * Set the width & height, and allow chaining calls. */ public Spacer size( String pSize ) { return width( pSize ).height( pSize ); } /** * Set the width, and allow chaining calls. */ public Spacer width( int pWidth ) { return width( convertSizePositive( pWidth ) ); } /** * Set the height, and allow chaining calls. */ public Spacer height( int pHeight ) { return height( convertSizePositive( pHeight ) ); } /** * Set the width & height, and allow chaining calls. */ public Spacer size( int pSize ) { return size( convertSizePositive( pSize ) ); } private static String convertSizePositive( int pSize ) { return (pSize > 0) ? String.valueOf( pSize ) : null; } } |
Commits for litesoft/trunk/Java/GWT/Client/src/org/litesoft/GWT/client/widgets/Spacer.java
Revision | Author | Commited | Message |
---|---|---|---|
950 Diff | GeorgeS | Thu 19 Jun, 2014 17:57:04 +0000 | New Lines |
948 Diff | GeorgeS | Sat 07 Jun, 2014 23:42:39 +0000 | Jusefuls Formatter Updated to New Code Format |
939 Diff | GeorgeS | Mon 02 Jun, 2014 21:30:31 +0000 | Extracting commonfoundation |
801 Diff | GeorgeS | Wed 15 Aug, 2012 03:59:02 +0000 | |
749 Diff | GeorgeS | Fri 06 Jul, 2012 00:11:43 +0000 | |
626 | GeorgeS | Wed 11 Apr, 2012 19:39:41 +0000 |