Package com.vaadin.client.ui
Class VAccordion.StackItem
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.ComplexPanel
-
- com.vaadin.client.ui.VAccordion.StackItem
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.ClickHandler,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.EventHandler,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,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.IsWidget,Iterable<com.google.gwt.user.client.ui.Widget>
- Enclosing class:
- VAccordion
public class VAccordion.StackItem extends com.google.gwt.user.client.ui.ComplexPanel implements com.google.gwt.event.dom.client.ClickHandlerA StackItem has always two children, Child 0 is a VCaption, Child 1 is the actual child widget.
-
-
Nested Class Summary
-
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
-
-
Constructor Summary
Constructors Constructor Description StackItem()Constructs a stack item.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Closes this stack item and removes the wrapped widget from the DOM tree and this stack item.booleancontains(ComponentConnector p)Deprecated.This method is not called by the framework code anymore.intgetCaptionHeight()Returns the offset height of the caption node.intgetCaptionWidth()Returns caption width including padding.com.google.gwt.user.client.ui.WidgetgetChildWidget()Returns the wrapped widget of this stack item.com.google.gwt.user.client.ui.WidgetgetComponent()Deprecated.This method is not called by the framework code anymore.com.google.gwt.user.client.ElementgetContainerElement()Returns the container element for the content widget.intgetHeight()Deprecated.This method is not called by the framework code anymore.intgetWidgetWidth()Returns the offset width of the wrapped widget.voidhide()Deprecated.This method is not called by the framework code anymore.booleanisCaptionVisible()Deprecated.This method is not called by the framework code anymore.booleanisOpen()Returns whether this stack item is open or not.voidonBrowserEvent(com.google.gwt.user.client.Event event)voidonClick(com.google.gwt.event.dom.client.ClickEvent event)voidopen()Opens the stack item and clears any previous visibility settings.voidreplaceWidget(com.google.gwt.user.client.ui.Widget newWidget)Replaces the existing wrapped widget (if any) with a new widget.voidsetContent(com.google.gwt.user.client.ui.Widget newWidget)Updates the content of the open tab of the accordion.voidsetHeight(int height)Sets the height for this stack item's contents.voidsetHeightFromWidget()Queries the height from the wrapped widget and uses it to set this stack item's height.voidsetId(String newId)Sets the identifier for this stack item.voidsetWidth(int width)Sets the width of the stack item, or removes it if given value is-1.voidupdateCaption(TabState tabState)Updates the caption to match the current tab state.-
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
setHeight
public void setHeight(int height)
Sets the height for this stack item's contents.- Parameters:
height- the height to set (in pixels), or-1to remove height
-
setId
public void setId(String newId)
Sets the identifier for this stack item.- Parameters:
newId- the identifier to set
-
getComponent
@Deprecated public com.google.gwt.user.client.ui.Widget getComponent()
Deprecated.This method is not called by the framework code anymore. UsegetChildWidget()instead.Returns the wrapped widget of this stack item.- Returns:
- the widget
-
setHeightFromWidget
public void setHeightFromWidget()
Queries the height from the wrapped widget and uses it to set this stack item's height.
-
getCaptionWidth
public int getCaptionWidth()
Returns caption width including padding.- Returns:
- the width of the caption (in pixels), or zero if there is no caption element (not possible via the default implementation)
-
setWidth
public void setWidth(int width)
Sets the width of the stack item, or removes it if given value is-1.- Parameters:
width- the width to set (in pixels), or-1to remove width
-
getHeight
@Deprecated public int getHeight()
Deprecated.This method is not called by the framework code anymore. UseUIObject.getOffsetHeight()instead.Returns the offset height of this stack item.- Returns:
- the height in pixels
-
getCaptionHeight
public int getCaptionHeight()
Returns the offset height of the caption node.- Returns:
- the height in pixels
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
getContainerElement
public com.google.gwt.user.client.Element getContainerElement()
Returns the container element for the content widget.- Returns:
- the content container element
-
getChildWidget
public com.google.gwt.user.client.ui.Widget getChildWidget()
Returns the wrapped widget of this stack item.- Returns:
- the widget
-
replaceWidget
public void replaceWidget(com.google.gwt.user.client.ui.Widget newWidget)
Replaces the existing wrapped widget (if any) with a new widget.- Parameters:
newWidget- the new widget to wrap
-
open
public void open()
Opens the stack item and clears any previous visibility settings.
-
hide
@Deprecated public void hide()
Deprecated.This method is not called by the framework code anymore.Hides the stack item content but does not close the stack item.
-
close
public void close()
Closes this stack item and removes the wrapped widget from the DOM tree and this stack item.
-
isOpen
public boolean isOpen()
Returns whether this stack item is open or not.- Returns:
trueif open,falseotherwise
-
setContent
public void setContent(com.google.gwt.user.client.ui.Widget newWidget)
Updates the content of the open tab of the accordion. This method is mostly for internal use and may change in future versions.- Parameters:
newWidget- new content- Since:
- 7.2
-
onClick
public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
- Specified by:
onClickin interfacecom.google.gwt.event.dom.client.ClickHandler
-
updateCaption
public void updateCaption(TabState tabState)
Updates the caption to match the current tab state.- Parameters:
tabState- the state for this stack item
-
getWidgetWidth
public int getWidgetWidth()
Returns the offset width of the wrapped widget.- Returns:
- the offset width in pixels, or zero if no widget is set
-
contains
@Deprecated public boolean contains(ComponentConnector p)
Deprecated.This method is not called by the framework code anymore.Returns whether the given container's widget is this stack item's wrapped widget. Does not check whether the given container's widget is a child of the wrapped widget.- Parameters:
p- the container whose widget to set- Returns:
trueif the container's widget matches wrapped widget,falseotherwise
-
isCaptionVisible
@Deprecated public boolean isCaptionVisible()
Deprecated.This method is not called by the framework code anymore.Returns whether the caption element is visible or not.- Returns:
trueif visible,falseotherwise
-
-