org.ultrawork.wtk.mc
Class ContainerImpl

java.lang.Object
  |
  +--org.ultrawork.wtk.mc.ContainerImpl
All Implemented Interfaces:
Component, Container
Direct Known Subclasses:
Page

public class ContainerImpl
extends java.lang.Object
implements Container

A lightweight implementation of a container.

Version:
0.2
Author:
Nicolas Bonvin

Field Summary
protected  java.util.TreeMap components
           
private  java.lang.String layout
           
private  Container master
           
 
Fields inherited from interface org.ultrawork.wtk.mc.Component
LOCALE_KEY
 
Constructor Summary
ContainerImpl()
           
ContainerImpl(java.lang.String layout)
           
 
Method Summary
 void add(Component component)
           
 void add(java.lang.String position, Component component)
           
protected  void addComponentToContainerHierarchy(Component component, java.lang.String position)
           
 boolean contains(java.lang.String position, boolean lookupMasterHierarchy)
           
protected  boolean containsContainer(Container container, java.lang.String position, boolean lookupMasterHierarchy)
           
protected  Container createLinkedContainer(Container parentContainer, java.lang.String currentPosition)
           
 Component find(java.lang.String position)
           
 Component find(java.lang.String position, boolean recursive)
           
 Container findContainer(java.lang.String containerName)
           
 java.util.Map getComponents()
          Gets the components
 java.util.List getComponentsAsList()
          Gets the components
 java.lang.String getLayout()
          Gets the layout
 Container getMaster()
          Gets the master
private  boolean hasMaster()
           
 void setLayout(java.lang.String layout)
          Sets the layout
 void setMaster(Container master)
           
 java.lang.String toString()
           
 void write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Writes the component to the http response.
 void write(javax.servlet.jsp.PageContext pageContext)
          Writes the component to the current page.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

components

protected java.util.TreeMap components

master

private Container master

layout

private java.lang.String layout
Constructor Detail

ContainerImpl

public ContainerImpl()

ContainerImpl

public ContainerImpl(java.lang.String layout)
Method Detail

find

public Component find(java.lang.String position)
Specified by:
find in interface Container
See Also:
Container.find(String)

find

public Component find(java.lang.String position,
                      boolean recursive)
Specified by:
find in interface Container
See Also:
Container.find(String)

findContainer

public Container findContainer(java.lang.String containerName)
Specified by:
findContainer in interface Container
See Also:
Container.findContainer(String)

add

public void add(Component component)
Specified by:
add in interface Container
See Also:
Container.add(Component)

add

public void add(java.lang.String position,
                Component component)
Specified by:
add in interface Container
See Also:
Container.add(String, Component)

addComponentToContainerHierarchy

protected void addComponentToContainerHierarchy(Component component,
                                                java.lang.String position)

createLinkedContainer

protected Container createLinkedContainer(Container parentContainer,
                                          java.lang.String currentPosition)

containsContainer

protected boolean containsContainer(Container container,
                                    java.lang.String position,
                                    boolean lookupMasterHierarchy)

contains

public boolean contains(java.lang.String position,
                        boolean lookupMasterHierarchy)
Specified by:
contains in interface Container

getMaster

public Container getMaster()
Gets the master
Specified by:
getMaster in interface Container
Returns:
Returns a Container

setMaster

public void setMaster(Container master)
Specified by:
setMaster in interface Container
See Also:
Container.setMaster(Container)

hasMaster

private boolean hasMaster()

getLayout

public java.lang.String getLayout()
Gets the layout
Specified by:
getLayout in interface Container
Returns:
Returns a String

setLayout

public void setLayout(java.lang.String layout)
Sets the layout
Specified by:
setLayout in interface Container
Parameters:
layout - The layout to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(javax.servlet.jsp.PageContext pageContext)
           throws java.io.IOException,
                  javax.servlet.ServletException
Description copied from interface: Component
Writes the component to the current page.
Specified by:
write in interface Component
See Also:
Component.write(PageContext)

write

public void write(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Description copied from interface: Component
Writes the component to the http response.
Specified by:
write in interface Component

getComponents

public java.util.Map getComponents()
Gets the components
Specified by:
getComponents in interface Container
Returns:
Returns a TreeMap

getComponentsAsList

public java.util.List getComponentsAsList()
Gets the components
Specified by:
getComponentsAsList in interface Container
Returns:
Returns a List


Copyright 2002 - ultrawork