public class CardLayoutContainer extends InsertResizeContainer implements HasActiveWidget
final CardLayoutContainer c = new CardLayoutContainer(); c.add(new Label("Card 1")); c.add(new Label("Card 2")); RootPanel.get().add(c); Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { @Override public boolean execute() { c.setActiveWidget(c.getActiveWidget() == c.getWidget(0) ? c.getWidget(1) : c.getWidget(0)); return true; } }, 500);
forceLayoutCommand, forceLayoutOnResize, hadLayoutRunning, layoutCommand, layoutRequiredThisEventLoop, layoutRunning
adjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask
Constructor and Description |
---|
CardLayoutContainer()
Creates a card layout container.
|
Modifier and Type | Method and Description |
---|---|
void |
add(IsWidget child,
MarginData layoutData)
Adds a widget to a card layout container with specified layout parameters.
|
protected void |
doLayout() |
protected void |
forceLayoutOnChildren(IndexedPanel widgets) |
Widget |
getActiveWidget()
Returns the active widget.
|
void |
insert(IsWidget w,
int beforeIndex,
MarginData layoutData)
Inserts the widget at the specified index in the card layout container.
|
protected void |
onInsert(int index,
Widget child) |
protected void |
onRemove(Widget child) |
void |
setActiveWidget(IsWidget widget)
Sets the active widget.
|
void |
setActiveWidget(Widget widget)
Sets the active widget.
|
insert, insert
applyLayout, applyLayout, forceLayout, getLeftRightMargins, getParentLayoutWidget, getSideMargins, getTopBottomMargins, isLayoutRunning, isOrWasLayoutRunning, isWidgetVisible, onBeforeDoLayout, onLoad, onResize, onResize
add, add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, adjustIndex, adopt, checkIndexBoundsForInsertion, clear, disable, doAttachChildren, doDetachChildren, doPhysicalAttach, doPhysicalDetach, enable, ensureGroupingHandlerRegistration, findWidget, getChildren, getContainerTarget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, onWidgetHide, onWidgetShow, orphan, remove, remove, remove
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addGestureRecognizer, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disableContextMenu, disableEvents, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getElement, getFocusEl, getFocusSupport, getGestureRecognizer, getGestureRecognizerCount, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAfterFirstAttach, onAttach, onBlur, onBrowserEvent, onDetach, onDisable, onEnable, onFocus, onHide, onHideContextMenu, onPosition, onRightClick, onShow, onShowContextMenu, onTouch, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
public CardLayoutContainer()
public void add(IsWidget child, MarginData layoutData)
child
- the widget to add to the layout containerlayoutData
- the parameters that describe how to layout the widgetpublic Widget getActiveWidget()
HasActiveWidget
getActiveWidget
in interface HasActiveWidget
public void insert(IsWidget w, int beforeIndex, MarginData layoutData)
w
- the widget to insert in the layout containerbeforeIndex
- the insert indexlayoutData
- the parameters that describe how to lay out the widgetpublic void setActiveWidget(IsWidget widget)
setActiveWidget
in interface HasActiveWidget
widget
- the widgetpublic void setActiveWidget(Widget widget)
HasActiveWidget
setActiveWidget
in interface HasActiveWidget
widget
- the widgetprotected void forceLayoutOnChildren(IndexedPanel widgets)
forceLayoutOnChildren
in class ResizeContainer
protected void doLayout()
doLayout
in class ResizeContainer
Copyright © 2018. All rights reserved.