com.tirsen.angkor.widget
Class Container

java.lang.Object
  |
  +--com.tirsen.angkor.Component
        |
        +--com.tirsen.angkor.widget.Container
All Implemented Interfaces:
java.io.Serializable, View
Direct Known Subclasses:
Form, ImageMap, Link, Menu, Page, Section, SectionLine, Table

public class Container
extends Component

Default implementation of a component that contains other components.

Version:
$Revision: 1.4 $
Author:
$Author: tirsen $
See Also:
Serialized Form

Field Summary
protected  java.util.List children
           
 
Constructor Summary
Container()
           
Container(java.lang.String id)
           
 
Method Summary
 void add(int index, View element)
          Inserts main element at specified index.
 void add(View element)
          Add a main element.
protected  void createChildren()
          Overload to create any default children in subclasses.
 java.util.List getChildren()
           
 int getNumberOfChildren()
           
 boolean isChildrenCreated()
           
 java.util.Iterator iterateAllElements()
          Iterates all elements of this container, not just the main elements.
protected static java.util.Iterator iterateCollection(java.util.Collection coll)
          Iterates the collection even if it is null.
protected  void maybeCreateChildren()
           
 void parse(RenderContext context)
          When a view has registered during rendering for parsing in the RenderContext the context will call this method on the next request.
 void remove(Component element)
          Remove a main element.
 void render(RenderContext context)
          Render this view on the given context if the view is visible.
 void renderChildren(RenderContext context)
           
 
Methods inherited from class com.tirsen.angkor.Component
allocateUniqueId, getAttribute, getContainer, getId, getRenderContext, getVisibleIndex, isDebugTables, isParsing, isVisible, setAttribute, setContainer, setId, setVisible, uniqueId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.util.List children
Constructor Detail

Container

public Container()

Container

public Container(java.lang.String id)
Method Detail

iterateCollection

protected static java.util.Iterator iterateCollection(java.util.Collection coll)
Iterates the collection even if it is null.


renderChildren

public void renderChildren(RenderContext context)
                    throws java.io.IOException
java.io.IOException

getChildren

public java.util.List getChildren()

getNumberOfChildren

public int getNumberOfChildren()

iterateAllElements

public java.util.Iterator iterateAllElements()
Iterates all elements of this container, not just the main elements.


add

public void add(int index,
                View element)
Inserts main element at specified index. All other add-methods call this method, thus subclasses only need to overload this method to provide additional behaviour.


add

public void add(View element)
Add a main element.


remove

public void remove(Component element)
Remove a main element.


parse

public void parse(RenderContext context)
Description copied from interface: View
When a view has registered during rendering for parsing in the RenderContext the context will call this method on the next request. The view is responsible for parsing the request based on it's unique id and update models and sending events based on the request. In most cases the EventQueue should be used to send the events. This ensures that the models are all correctly updated before the events are actually processed. This is important since controllers (whom processes the events) must rely on this to process events correctly.

Specified by:
parse in interface View
Overrides:
parse in class Component

render

public void render(RenderContext context)
            throws java.io.IOException
Description copied from interface: View
Render this view on the given context if the view is visible. Performed during render-phase.

Specified by:
render in interface View
Specified by:
render in class Component
java.io.IOException
See Also:
View.setVisible(boolean), View.isVisible()

createChildren

protected void createChildren()
Overload to create any default children in subclasses. Will be executed before any children is actually needed by the framework.


maybeCreateChildren

protected void maybeCreateChildren()

isChildrenCreated

public boolean isChildrenCreated()


Copyright © 2002-2002 . All Rights Reserved.