com.vaadin.client.ui.orderedlayout
Class VAbstractOrderedLayout

java.lang.Object
  extended by FlowPanel
      extended by com.vaadin.client.ui.orderedlayout.VAbstractOrderedLayout
Direct Known Subclasses:
VHorizontalLayout, VVerticalLayout

public class VAbstractOrderedLayout
extends FlowPanel

Base class for ordered layouts


Field Summary
protected  boolean definedHeight
           
protected  boolean spacing
           
 boolean vertical
          For internal use only.
 
Constructor Summary
VAbstractOrderedLayout(boolean vertical)
           
 
Method Summary
 void addOrMoveSlot(Slot slot, int index)
          Deprecated. since 7.1.4, use addOrMoveSlot(Slot, int, boolean)
 void addOrMoveSlot(Slot slot, int index, boolean adjustSpacing)
          Add or move a slot to another index.
 void clearExpand()
          Removes elements used to expand a slot.
 CaptionPosition getCaptionPositionFromElement(com.google.gwt.user.client.Element captionWrap)
          Deprecated. As of 7.2, call or override getCaptionPositionFromElement(Element) instead
 CaptionPosition getCaptionPositionFromElement(Element captionWrap)
          Deducts the caption position by examining the wrapping element.
 LayoutManager getLayoutManager()
          Get the layout manager used by this layout
 Slot getSlot(com.google.gwt.user.client.Element widgetElement)
          Deprecated. As of 7.2, call or override getSlot(Element) instead
 Slot getSlot(Element widgetElement)
          Gets a slot based on the widget element.
 Slot getSlot(Widget widget)
          Get the containing slot for a widget.
protected  void insert(Widget child, com.google.gwt.user.client.Element container, int beforeIndex, boolean domInsert)
          Deprecated. As of 7.2, use or override insert(Widget, Element, int, boolean) instead.
protected  void insert(Widget child, Element container, int beforeIndex, boolean domInsert)
          
 void removeWidget(Widget widget)
          Remove a slot from the layout
 void setHeight(java.lang.String height)
          
 void setLayoutManager(LayoutManager manager)
          Set the layout manager for the layout
 void setMargin(com.vaadin.shared.ui.MarginInfo marginInfo)
          Set the margin of the layout
 void setSlotStyleNames(Widget widget, java.lang.String... stylenames)
          Sets the slots style names.
 void setSpacing(boolean spacing)
          Turn on or off spacing in the layout
 void updateCaptionOffset(com.google.gwt.user.client.Element caption)
          Deprecated. As of 7.2, call or override updateCaptionOffset(Element) instead
 void updateCaptionOffset(Element caption)
          Update the offset off the caption relative to the slot
 void updateExpandCompensation()
          Updates the expand compensation based on the measured sizes of children without expand.
 void updateExpandedSizes()
          Assigns relative sizes to the children that should expand based on their expand ratios.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spacing

protected boolean spacing

vertical

public boolean vertical
For internal use only. May be removed or replaced in the future.


definedHeight

protected boolean definedHeight
Constructor Detail

VAbstractOrderedLayout

public VAbstractOrderedLayout(boolean vertical)
Method Detail

addOrMoveSlot

@Deprecated
public void addOrMoveSlot(Slot slot,
                                     int index)
Deprecated. since 7.1.4, use addOrMoveSlot(Slot, int, boolean)

See the method addOrMoveSlot(Slot, int, boolean).

This method always adjusts spacings for the whole layout.

Parameters:
slot - The slot to move or add
index - The index where the slot should be placed.

addOrMoveSlot

public void addOrMoveSlot(Slot slot,
                          int index,
                          boolean adjustSpacing)
Add or move a slot to another index.

For internal use only. May be removed or replaced in the future.

You should note that the index does not refer to the DOM index if spacings are used. If spacings are used then the index will be adjusted to include the spacings when inserted.

For instance when using spacing the index converts to DOM index in the following way:

 index : 0 -> DOM index: 0
 index : 1 -> DOM index: 1
 index : 2 -> DOM index: 3
 index : 3 -> DOM index: 5
 index : 4 -> DOM index: 7
 
When using this method never account for spacings.

The caller should remove all spacings before calling this method and re-add them (if necessary) after this method. This can be done before and after all slots have been added/moved.

Parameters:
slot - The slot to move or add
index - The index where the slot should be placed.
adjustSpacing - true to recalculate spacings for the whole layout after the operation
Since:
7.1.4

insert

@Deprecated
protected void insert(Widget child,
                                 com.google.gwt.user.client.Element container,
                                 int beforeIndex,
                                 boolean domInsert)
Deprecated. As of 7.2, use or override insert(Widget, Element, int, boolean) instead.


insert

protected void insert(Widget child,
                      Element container,
                      int beforeIndex,
                      boolean domInsert)

Since:
7.2

removeWidget

public void removeWidget(Widget widget)
Remove a slot from the layout

Parameters:
widget -

getSlot

public Slot getSlot(Widget widget)
Get the containing slot for a widget. If no slot is found a new slot is created and returned.

Parameters:
widget - The widget whose slot you want to get
Returns:

getSlot

@Deprecated
public Slot getSlot(com.google.gwt.user.client.Element widgetElement)
Deprecated. As of 7.2, call or override getSlot(Element) instead

Gets a slot based on the widget element. If no slot is found then null is returned.

Parameters:
widgetElement - The element of the widget ( Same as getWidget().getElement() )
Returns:

getSlot

public Slot getSlot(Element widgetElement)
Gets a slot based on the widget element. If no slot is found then null is returned.

Parameters:
widgetElement - The element of the widget ( Same as getWidget().getElement() )
Returns:
Since:
7.2

setLayoutManager

public void setLayoutManager(LayoutManager manager)
Set the layout manager for the layout

Parameters:
manager - The layout manager to use

getLayoutManager

public LayoutManager getLayoutManager()
Get the layout manager used by this layout


getCaptionPositionFromElement

@Deprecated
public CaptionPosition getCaptionPositionFromElement(com.google.gwt.user.client.Element captionWrap)
Deprecated. As of 7.2, call or override getCaptionPositionFromElement(Element) instead

Deducts the caption position by examining the wrapping element.

For internal use only. May be removed or replaced in the future.

Parameters:
captionWrap - The wrapping element
Returns:
The caption position

getCaptionPositionFromElement

public CaptionPosition getCaptionPositionFromElement(Element captionWrap)
Deducts the caption position by examining the wrapping element.

For internal use only. May be removed or replaced in the future.

Parameters:
captionWrap - The wrapping element
Returns:
The caption position
Since:
7.2

updateCaptionOffset

@Deprecated
public void updateCaptionOffset(com.google.gwt.user.client.Element caption)
Deprecated. As of 7.2, call or override updateCaptionOffset(Element) instead

Update the offset off the caption relative to the slot

For internal use only. May be removed or replaced in the future.

Parameters:
caption - The caption element

updateCaptionOffset

public void updateCaptionOffset(Element caption)
Update the offset off the caption relative to the slot

For internal use only. May be removed or replaced in the future.

Parameters:
caption - The caption element
Since:
7.2

setMargin

public void setMargin(com.vaadin.shared.ui.MarginInfo marginInfo)
Set the margin of the layout

Parameters:
marginInfo - The margin information

setSpacing

public void setSpacing(boolean spacing)
Turn on or off spacing in the layout

Parameters:
spacing - True if spacing should be used, false if not

updateExpandedSizes

public void updateExpandedSizes()
Assigns relative sizes to the children that should expand based on their expand ratios.


clearExpand

public void clearExpand()
Removes elements used to expand a slot.

For internal use only. May be removed or replaced in the future.


updateExpandCompensation

public void updateExpandCompensation()
Updates the expand compensation based on the measured sizes of children without expand.


setHeight

public void setHeight(java.lang.String height)


setSlotStyleNames

public void setSlotStyleNames(Widget widget,
                              java.lang.String... stylenames)
Sets the slots style names. The style names will be prefixed with the v-slot prefix.

Parameters:
stylenames - The style names of the slot.


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