com.itmill.toolkit.ui
Class SplitPanel

java.lang.Object
  extended by com.itmill.toolkit.ui.AbstractComponent
      extended by com.itmill.toolkit.ui.AbstractComponentContainer
          extended by com.itmill.toolkit.ui.AbstractLayout
              extended by com.itmill.toolkit.ui.SplitPanel
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, ComponentContainer, Layout, Layout.MarginHandler, EventListener

public class SplitPanel
extends AbstractLayout

SplitPanel. SplitPanel is a component container, that can contain two components (possibly containers) which are split by divider element.

Since:
5.0
Version:
5.3.0
Author:
IT Mill Ltd.

Nested Class Summary
 
Nested classes/interfaces inherited from class com.itmill.toolkit.ui.AbstractComponent
AbstractComponent.ComponentErrorEvent, AbstractComponent.ComponentErrorHandler
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Layout
Layout.AlignmentHandler, Layout.MarginHandler, Layout.MarginInfo, Layout.SpacingHandler
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.ComponentContainer
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Field Summary
static int ORIENTATION_HORIZONTAL
          Components are to be layed out horizontally.
static int ORIENTATION_VERTICAL
          Components are to be layed out vertically.
 
Fields inherited from class com.itmill.toolkit.ui.AbstractLayout
margins
 
Fields inherited from interface com.itmill.toolkit.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
SplitPanel()
          Creates a new split panel.
SplitPanel(int orientation)
          Create a new split panels.
 
Method Summary
 void addComponent(Component c)
          Add a component into this container.
 void changeVariables(Object source, Map variables)
          Called when one or more variables handled by the implementing class are changed.
 Iterator getComponentIterator()
          Gets the component container iterator for going trough all the components in the container.
 int getOrientation()
          Gets the orientation of the container.
 String getTag()
          Gets the component UIDL tag.
 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 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 setOrientation(int orientation)
          Set the orientation of the container.
 void setSecondComponent(Component c)
           
 void setSplitPosition(int pos)
          Moves the position of the splitter.
 void setSplitPosition(int pos, int unit)
          Moves the position of the splitter with given position and unit.
 
Methods inherited from class com.itmill.toolkit.ui.AbstractLayout
getMargin, setMargin, setMargin, setMargin
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponentContainer
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled, setHeight, setWidth
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponent
addListener, addListener, addListener, addListener, addStyleName, childRequestedRepaint, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDebugId, getDescription, getErrorHandler, getErrorMessage, getHeight, getHeightUnits, getIcon, getLocale, getParent, getStyle, getStyleName, getWidth, getWidthUnits, getWindow, handleError, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeListener, removeListener, removeListener, removeListener, removeListener, removeStyleName, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDebugId, setDescription, setErrorHandler, setHeight, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setWidth, setWidth, setWidthUnits, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.itmill.toolkit.ui.ComponentContainer
addListener, addListener, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll
 
Methods inherited from interface com.itmill.toolkit.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.itmill.toolkit.terminal.Paintable
addListener, getDebugId, paint, removeListener, requestRepaint, requestRepaintRequests, setDebugId
 
Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner
isImmediate
 
Methods inherited from interface com.itmill.toolkit.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidth, setWidthUnits
 

Field Detail

ORIENTATION_VERTICAL

public static final int ORIENTATION_VERTICAL
Components are to be layed out vertically.

See Also:
Constant Field Values

ORIENTATION_HORIZONTAL

public static final int ORIENTATION_HORIZONTAL
Components are to be layed out horizontally.

See Also:
Constant Field Values
Constructor Detail

SplitPanel

public SplitPanel()
Creates a new split panel. The orientation of the panels is ORIENTATION_VERTICAL.


SplitPanel

public SplitPanel(int orientation)
Create a new split panels. The orientation of the panel is given as parameters.

Parameters:
orientation - the Orientation of the layout.
Method Detail

getTag

public String getTag()
Gets the component UIDL tag.

Specified by:
getTag in class AbstractLayout
Returns:
the Component UIDL tag as string.

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)

setSecondComponent

public void setSecondComponent(Component c)

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 getComponentIterator()
Gets the component container iterator for going trough all the components in the container.

Returns:
the Iterator of the components inside the container.

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Paints the content of this component.

Overrides:
paintContent in class AbstractLayout
Parameters:
target - the Paint Event.
Throws:
PaintException - if the paint operation failed.

getOrientation

public int getOrientation()
Gets the orientation of the container.

Returns:
the Value of property orientation.

setOrientation

public void setOrientation(int orientation)
Set the orientation of the container.

Parameters:
orientation - the New value of property orientation.

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(int pos)
Moves the position of the splitter.

Parameters:
pos - the new size of the first region in persentage

setSplitPosition

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

Parameters:
pos - size of the first region
unit - the unit (from RenderInformation.Size) in which the size is given.

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.

changeVariables

public void changeVariables(Object source,
                            Map variables)
Description copied from interface: VariableOwner
Called when one or more variables handled by the implementing class are changed.

Specified by:
changeVariables in interface VariableOwner
Overrides:
changeVariables in class AbstractComponent
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.


Copyright © 2000-2009 IT Mill Ltd. All Rights Reserved.