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:
public class VAccordion.StackItem extends com.google.gwt.user.client.ui.ComplexPanel implements com.google.gwt.event.dom.client.ClickHandler
A 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 Modifier and Type Method Description void
close()
Closes this stack item and removes the wrapped widget from the DOM tree and this stack item.
boolean
contains(ComponentConnector p)
Deprecated.
This method is not called by the framework code anymore.int
getCaptionHeight()
Returns the offset height of the caption node.
int
getCaptionWidth()
Returns caption width including padding.
com.google.gwt.user.client.ui.Widget
getChildWidget()
Returns the wrapped widget of this stack item.
com.google.gwt.user.client.ui.Widget
getComponent()
Deprecated.
This method is not called by the framework code anymore.com.google.gwt.user.client.Element
getContainerElement()
Returns the container element for the content widget.
int
getHeight()
Deprecated.
This method is not called by the framework code anymore.int
getWidgetWidth()
Returns the offset width of the wrapped widget.
void
hide()
Deprecated.
This method is not called by the framework code anymore.boolean
isCaptionVisible()
Deprecated.
This method is not called by the framework code anymore.boolean
isOpen()
Returns whether this stack item is open or not.
void
onBrowserEvent(com.google.gwt.user.client.Event event)
void
onClick(com.google.gwt.event.dom.client.ClickEvent event)
void
open()
Opens the stack item and clears any previous visibility settings.
void
replaceWidget(com.google.gwt.user.client.ui.Widget newWidget)
Replaces the existing wrapped widget (if any) with a new widget.
void
setContent(com.google.gwt.user.client.ui.Widget newWidget)
Updates the content of the open tab of the accordion.
void
setHeight(int height)
Sets the height for this stack item's contents.
void
setHeightFromWidget()
Queries the height from the wrapped widget and uses it to set this stack item's height.
void
setId(String newId)
Sets the identifier for this stack item.
void
setWidth(int width)
Sets the width of the stack item, or removes it if given value is
-1
.void
updateCaption(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-1
to 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-1
to 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:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent
in 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:
true
if open,false
otherwise
-
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 contentSince:
7.2
-
onClick
public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
Specified by:
onClick
in 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 setReturns:
true
if the container's widget matches wrapped widget,false
otherwise
-
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:
true
if visible,false
otherwise
-
-