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

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.InsertContainer
                      extended by com.sencha.gxt.widget.core.client.container.FlowLayoutContainer
All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, InsertPanel, InsertPanel.ForIsWidget, IsWidget, HasScrollSupport, 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<Widget>

public class FlowLayoutContainer
extends InsertContainer
implements HasScrollHandlers, HasScrollSupport

A flow layout container that supports scrolling and lays out its widgets using the default HTML layout behavior.

Code Snippet:

    FlowLayoutContainer c = new FlowLayoutContainer();
    c.setScrollMode(ScrollMode.ALWAYS);
    MarginData layoutData = new MarginData(new Margins(0, 5, 0, 0));
    c.add(new TextButton("Button 1"), layoutData);
    c.add(new TextButton("Button 2"), layoutData);
    c.add(new TextButton("Button 3"), layoutData);
    Viewport v = new Viewport();
    v.add(c);
    RootPanel.get().add(v);
 


Nested Class Summary
 
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
FlowLayoutContainer()
          Creates a flow layout container.
 
Method Summary
 void add(IsWidget child, MarginData layoutData)
          Adds a widget to a flow 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.
 void insert(IsWidget w, int beforeIndex, MarginData layoutData)
          Inserts the widget at the specified index in the flow layout container.
 void setScrollMode(ScrollSupport.ScrollMode scrollMode)
          Sets the scroll mode on the container's ScrollSupport instance.
 void setScrollSupport(ScrollSupport support)
          Sets the scroll support.
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.InsertContainer
insert, insert
 
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

FlowLayoutContainer

public FlowLayoutContainer()
Creates a flow layout container.

Method Detail

add

@UiChild(tagname="child")
public void add(IsWidget child,
                               MarginData layoutData)
Adds a widget to a flow 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

insert

public void insert(IsWidget w,
                   int beforeIndex,
                   MarginData layoutData)
Inserts the widget at the specified index in the flow 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

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


Copyright © 2012. All Rights Reserved.