com.vaadin.ui
Class AbstractSplitPanel

java.lang.Object
  extended by com.vaadin.terminal.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractComponentContainer
              extended by com.vaadin.ui.AbstractSplitPanel
All Implemented Interfaces:
MethodEventSource, Connector, ClientConnector, RpcTarget, Sizeable, Component, ComponentContainer, HasComponents, Serializable, Iterable<Component>
Direct Known Subclasses:
HorizontalSplitPanel, VerticalSplitPanel

public abstract class AbstractSplitPanel
extends AbstractComponentContainer

AbstractSplitPanel. AbstractSplitPanel is base class for a component container that can contain two components. The components are split by a divider element.

Since:
6.5
Version:
7.0.0.alpha3
Author:
Vaadin Ltd.
See Also:
Serialized Form

Nested Class Summary
 class AbstractSplitPanel.SplitterClickEvent
           
static interface AbstractSplitPanel.SplitterClickListener
          SplitterClickListener interface for listening for SplitterClickEvent fired by a SplitPanel.
 
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractComponent
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.vaadin.ui.ComponentContainer
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Sizeable
Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Constructor Summary
AbstractSplitPanel()
           
 
Method Summary
 void addComponent(Component c)
          Add a component into this container.
 void addListener(AbstractSplitPanel.SplitterClickListener listener)
           
 int getComponentCount()
          Gets the number of contained components.
 Iterator<Component> getComponentIterator()
          Gets an iterator to the collection of contained components.
 Component getFirstComponent()
          Gets the first component of this split panel.
 float getMaxSplitPosition()
          Returns the current maximum position of the splitter, in getMaxSplitPositionUnit() units.
 Sizeable.Unit getMaxSplitPositionUnit()
          Returns the unit of the maximum position of the splitter
 float getMinSplitPosition()
          Returns the current minimum position of the splitter, in getMinSplitPositionUnit() units.
 Sizeable.Unit getMinSplitPositionUnit()
          Returns the unit of the minimum position of the splitter.
 Component getSecondComponent()
          Gets the second component of this split panel.
 float getSplitPosition()
          Returns the current position of the splitter, in getSplitPositionUnit() units.
 Sizeable.Unit getSplitPositionUnit()
          Returns the unit of position of the splitter
 AbstractSplitPanelState getState()
          Returns the shared state bean with information to be sent from the server to the client.
 boolean isLocked()
          Is the SplitPanel handle locked (user not allowed to change split position by dragging).
 void removeComponent(Component c)
          Removes the component from this container.
 void removeListener(AbstractSplitPanel.SplitterClickListener listener)
           
 void replaceComponent(Component oldComponent, Component newComponent)
          Replaces the component in the container with another one without changing position.
 void setFirstComponent(Component c)
          Sets the first component of this split panel.
 void setLocked(boolean locked)
          Lock the SplitPanels position, disabling the user from dragging the split handle.
 void setMaxSplitPosition(float pos, Sizeable.Unit unit)
          Sets the maximum split position to the given position and unit.
 void setMinSplitPosition(int pos, Sizeable.Unit unit)
          Sets the minimum split position to the given position and unit.
 void setSecondComponent(Component c)
          Sets the second component of this split panel.
 void setSplitPosition(float pos)
          Moves the position of the splitter.
 void setSplitPosition(float pos, boolean reverse)
          Moves the position of the splitter.
 void setSplitPosition(float pos, Sizeable.Unit unit)
          Moves the position of the splitter with given position and unit.
 void setSplitPosition(float pos, Sizeable.Unit unit, boolean reverse)
          Moves the position of the splitter with given position and unit.
 
Methods inherited from class com.vaadin.ui.AbstractComponentContainer
addListener, addListener, fireComponentAttachEvent, fireComponentDetachEvent, isComponentVisible, iterator, moveComponentsFrom, removeAllComponents, removeListener, removeListener, setHeight, setVisible, setWidth
 
Methods inherited from class com.vaadin.ui.AbstractComponent
addListener, addListener, addListener, addListener, addShortcutListener, addStyleName, attach, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, fireEvent, focus, getActionManager, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getListeners, getLocale, getParent, getRoot, getStyle, getStyleName, getWidth, getWidthUnits, handleError, hasListeners, isConnectorEnabled, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, removeListener, removeListener, removeListener, removeListener, removeShortcutListener, removeStyleName, requestRepaint, setCaption, setComponentError, setData, setDebugId, setDescription, setEnabled, setErrorHandler, setHeight, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setWidth, updateState
 
Methods inherited from class com.vaadin.terminal.AbstractClientConnector
addExtension, addMethodInvocationToQueue, createState, getAllChildrenIterable, getConnectorId, getExtensions, getRpcManager, getRpcProxy, getStateType, registerRpc, registerRpc, removeExtension, requestRepaintAll, retrievePendingRpcCalls
 
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.Component
addListener, addStyleName, attach, getApplication, getCaption, getDebugId, getIcon, getLocale, getParent, getRoot, getStyleName, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setDebugId, setEnabled, setIcon, setReadOnly, setStyleName, updateState
 
Methods inherited from interface com.vaadin.terminal.gwt.server.ClientConnector
detach, getExtensions, getStateType, isConnectorEnabled, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setParent
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget
getRpcManager
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setSizeFull, setSizeUndefined, setWidth
 

Constructor Detail

AbstractSplitPanel

public AbstractSplitPanel()
Method Detail

addComponent

public void addComponent(Component c)
Add a component into this container. The component is added to the right or under the previous component.

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

setFirstComponent

public void setFirstComponent(Component c)
Sets the first component of this split panel. Depending on the direction the first component is shown at the top or to the left.

Parameters:
c - The component to use as first component

setSecondComponent

public void setSecondComponent(Component c)
Sets the second component of this split panel. Depending on the direction the second component is shown at the bottom or to the left.

Parameters:
c - The component to use as first component

getFirstComponent

public Component getFirstComponent()
Gets the first component of this split panel. Depending on the direction this is either the component shown at the top or to the left.

Returns:
the first component of this split panel

getSecondComponent

public Component getSecondComponent()
Gets the second component of this split panel. Depending on the direction this is either the component shown at the top or to the left.

Returns:
the second component of this split panel

removeComponent

public void removeComponent(Component c)
Removes the component from this container.

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

getComponentIterator

public Iterator<Component> getComponentIterator()
Description copied from interface: HasComponents
Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.

Returns:
the component iterator.

getComponentCount

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

Returns:
the number of contained components (zero, one or two)

replaceComponent

public void replaceComponent(Component oldComponent,
                             Component newComponent)
Description copied from interface: ComponentContainer
Replaces the component in the container with another one without changing position.

This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.

Parameters:
oldComponent - the old component that will be replaced.
newComponent - the new component to be replaced.

setSplitPosition

public void setSplitPosition(float pos)
Moves the position of the splitter.

Parameters:
pos - the new size of the first region in the unit that was last used (default is percentage). Fractions are only allowed when unit is percentage.

setSplitPosition

public void setSplitPosition(float pos,
                             boolean reverse)
Moves the position of the splitter.

Parameters:
pos - the new size of the region in the unit that was last used (default is percentage). Fractions are only allowed when unit is percentage.
reverse - if set to true the split splitter position is measured by the second region else it is measured by the first region

setSplitPosition

public void setSplitPosition(float pos,
                             Sizeable.Unit unit)
Moves the position of the splitter with given position and unit.

Parameters:
pos - the new size of the first region. Fractions are only allowed when unit is percentage.
unit - the unit (from Sizeable) in which the size is given.

setSplitPosition

public void setSplitPosition(float pos,
                             Sizeable.Unit unit,
                             boolean reverse)
Moves the position of the splitter with given position and unit.

Parameters:
pos - the new size of the first region. Fractions are only allowed when unit is percentage.
unit - the unit (from Sizeable) in which the size is given.
reverse - if set to true the split splitter position is measured by the second region else it is measured by the first region

getSplitPosition

public float getSplitPosition()
Returns the current position of the splitter, in getSplitPositionUnit() units.

Returns:
position of the splitter

getSplitPositionUnit

public Sizeable.Unit getSplitPositionUnit()
Returns the unit of position of the splitter

Returns:
unit of position of the splitter

setMinSplitPosition

public void setMinSplitPosition(int pos,
                                Sizeable.Unit unit)
Sets the minimum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.

Parameters:
pos - the minimum position of the split
unit - the unit (from Sizeable) in which the size is given. Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS

getMinSplitPosition

public float getMinSplitPosition()
Returns the current minimum position of the splitter, in getMinSplitPositionUnit() units.

Returns:
the minimum position of the splitter

getMinSplitPositionUnit

public Sizeable.Unit getMinSplitPositionUnit()
Returns the unit of the minimum position of the splitter.

Returns:
the unit of the minimum position of the splitter

setMaxSplitPosition

public void setMaxSplitPosition(float pos,
                                Sizeable.Unit unit)
Sets the maximum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.

Parameters:
pos - the maximum position of the split
unit - the unit (from Sizeable) in which the size is given. Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS

getMaxSplitPosition

public float getMaxSplitPosition()
Returns the current maximum position of the splitter, in getMaxSplitPositionUnit() units.

Returns:
the maximum position of the splitter

getMaxSplitPositionUnit

public Sizeable.Unit getMaxSplitPositionUnit()
Returns the unit of the maximum position of the splitter

Returns:
the unit of the maximum position of the splitter

setLocked

public void setLocked(boolean locked)
Lock the SplitPanels position, disabling the user from dragging the split handle.

Parameters:
locked - Set true if locked, false otherwise.

isLocked

public boolean isLocked()
Is the SplitPanel handle locked (user not allowed to change split position by dragging).

Returns:
true if locked, false otherwise.

addListener

public void addListener(AbstractSplitPanel.SplitterClickListener listener)

removeListener

public void removeListener(AbstractSplitPanel.SplitterClickListener listener)

getState

public AbstractSplitPanelState 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().

Specified by:
getState in interface Connector
Specified by:
getState in interface Component
Overrides:
getState in class AbstractComponent
Returns:
updated component shared state


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