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

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.BoxLayoutContainer
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, HasEnabled, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, IndexedPanel, IndexedPanel.ForIsWidget, InsertPanel, InsertPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, 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:
HBoxLayoutContainer, VBoxLayoutContainer

public abstract class BoxLayoutContainer
extends InsertResizeContainer

A base class for box layout containers. Provides behavior common to all box layout containers, including packing, padding and the action to take on insert and remove.


Nested Class Summary
static interface BoxLayoutContainer.BoxLayoutContainerAppearance
           
static class BoxLayoutContainer.BoxLayoutData
          Specifies box layout parameters which control the minimum and maximum size, as well as the "flex" value.
static class BoxLayoutContainer.BoxLayoutPack
          BoxLayoutPack enumeration.
 
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
BoxLayoutContainer()
          Creates a box layout container with the default appearance.
BoxLayoutContainer(BoxLayoutContainer.BoxLayoutContainerAppearance appearance)
          Creates a box layout container with the specified appearance.
 
Method Summary
 void add(IsWidget child, BoxLayoutContainer.BoxLayoutData layoutData)
          Adds a widget to this box layout container with the specified layout parameters.
 BoxLayoutContainer.BoxLayoutPack getPack()
          Returns the layout's pack value.
 Padding getPadding()
          Returns the padding between widgets.
 int getScrollOffset()
          Returns the scroll offset.
 void insert(IsWidget w, int beforeIndex, BoxLayoutContainer.BoxLayoutData layoutData)
          Inserts a widget into the box layout container.
 boolean isAdjustForFlexRemainder()
          Returns true if the remaining space after flex calculation is applied to the last widget being flexed.
 void setAdjustForFlexRemainder(boolean adjustForFlexRemainder)
          Set to true if the remaining space after flex calculation should be applied to the last widget being flexed.
 void setPack(BoxLayoutContainer.BoxLayoutPack pack)
          Sets how the child items of the container are packed together.
 void setPadding(Padding padding)
          Sets the padding to use for the box layout container (i.e.
 void setScrollOffset(int scrollOffset)
          Sets the scroll offset (defaults to 0).
 
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

BoxLayoutContainer

public BoxLayoutContainer()
Creates a box layout container with the default appearance.


BoxLayoutContainer

public BoxLayoutContainer(BoxLayoutContainer.BoxLayoutContainerAppearance appearance)
Creates a box layout container with the specified appearance.

Parameters:
appearance - the box layout container appearance
Method Detail

add

@UiChild(tagname="child")
public void add(IsWidget child,
                               BoxLayoutContainer.BoxLayoutData layoutData)
Adds a widget to this box layout container with the specified layout parameters.

Parameters:
child - the widget to add
layoutData - the layout parameters

getPack

public BoxLayoutContainer.BoxLayoutPack getPack()
Returns the layout's pack value.

Returns:
the pack value

getPadding

public Padding getPadding()
Returns the padding between widgets.

Returns:
the padding between widgets.

getScrollOffset

public int getScrollOffset()
Returns the scroll offset.

Returns:
the scroll offset

insert

public void insert(IsWidget w,
                   int beforeIndex,
                   BoxLayoutContainer.BoxLayoutData layoutData)
Inserts a widget into the box layout container.

Parameters:
w - the widget
beforeIndex - the insert index
layoutData - the layout parameters

isAdjustForFlexRemainder

public boolean isAdjustForFlexRemainder()
Returns true if the remaining space after flex calculation is applied to the last widget being flexed.

Returns:
true if adjusting for flex remainder

setAdjustForFlexRemainder

public void setAdjustForFlexRemainder(boolean adjustForFlexRemainder)
Set to true if the remaining space after flex calculation should be applied to the last widget being flexed.

Parameters:
adjustForFlexRemainder - true to add the space

setPack

public void setPack(BoxLayoutContainer.BoxLayoutPack pack)
Sets how the child items of the container are packed together.

Parameters:
pack - the pack value

setPadding

public void setPadding(Padding padding)
Sets the padding to use for the box layout container (i.e. the container itself, independent of any contained widgets).

Parameters:
padding - the padding

setScrollOffset

public void setScrollOffset(int scrollOffset)
Sets the scroll offset (defaults to 0).

Parameters:
scrollOffset - the scroll offset


Copyright © 2012. All Rights Reserved.