com.itmill.toolkit.ui
Class ExpandLayout

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.OrderedLayout
                  extended by com.itmill.toolkit.ui.ExpandLayout
All Implemented Interfaces:
MethodEventSource, Paintable, Sizeable, VariableOwner, Component, ComponentContainer, Layout, Layout.AlignmentHandler, Layout.SpacingHandler, EventListener

public class ExpandLayout
extends OrderedLayout

A layout that will give one of it's components as much space as possible, while still showing the other components in the layout. The other components will in effect be given a fixed sized space, while the space given to the expanded component will grow/shrink to fill the rest of the space available - for instance when re-sizing the window. Note that this layout is 100% in both directions by default ({link AbstractComponent.setSizeFull()). Remember to set the units if you want to specify a fixed size. If the layout fails to show up, check that the parent layout is actually giving some space.


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.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
 
Fields inherited from class com.itmill.toolkit.ui.OrderedLayout
components, ORIENTATION_HORIZONTAL, ORIENTATION_VERTICAL
 
Fields inherited from class com.itmill.toolkit.ui.AbstractLayout
margins
 
Fields inherited from interface com.itmill.toolkit.ui.Layout.AlignmentHandler
ALIGNMENT_BOTTOM, ALIGNMENT_HORIZONTAL_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, ALIGNMENT_VERTICAL_CENTER
 
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, UNITS_ROWS
 
Constructor Summary
ExpandLayout()
           
ExpandLayout(int orientation)
           
 
Method Summary
 void addComponent(Component c)
          Add a component into this container.
 void addComponent(Component c, int index)
          Adds a component into indexed position in this container.
 void addComponentAsFirst(Component c)
          Adds a component into this container.
 void expand(Component c)
           
 String getTag()
          Gets the component UIDL tag.
 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.
 
Methods inherited from class com.itmill.toolkit.ui.OrderedLayout
getComponentAlignment, getComponentIterator, getOrientation, isSpacingEnabled, setComponentAlignment, setOrientation, setSpacing
 
Methods inherited from class com.itmill.toolkit.ui.AbstractLayout
setMargin, setMargin
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponentContainer
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener, requestRepaintAll, setEnabled
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponent
addListener, addListener, addListener, addListener, addStyleName, changeVariables, 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, setHeight, setHeightUnits, setIcon, setImmediate, setLocale, setParent, setReadOnly, setSizeFull, setSizeUndefined, setStyle, setStyleName, setWidth, 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.Layout
setMargin, setMargin
 
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
changeVariables, isImmediate
 
Methods inherited from interface com.itmill.toolkit.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUnits, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUnits
 

Constructor Detail

ExpandLayout

public ExpandLayout()

ExpandLayout

public ExpandLayout(int orientation)
Method Detail

expand

public void expand(Component c)
Parameters:
c - Component which container will be maximized

getTag

public String getTag()
Description copied from class: OrderedLayout
Gets the component UIDL tag.

Overrides:
getTag in class OrderedLayout
Returns:
the Component UIDL tag as string.

paintContent

public void paintContent(PaintTarget target)
                  throws PaintException
Description copied from class: OrderedLayout
Paints the content of this component.

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

addComponent

public void addComponent(Component c,
                         int index)
Description copied from class: OrderedLayout
Adds a component into indexed position in this container.

Overrides:
addComponent in class OrderedLayout
Parameters:
c - the component to be added.
index - the Index of the component position. The components currently in and after the position are shifted forwards.

addComponent

public void addComponent(Component c)
Description copied from class: OrderedLayout
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 OrderedLayout
Parameters:
c - the component to be added.
See Also:
ComponentContainer.addComponent(Component)

addComponentAsFirst

public void addComponentAsFirst(Component c)
Description copied from class: OrderedLayout
Adds a component into this container. The component is added to the left or on top of the other components.

Overrides:
addComponentAsFirst in class OrderedLayout
Parameters:
c - the component to be added.

removeComponent

public void removeComponent(Component c)
Description copied from class: OrderedLayout
Removes the component from this container.

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

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.

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


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