com.sencha.gxt.widget.core.client.container
Class CssFloatLayoutContainer

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.InsertResizeContainer
                          extended by com.sencha.gxt.widget.core.client.container.CssFloatLayoutContainer
All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasEnabled, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, InsertPanel, InsertPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, HasScrollSupport, 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, java.lang.Iterable<Widget>
Direct Known Subclasses:
PortalLayoutContainer

public class CssFloatLayoutContainer
extends InsertResizeContainer
implements 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
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
static class CssFloatLayoutContainer.CssFloatData
          Specifies widget layout parameters that control the size of the widget.
static interface CssFloatLayoutContainer.CssFloatLayoutAppearance
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel
InsertPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
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
 void add(IsWidget child, CssFloatLayoutContainer.CssFloatData layoutData)
          Adds a widget to the CSS float layout container with the specified layout parameters.
 HandlerRegistration addScrollHandler(ScrollHandler handler)
           
 ScrollSupport.ScrollMode getScrollMode()
          Returns the scroll mode from the container's ScrollSupport instance.
 ScrollSupport getScrollSupport()
          Returns the scroll support instance.
 Style.Float getStyleFloat()
          Returns the value of the CSS float property.
 void insert(IsWidget w, int beforeIndex, CssFloatLayoutContainer.CssFloatData layoutData)
          Inserts the widget at the specified index in the CSS float layout container.
 boolean isAdjustForScroll()
          Returns true if adjust for scroll is enabled.
 void setAdjustForScroll(boolean adjustForScroll)
          True to adjust the container width calculations to account for the scroll bar (defaults to false).
 void setScrollMode(ScrollSupport.ScrollMode scrollMode)
          Sets the scroll mode on the container's ScrollSupport instance.
 void setScrollSupport(ScrollSupport support)
          Sets the scroll support.
 void setStyleFloat(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, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, 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
 
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, unsinkEvents
 
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.InsertPanel.ForIsWidget
add
 
Methods inherited from interface com.google.gwt.user.client.ui.InsertPanel
add
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

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(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 container
layoutData - the parameters that describe how to lay out the widget

addScrollHandler

public HandlerRegistration addScrollHandler(ScrollHandler handler)
Specified by:
addScrollHandler in interface 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: HasScrollSupport
Returns the scroll support instance.

Specified by:
getScrollSupport in interface HasScrollSupport
Returns:
the scroll support instance

getStyleFloat

public Style.Float getStyleFloat()
Returns the value of the CSS float property.

Returns:
the value of the CSS float property

insert

public void insert(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 container
beforeIndex - the insert index
layoutData - 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 if setScrollSupport(ScrollSupport) is called after calling this method.

Parameters:
scrollMode - the scroll mode

setScrollSupport

public void setScrollSupport(ScrollSupport support)
Description copied from interface: HasScrollSupport
Sets the scroll support.

Specified by:
setScrollSupport in interface HasScrollSupport
Parameters:
support - the scroll support

setStyleFloat

public void setStyleFloat(Style.Float styleFloat)
Sets the value of the CSS float property.

Parameters:
styleFloat - the value of the CSS float property


Copyright © 2012. All Rights Reserved.