com.vaadin.ui.
Class AbstractSplitPanel
java.lang.Object
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractComponentContainer
com.vaadin.ui.AbstractLayout
com.vaadin.ui.AbstractSplitPanel
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, ComponentContainer, Layout, Layout.MarginHandler, Serializable, EventListener
Direct Known Subclasses:
- extends AbstractLayout
public abstract class AbstractSplitPanel
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:
6.8.18
Author:
Vaadin Ltd.
See Also:
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.Layout |
---|
Layout.AlignmentHandler, Layout.MarginHandler, Layout.MarginInfo, Layout.SpacingHandler |
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.Paintable |
---|
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
---|
Fields inherited from class com.vaadin.ui.AbstractLayout |
---|
margins |
Fields inherited from interface com.vaadin.terminal.Sizeable |
---|
SIZE_UNDEFINED, UNIT_SYMBOLS, 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)
|
void |
changeVariables(Object source,
Map<String,Object> variables)
Called when one or more variables handled by the implementing class are changed. |
protected void |
fireClick(Map<String,Object> parameters)
Fire a layout click event. |
int |
getComponentCount()
Gets the number of contained components. |
Iterator<Component> |
getComponentIterator()
Gets an iterator to the collection of contained components. |
Component |
getFirstComponent()
|
float |
getMaxSplitPosition()
Returns the current maximum position of the splitter, in getMaxSplitPositionUnit() units. |
int |
getMaxSplitPositionUnit()
Returns the unit of the maximum position of the splitter |
float |
getMinSplitPosition()
Returns the current minimum position of the splitter, in getMinSplitPositionUnit() units. |
int |
getMinSplitPositionUnit()
Returns the unit of the minimum position of the splitter. |
Component |
getSecondComponent()
|
float |
getSplitPosition()
Returns the current position of the splitter, in getSplitPositionUnit() units. |
int |
getSplitPositionUnit()
Returns the unit of position of the splitter |
boolean |
isLocked()
Is the SplitPanel handle locked (user not allowed to change split position by dragging). |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
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)
|
void |
setLocked(boolean locked)
Lock the SplitPanels position, disabling the user from dragging the split handle. |
void |
setMaxSplitPosition(float pos,
int unit)
Sets the maximum split position to the given position and unit. |
void |
setMinSplitPosition(float pos,
int unit)
Sets the minimum split position to the given position and unit. |
void |
setSecondComponent(Component c)
|
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,
int unit)
Moves the position of the splitter with given position and unit. |
void |
setSplitPosition(float pos,
int unit,
boolean reverse)
Moves the position of the splitter with given position and unit. |
Methods inherited from class com.vaadin.ui.AbstractLayout |
---|
getMargin, setMargin, setMargin, setMargin |
Methods inherited from class com.vaadin.ui.AbstractComponentContainer |
---|
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth |
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 |
---|
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, attach, childRequestedRepaint, detach, getApplication, getCaption, getIcon, getLocale, getParent, getStyleName, getWindow, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setParent, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.terminal.Paintable |
---|
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId |
Methods inherited from interface com.vaadin.terminal.VariableOwner |
---|
isImmediate |
Methods inherited from interface com.vaadin.terminal.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits |
Constructor Detail |
---|
AbstractSplitPanel
public AbstractSplitPanel()
Method Detail |
---|
addComponent
public void addComponent(Component c)
- Specified by:
addComponent
in interfaceComponentContainer
- Overrides:
addComponent
in classAbstractComponentContainer
- Parameters:
c
- the component to be added.- See Also:
ComponentContainer.addComponent(Component)
Add a component into this container. The component is added to the right or under the previous component.
setFirstComponent
public void setFirstComponent(Component c)
setSecondComponent
public void setSecondComponent(Component c)
getFirstComponent
public Component getFirstComponent()
- Returns:
- the first component of this SplitPanel.
getSecondComponent
public Component getSecondComponent()
- Returns:
- the second component of this SplitPanel.
removeComponent
public void removeComponent(Component c)
- Specified by:
removeComponent
in interfaceComponentContainer
- Overrides:
removeComponent
in classAbstractComponentContainer
- Parameters:
c
- the component to be removed.- See Also:
ComponentContainer.removeComponent(Component)
Removes the component from this container.
getComponentIterator
public Iterator<Component> getComponentIterator()
- Returns:
- the component iterator.
Description copied from interface: ComponentContainer
Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.
getComponentCount
public int getComponentCount()
- Returns:
- the number of contained components (zero, one or two)
Gets the number of contained components. Consistent with the iterator
returned by getComponentIterator()
.
paintContent
public void paintContent(PaintTarget target)
throws PaintException
- Overrides:
paintContent
in classAbstractLayout
- Parameters:
target
- the Paint Event.- Throws:
PaintException
- if the paint operation failed.
Paints the content of this component.
replaceComponent
public void replaceComponent(Component oldComponent,
Component newComponent)
- Parameters:
oldComponent
- the old component that will be replaced.newComponent
- the new component to be replaced.
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.
setSplitPosition
public void setSplitPosition(float pos)
- 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.
Moves the position of the splitter.
setSplitPosition
public void setSplitPosition(float pos,
boolean reverse)
- 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
Moves the position of the splitter.
setSplitPosition
public void setSplitPosition(float pos,
int unit)
- Parameters:
pos
- the new size of the first region. Fractions are only allowed when unit is percentage.unit
- the unit (fromSizeable
) in which the size is given.
Moves the position of the splitter with given position and unit.
setSplitPosition
public void setSplitPosition(float pos,
int unit,
boolean reverse)
- Parameters:
pos
- the new size of the first region. Fractions are only allowed when unit is percentage.unit
- the unit (fromSizeable
) 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
Moves the position of the splitter with given position and unit.
getSplitPosition
public float getSplitPosition()
- Returns:
- position of the splitter
Returns the current position of the splitter, in
getSplitPositionUnit()
units.
getSplitPositionUnit
public int getSplitPositionUnit()
- Returns:
- unit of position of the splitter
Returns the unit of position of the splitter
setMinSplitPosition
public void setMinSplitPosition(float pos,
int unit)
- Parameters:
pos
- the minimum position of the splitunit
- the unit (fromSizeable
) in which the size is given. Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS
Sets the minimum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.
getMinSplitPosition
public float getMinSplitPosition()
- Returns:
- the minimum position of the splitter
Returns the current minimum position of the splitter, in
getMinSplitPositionUnit()
units.
getMinSplitPositionUnit
public int 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,
int unit)
- Parameters:
pos
- the maximum position of the splitunit
- the unit (fromSizeable
) in which the size is given. Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS
Sets the maximum split position to the given position and unit. If the split position is reversed, maximum and minimum are also reversed.
getMaxSplitPosition
public float getMaxSplitPosition()
- Returns:
- the maximum position of the splitter
Returns the current maximum position of the splitter, in
getMaxSplitPositionUnit()
units.
getMaxSplitPositionUnit
public int 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)
- Parameters:
locked
- Settrue
if locked,false
otherwise.
Lock the SplitPanels position, disabling the user from dragging the split handle.
isLocked
public boolean isLocked()
- Returns:
true
if locked,false
otherwise.
Is the SplitPanel handle locked (user not allowed to change split position by dragging).
changeVariables
public void changeVariables(Object source,
Map<String,Object> variables)
- Specified by:
changeVariables
in interfaceVariableOwner
- Overrides:
changeVariables
in classAbstractLayout
- Parameters:
source
- the Source of the variable change. This is the origin of the event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.
Description copied from interface: VariableOwner
Called when one or more variables handled by the implementing class are changed.
fireClick
protected void fireClick(Map<String,Object> parameters)
- Overrides:
fireClick
in classAbstractLayout
- Parameters:
parameters
- The parameters received from the client side implementation
Description copied from class: AbstractLayout
Fire a layout click event.
Note that this method is only used by the subclasses that implement
LayoutEvents.LayoutClickNotifier
, and can be overridden for custom click event
firing.
addListener
public void addListener(AbstractSplitPanel.SplitterClickListener listener)
removeListener
public void removeListener(AbstractSplitPanel.SplitterClickListener listener)