com.vaadin.client.ui
Class VAbsoluteLayout

java.lang.Object
  extended by ComplexPanel
      extended by com.vaadin.client.ui.VAbsoluteLayout

public class VAbsoluteLayout
extends ComplexPanel


Nested Class Summary
protected  class VAbsoluteLayout.AbsoluteWrapper
          Internal wrapper for wrapping widgets in the Absolute layout
 
Field Summary
protected  Element canvas
           
static java.lang.String CLASSNAME
          Class name, prefix in styling
static java.lang.String TAGNAME
          Tag name for widget creation
 
Constructor Summary
VAbsoluteLayout()
          Default constructor
 
Method Summary
 void add(Widget child)
           
 void cleanupWrappers()
          Cleanup old wrappers which have been left empty by other inner layouts moving the widget from the wrapper into their own hierarchy.
 boolean contains(Widget widget)
          Does this layout contain a widget
protected  VAbsoluteLayout.AbsoluteWrapper getChildWrapper(Widget child)
          Get the wrapper for a widget
 Widget getWidget(int index)
           
 VCaption getWidgetCaption(Widget child)
          Get the caption for a widget
 int getWidgetCount()
           
 int getWidgetIndex(Widget child)
           
 int getWidgetSlotHeight(Widget child)
          Get the pixel height of an slot in the layout
 int getWidgetSlotWidth(Widget child)
          Get the pixel width of an slot in the layout
 void layoutHorizontally()
          Performs an horizontal layout.
 void layoutVertically()
          Performs a vertical layout of the layout.
 boolean remove(Widget w)
           
 void setStyleName(java.lang.String style)
           
 void setStylePrimaryName(java.lang.String style)
           
 void setWidgetCaption(Widget child, VCaption caption)
          Sets a caption for a contained widget
 void setWidgetPosition(Widget child, java.lang.String position)
          Set the position of the widget in the layout.
 void setWidgetWrapperStyleNames(Widget widget, java.lang.String... stylenames)
          Sets style names for the wrapper wrapping the widget in the layout.
protected  void updateStylenames(java.lang.String primaryStyleName)
          Updates all style names contained in the layout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAGNAME

public static final java.lang.String TAGNAME
Tag name for widget creation

See Also:
Constant Field Values

CLASSNAME

public static final java.lang.String CLASSNAME
Class name, prefix in styling

See Also:
Constant Field Values

canvas

protected final Element canvas
Constructor Detail

VAbsoluteLayout

public VAbsoluteLayout()
Default constructor

Method Detail

add

public void add(Widget child)

remove

public boolean remove(Widget w)

contains

public boolean contains(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 Widget getWidget(int index)

getWidgetCount

public int getWidgetCount()

getWidgetIndex

public int getWidgetIndex(Widget child)

setWidgetCaption

public void setWidgetCaption(Widget child,
                             VCaption caption)
Sets a caption for a contained widget

Parameters:
child - The child widget to set the caption for
caption - The caption of the widget

setWidgetPosition

public void setWidgetPosition(Widget child,
                              java.lang.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 for
position - The position string

getWidgetCaption

public VCaption getWidgetCaption(Widget child)
Get the caption for a widget

Parameters:
child - The child widget to get the caption of

getWidgetSlotWidth

public int getWidgetSlotWidth(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(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(Widget child)
Get the wrapper for a widget

Parameters:
child - The child to get the wrapper for
Returns:

setStylePrimaryName

public void setStylePrimaryName(java.lang.String style)

setStyleName

public void setStyleName(java.lang.String style)

updateStylenames

protected void updateStylenames(java.lang.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(Widget widget,
                                       java.lang.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 to
stylenames - The style names that should be added to the wrapper


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.