com.vaadin.ui
Class AbsoluteLayout

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractComponentContainer
              extended by com.vaadin.ui.AbstractLayout
                  extended by com.vaadin.ui.AbsoluteLayout
All Implemented Interfaces:
LayoutEvents.LayoutClickNotifier, MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, ComponentContainer, HasComponents, HasComponents.ComponentAttachDetachNotifier, Layout, java.io.Serializable, java.lang.Iterable<Component>

public class AbsoluteLayout
extends AbstractLayout
implements LayoutEvents.LayoutClickNotifier

AbsoluteLayout is a layout implementation that mimics html absolute positioning.

See Also:
Serialized Form

Nested Class Summary
 class AbsoluteLayout.ComponentPosition
          The CompontPosition class represents a components position within the absolute layout.
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Layout
Layout.AlignmentHandler, Layout.MarginHandler, Layout.SpacingHandler
 
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
AbsoluteLayout()
          Creates an AbsoluteLayout with full size.
 
Method Summary
 void addComponent(Component c)
          This only implements the events and component parent calls.
 void addComponent(Component c, java.lang.String cssPosition)
          Adds a component to the layout.
 void addLayoutClickListener(LayoutEvents.LayoutClickListener listener)
          Add a click listener to the layout.
 void addListener(LayoutEvents.LayoutClickListener listener)
          Deprecated. As of 7.0, replaced by #addLayoutClickListener(LayoutClickListener)
 void beforeClientResponse(boolean initial)
          Called before the shared state and RPC invocations are sent to the client.
 int getComponentCount()
          Gets the number of contained components.
 AbsoluteLayout.ComponentPosition getPosition(Component component)
          Gets the position of a component in the layout.
protected  com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutState getState()
          Returns the shared state bean with information to be sent from the server to the client.
 java.util.Iterator<Component> iterator()
          Gets an iterator for going through all components enclosed in the absolute layout.
 void removeComponent(Component c)
          This only implements the events and component parent calls.
 void removeLayoutClickListener(LayoutEvents.LayoutClickListener listener)
          Removes an LayoutClickListener.
 void removeListener(LayoutEvents.LayoutClickListener listener)
          Deprecated. As of 7.0, replaced by #removeLayoutClickListener(LayoutClickListener)
 void replaceComponent(Component oldComponent, Component newComponent)
          Replaces one component with another one.
 void setPosition(Component component, AbsoluteLayout.ComponentPosition position)
          Sets the position of a component in the layout.
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addComponentAttachListener, addComponentDetachListener, addComponents, addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, getComponentIterator, moveComponentsFrom, removeAllComponents, removeComponentAttachListener, removeComponentDetachListener, removeListener, removeListener, setHeight, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getStyleName, getWidth, getWidthUnits, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeShortcutListener, removeStyleName, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hasListeners, isAttached, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.ComponentContainer
addComponents, addListener, addListener, getComponentIterator, moveComponentsFrom, removeAllComponents, removeListener, removeListener
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 
Methods inherited from interface com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier
addComponentAttachListener, addComponentDetachListener, removeComponentAttachListener, removeComponentDetachListener
 

Constructor Detail

AbsoluteLayout

public AbsoluteLayout()
Creates an AbsoluteLayout with full size.

Method Detail

getState

protected com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutState getState()
Description copied from class: AbstractComponent
Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().

Overrides:
getState in class AbstractLayout
Returns:
updated component shared state

iterator

public java.util.Iterator<Component> iterator()
Gets an iterator for going through all components enclosed in the absolute layout.

Specified by:
iterator in interface HasComponents
Specified by:
iterator in interface java.lang.Iterable<Component>
Returns:
the component iterator.

getComponentCount

public int getComponentCount()
Gets the number of contained components. Consistent with the iterator returned by AbstractComponentContainer.getComponentIterator().

Specified by:
getComponentCount in interface ComponentContainer
Returns:
the number of contained components

replaceComponent

public void replaceComponent(Component oldComponent,
                             Component newComponent)
Replaces one component with another one. The new component inherits the old components position.

Specified by:
replaceComponent in interface ComponentContainer
Parameters:
oldComponent - the old component that will be replaced.
newComponent - the new component to be replaced.

addComponent

public void addComponent(Component c)
Description copied from class: AbstractComponentContainer
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method after component list maintenance.

Specified by:
addComponent in interface ComponentContainer
Overrides:
addComponent in class AbstractComponentContainer
Parameters:
c - the component to be added.
See Also:
ComponentContainer.addComponent(Component)

addComponent

public void addComponent(Component c,
                         java.lang.String cssPosition)
Adds a component to the layout. The component can be positioned by providing a string formatted in CSS-format.

For example the string "top:10px;left:10px" will position the component 10 pixels from the left and 10 pixels from the top. The identifiers: "top","left","right" and "bottom" can be used to specify the position.

Parameters:
c - The component to add to the layout
cssPosition - The css position string

beforeClientResponse

public void beforeClientResponse(boolean initial)
Description copied from interface: ClientConnector
Called before the shared state and RPC invocations are sent to the client. Gives the connector an opportunity to set computed/dynamic state values or to invoke last minute RPC methods depending on other component features.

This method must not alter the component hierarchy in any way. Calling ClientConnector.markAsDirty() from this method will have no effect.

Specified by:
beforeClientResponse in interface ClientConnector
Overrides:
beforeClientResponse in class AbstractComponent
Parameters:
initial - true if the client-side connector will be created and initialized after this method has been invoked. false if there is already an initialized client-side connector.

removeComponent

public void removeComponent(Component c)
Description copied from class: AbstractComponentContainer
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method before component list maintenance.

Specified by:
removeComponent in interface ComponentContainer
Overrides:
removeComponent in class AbstractComponentContainer
Parameters:
c - the component to be removed.
See Also:
ComponentContainer.removeComponent(Component)

getPosition

public AbsoluteLayout.ComponentPosition getPosition(Component component)
Gets the position of a component in the layout. Returns null if component is not attached to the layout.

Note that you cannot update the position by updating this object. Call setPosition(Component, ComponentPosition) with the updated AbsoluteLayout.ComponentPosition object.

Parameters:
component - The component which position is needed
Returns:
An instance of ComponentPosition containing the position of the component, or null if the component is not enclosed in the layout.

setPosition

public void setPosition(Component component,
                        AbsoluteLayout.ComponentPosition position)
Sets the position of a component in the layout.

Parameters:
component -
position -

addLayoutClickListener

public void addLayoutClickListener(LayoutEvents.LayoutClickListener listener)
Description copied from interface: LayoutEvents.LayoutClickNotifier
Add a click listener to the layout. The listener is called whenever the user clicks inside the layout. An event is also triggered when the click targets a component inside a nested layout or Panel, provided the targeted component does not prevent the click event from propagating. A caption is not considered part of a component. The child component that was clicked is included in the LayoutEvents.LayoutClickEvent. Use #removeListener(LayoutClickListener) to remove the listener.

Specified by:
addLayoutClickListener in interface LayoutEvents.LayoutClickNotifier
Parameters:
listener - The listener to add

addListener

@Deprecated
public void addListener(LayoutEvents.LayoutClickListener listener)
Deprecated. As of 7.0, replaced by #addLayoutClickListener(LayoutClickListener)

Specified by:
addListener in interface LayoutEvents.LayoutClickNotifier

removeLayoutClickListener

public void removeLayoutClickListener(LayoutEvents.LayoutClickListener listener)
Description copied from interface: LayoutEvents.LayoutClickNotifier
Removes an LayoutClickListener.

Specified by:
removeLayoutClickListener in interface LayoutEvents.LayoutClickNotifier
Parameters:
listener - LayoutClickListener to be removed

removeListener

@Deprecated
public void removeListener(LayoutEvents.LayoutClickListener listener)
Deprecated. As of 7.0, replaced by #removeLayoutClickListener(LayoutClickListener)

Specified by:
removeListener in interface LayoutEvents.LayoutClickNotifier


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