Package com.vaadin.client.ui
Class VAbsoluteLayout
- 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.VAbsoluteLayout
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers,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>
public class VAbsoluteLayout extends com.google.gwt.user.client.ui.ComplexPanel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classVAbsoluteLayout.AbsoluteWrapperInternal wrapper for wrapping widgets in the Absolute layout.-
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 VAbsoluteLayout()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(com.google.gwt.user.client.ui.Widget child)voidcleanupWrappers()Cleanup old wrappers which have been left empty by other inner layouts moving the widget from the wrapper into their own hierarchy.booleancontains(com.google.gwt.user.client.ui.Widget widget)Does this layout contain a widget.protected VAbsoluteLayout.AbsoluteWrappergetChildWrapper(com.google.gwt.user.client.ui.Widget child)Get the wrapper for a widget.com.google.gwt.user.client.ui.WidgetgetWidget(int index)VCaptiongetWidgetCaption(com.google.gwt.user.client.ui.Widget child)Get the caption for a widget.intgetWidgetCount()intgetWidgetIndex(com.google.gwt.user.client.ui.Widget child)intgetWidgetSlotHeight(com.google.gwt.user.client.ui.Widget child)Get the pixel height of an slot in the layout.intgetWidgetSlotWidth(com.google.gwt.user.client.ui.Widget child)Get the pixel width of an slot in the layout.voidlayoutHorizontally()Performs an horizontal layout.voidlayoutVertically()Performs a vertical layout of the layout.booleanremove(com.google.gwt.user.client.ui.Widget w)voidsetStyleName(String style)voidsetStylePrimaryName(String style)voidsetWidgetCaption(com.google.gwt.user.client.ui.Widget child, VCaption caption)Sets a caption for a contained widget.voidsetWidgetPosition(com.google.gwt.user.client.ui.Widget child, String position)Set the position of the widget in the layout.voidsetWidgetWrapperStyleNames(com.google.gwt.user.client.ui.Widget widget, String... stylenames)Sets style names for the wrapper wrapping the widget in the layout.protected voidupdateStylenames(String primaryStyleName)Updates all style names contained in the layout.-
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidgetIndex, insert, insert, iterator, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
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, onBrowserEvent, 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, 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
-
-
-
-
Field Detail
-
TAGNAME
public static final String TAGNAME
Tag name for widget creation.- See Also:
- Constant Field Values
-
CLASSNAME
public static final String CLASSNAME
Class name, prefix in styling.- See Also:
- Constant Field Values
-
canvas
protected final com.google.gwt.dom.client.Element canvas
-
-
Method Detail
-
add
public void add(com.google.gwt.user.client.ui.Widget child)
- Specified by:
addin interfacecom.google.gwt.user.client.ui.HasWidgets- Overrides:
addin classcom.google.gwt.user.client.ui.Panel
-
remove
public boolean remove(com.google.gwt.user.client.ui.Widget w)
- Specified by:
removein interfacecom.google.gwt.user.client.ui.HasWidgets- Overrides:
removein classcom.google.gwt.user.client.ui.ComplexPanel
-
contains
public boolean contains(com.google.gwt.user.client.ui.Widget widget)
Does this layout contain a widget.- Parameters:
widget- The widget to check- Returns:
- Returns true if the widget is in this layout, false if not
-
getWidget
public com.google.gwt.user.client.ui.Widget getWidget(int index)
- Specified by:
getWidgetin interfacecom.google.gwt.user.client.ui.IndexedPanel- Overrides:
getWidgetin classcom.google.gwt.user.client.ui.ComplexPanel
-
getWidgetCount
public int getWidgetCount()
- Specified by:
getWidgetCountin interfacecom.google.gwt.user.client.ui.IndexedPanel- Overrides:
getWidgetCountin classcom.google.gwt.user.client.ui.ComplexPanel
-
getWidgetIndex
public int getWidgetIndex(com.google.gwt.user.client.ui.Widget child)
- Specified by:
getWidgetIndexin interfacecom.google.gwt.user.client.ui.IndexedPanel- Overrides:
getWidgetIndexin classcom.google.gwt.user.client.ui.ComplexPanel
-
setWidgetCaption
public void setWidgetCaption(com.google.gwt.user.client.ui.Widget child, VCaption caption)Sets a caption for a contained widget.- Parameters:
child- The child widget to set the caption forcaption- The caption of the widget
-
setWidgetPosition
public void setWidgetPosition(com.google.gwt.user.client.ui.Widget child, String position)Set the position of the widget in the layout. The position is a CSS property string using properties such as top,left,right,top- Parameters:
child- The child widget to set the position forposition- The position string
-
getWidgetCaption
public VCaption getWidgetCaption(com.google.gwt.user.client.ui.Widget child)
Get the caption for a widget.- Parameters:
child- The child widget to get the caption of
-
getWidgetSlotWidth
public int getWidgetSlotWidth(com.google.gwt.user.client.ui.Widget child)
Get the pixel width of an slot in the layout.- Parameters:
child- The widget in the layout.- Returns:
- Returns the size in pixels, or 0 if child is not in the layout
-
getWidgetSlotHeight
public int getWidgetSlotHeight(com.google.gwt.user.client.ui.Widget child)
Get the pixel height of an slot in the layout.- Parameters:
child- The widget in the layout- Returns:
- Returns the size in pixels, or 0 if the child is not in the layout
-
getChildWrapper
protected VAbsoluteLayout.AbsoluteWrapper getChildWrapper(com.google.gwt.user.client.ui.Widget child)
Get the wrapper for a widget.- Parameters:
child- The child to get the wrapper for- Returns:
-
setStylePrimaryName
public void setStylePrimaryName(String style)
- Overrides:
setStylePrimaryNamein classcom.google.gwt.user.client.ui.UIObject
-
setStyleName
public void setStyleName(String style)
- Overrides:
setStyleNamein classcom.google.gwt.user.client.ui.UIObject
-
updateStylenames
protected void updateStylenames(String primaryStyleName)
Updates all style names contained in the layout.- Parameters:
primaryStyleName- The style name to use as primary
-
layoutVertically
public void layoutVertically()
Performs a vertical layout of the layout. Should be called when a widget is added or removed
-
layoutHorizontally
public void layoutHorizontally()
Performs an horizontal layout. Should be called when a widget is add or removed
-
cleanupWrappers
public void cleanupWrappers()
Cleanup old wrappers which have been left empty by other inner layouts moving the widget from the wrapper into their own hierarchy. This usually happens when a call to setWidget(widget) is done in an inner layout which automatically detaches the widget from the parent, in this case the wrapper, and re-attaches it somewhere else. This has to be done in the layout phase since the order of the hierarchy events are not defined.
-
setWidgetWrapperStyleNames
public void setWidgetWrapperStyleNames(com.google.gwt.user.client.ui.Widget widget, String... stylenames)Sets style names for the wrapper wrapping the widget in the layout. The style names will be prefixed with v-absolutelayout-wrapper.- Parameters:
widget- The widget which wrapper we want to add the stylenames tostylenames- The style names that should be added to the wrapper
-
-