Class CssFloatLayoutContainer
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.sencha.gxt.widget.core.client.Component
-
- com.sencha.gxt.widget.core.client.container.Container
-
- com.sencha.gxt.widget.core.client.container.ResizeContainer
-
- com.sencha.gxt.widget.core.client.container.InsertResizeContainer
-
- com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasScrollHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasResizeHandlers,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.HasEnabled,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IndexedPanel,com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget,com.google.gwt.user.client.ui.InsertPanel,com.google.gwt.user.client.ui.InsertPanel.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,com.google.gwt.user.client.ui.ProvidesResize,com.google.gwt.user.client.ui.RequiresResize,HasScrollSupport,HasGestureRecognizers,HasLayout,AddEvent.HasAddHandlers,BeforeAddEvent.HasBeforeAddHandlers,BeforeHideEvent.HasBeforeHideHandlers,BeforeRemoveEvent.HasBeforeRemoveHandlers,BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler,BeforeShowEvent.HasBeforeShowHandlers,BlurEvent.HasBlurHandlers,ContainerHandler.HasContainerHandlers,DisableEvent.HasDisableHandlers,EnableEvent.HasEnableHandlers,FocusEvent.HasFocusHandlers,HideEvent.HasHideHandlers,MoveEvent.HasMoveHandlers,RemoveEvent.HasRemoveHandlers,ShowContextMenuEvent.HasShowContextMenuHandler,ShowEvent.HasShowHandlers,HasFocusSupport,HasItemId,Iterable<com.google.gwt.user.client.ui.Widget>
public class CssFloatLayoutContainer extends InsertResizeContainer implements com.google.gwt.event.dom.client.HasScrollHandlers, HasScrollSupport
A layout container that uses the CSS float style to enable widgets to float around other widgets.
Code Snippet:
CssFloatLayoutContainer c = new CssFloatLayoutContainer(); HTML rectangle = new HTML("I'm a Red<br/>Rectangle"); Label text = new Label("This text will flow around the Red Rectangle because that's the way things work in CssFloatLayoutContainer. You may need to resize the browser window to see the effect."); c.add(rectangle, new CssFloatData(100)); c.add(text); rectangle.getElement().getStyle().setBackgroundColor("red"); text.getElement().getStyle().setFloat(Float.NONE); text.getElement().getStyle().setDisplay(Display.INLINE); Viewport v = new Viewport(); v.add(c); RootPanel.get().add(v);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCssFloatLayoutContainer.CssFloatDataSpecifies widget layout parameters that control the size of the widget.static interfaceCssFloatLayoutContainer.CssFloatLayoutAppearance-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
-
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
-
-
Constructor Summary
Constructors Constructor Description CssFloatLayoutContainer()Creates a CSS float layout container with the default appearance.CssFloatLayoutContainer(CssFloatLayoutContainer.CssFloatLayoutAppearance appearance)Creates a CSS float layout container with the specified appearance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(com.google.gwt.user.client.ui.IsWidget child, CssFloatLayoutContainer.CssFloatData layoutData)Adds a widget to the CSS float layout container with the specified layout parameters.com.google.gwt.event.shared.HandlerRegistrationaddScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)ScrollSupport.ScrollModegetScrollMode()Returns the scroll mode from the container's ScrollSupport instance.ScrollSupportgetScrollSupport()Returns the scroll support instance.com.google.gwt.dom.client.Style.FloatgetStyleFloat()Returns the value of the CSS float property.voidinsert(com.google.gwt.user.client.ui.IsWidget w, int beforeIndex, CssFloatLayoutContainer.CssFloatData layoutData)Inserts the widget at the specified index in the CSS float layout container.booleanisAdjustForScroll()Returns true if adjust for scroll is enabled.voidsetAdjustForScroll(boolean adjustForScroll)True to adjust the container width calculations to account for the scroll bar (defaults to false).voidsetScrollMode(ScrollSupport.ScrollMode scrollMode)Sets the scroll mode on the container's ScrollSupport instance.voidsetScrollSupport(ScrollSupport support)Sets the scroll support.voidsetStyleFloat(com.google.gwt.dom.client.Style.Float styleFloat)Sets the value of the CSS float property.-
Methods inherited from class com.sencha.gxt.widget.core.client.container.InsertResizeContainer
insert, insert
-
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
-
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
-
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideToolTip, isAdjustSize, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeGestureRecognizer, removeToolTip, setAdjustSize, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
-
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
CssFloatLayoutContainer
public CssFloatLayoutContainer()
Creates a CSS float layout container with the default appearance.
-
CssFloatLayoutContainer
public CssFloatLayoutContainer(CssFloatLayoutContainer.CssFloatLayoutAppearance appearance)
Creates a CSS float layout container with the specified appearance.- Parameters:
appearance- the appearance of the CSS float layout container
-
-
Method Detail
-
add
@UiChild(tagname="child") public void add(com.google.gwt.user.client.ui.IsWidget child, CssFloatLayoutContainer.CssFloatData layoutData)Adds a widget to the CSS float layout container with the specified layout parameters.- Parameters:
child- the widget to add to the layout containerlayoutData- the parameters that describe how to lay out the widget
-
addScrollHandler
public com.google.gwt.event.shared.HandlerRegistration addScrollHandler(com.google.gwt.event.dom.client.ScrollHandler handler)
- Specified by:
addScrollHandlerin interfacecom.google.gwt.event.dom.client.HasScrollHandlers
-
getScrollMode
public ScrollSupport.ScrollMode getScrollMode()
Returns the scroll mode from the container's ScrollSupport instance.- Returns:
- the scroll mode
-
getScrollSupport
public ScrollSupport getScrollSupport()
Description copied from interface:HasScrollSupportReturns the scroll support instance.- Specified by:
getScrollSupportin interfaceHasScrollSupport- Returns:
- the scroll support instance
-
getStyleFloat
public com.google.gwt.dom.client.Style.Float getStyleFloat()
Returns the value of the CSS float property.- Returns:
- the value of the CSS float property
-
insert
public void insert(com.google.gwt.user.client.ui.IsWidget w, int beforeIndex, CssFloatLayoutContainer.CssFloatData layoutData)Inserts the widget at the specified index in the CSS float layout container.- Parameters:
w- the widget to insert in the layout containerbeforeIndex- the insert indexlayoutData- the parameters that describe how to lay out the widget
-
isAdjustForScroll
public boolean isAdjustForScroll()
Returns true if adjust for scroll is enabled.- Returns:
- the adjust for scroll state
-
setAdjustForScroll
public void setAdjustForScroll(boolean adjustForScroll)
True to adjust the container width calculations to account for the scroll bar (defaults to false).- Parameters:
adjustForScroll- the adjust for scroll state
-
setScrollMode
public void setScrollMode(ScrollSupport.ScrollMode scrollMode)
Sets the scroll mode on the container's ScrollSupport instance. The scroll mode will not be preserved ifsetScrollSupport(ScrollSupport)is called after calling this method.- Parameters:
scrollMode- the scroll mode
-
setScrollSupport
public void setScrollSupport(ScrollSupport support)
Description copied from interface:HasScrollSupportSets the scroll support.- Specified by:
setScrollSupportin interfaceHasScrollSupport- Parameters:
support- the scroll support
-
setStyleFloat
public void setStyleFloat(com.google.gwt.dom.client.Style.Float styleFloat)
Sets the value of the CSS float property.- Parameters:
styleFloat- the value of the CSS float property
-
-