echoxul.view.impl
Class ViewContextImpl

java.lang.Object
  extended byechoxul.view.impl.ViewContextImpl
All Implemented Interfaces:
java.io.Serializable, ViewContext

public class ViewContextImpl
extends java.lang.Object
implements ViewContext, java.io.Serializable

Author:
Terry Laurenzo
See Also:
Serialized Form

Constructor Summary
ViewContextImpl()
          Constructor for serialization purposes only.
ViewContextImpl(ViewContextImpl parent, nextapp.echo.Component rootComponent, java.lang.String name)
           
 
Method Summary
protected  void assertWriteable()
          Throws IllegalStateException if lock() has been called
 void delete()
          Delete (disassociate) this ViewContext from its parent.
 nextapp.echo.Component getComponent(java.lang.String name)
          Returns the first component bound to a given name in this context.
 java.util.List getComponents(java.lang.String name)
          Returns a read-only list of all Components bound to this ViewContext with the given name
 ViewContext getParentContext()
           
 nextapp.echo.Component getRootComponent()
          Each ViewContext is represented by a single root component
 ViewContext getSubContext(java.lang.String name)
          Returns the first ViewContext with a given name to exist in this ViewContext
 java.util.List getSubContexts(java.lang.String name)
          Returns a read-only List of all ViewContexts with a given name
 View getView()
           
 ViewContext instantiateModelContext(java.lang.String name)
          Instantiate a new model context and add it to the view.
 java.util.Set listComponents()
           
 java.util.Set listModelContexts()
           
 java.util.Set listSubContexts()
           
 void lock()
           
 void setComponents(java.lang.String name, nextapp.echo.Component[] array)
           
 void setModelContext(java.lang.String name, ModelViewContextStub stub)
           
 void setSubContexts(java.lang.String name, ViewContextImpl[] array)
           
 void setViewContextualizables(ViewContextualizable[] vca)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewContextImpl

public ViewContextImpl()
Constructor for serialization purposes only. Implicitly locks the instance.


ViewContextImpl

public ViewContextImpl(ViewContextImpl parent,
                       nextapp.echo.Component rootComponent,
                       java.lang.String name)
Method Detail

setComponents

public void setComponents(java.lang.String name,
                          nextapp.echo.Component[] array)

setSubContexts

public void setSubContexts(java.lang.String name,
                           ViewContextImpl[] array)

setModelContext

public void setModelContext(java.lang.String name,
                            ModelViewContextStub stub)

setViewContextualizables

public void setViewContextualizables(ViewContextualizable[] vca)

assertWriteable

protected void assertWriteable()
Throws IllegalStateException if lock() has been called


lock

public void lock()

instantiateModelContext

public ViewContext instantiateModelContext(java.lang.String name)
Description copied from interface: ViewContext
Instantiate a new model context and add it to the view.

Specified by:
instantiateModelContext in interface ViewContext
Parameters:
name -
Returns:
newly created ViewContext

delete

public void delete()
Description copied from interface: ViewContext
Delete (disassociate) this ViewContext from its parent. This operation is only supported for ViewContexts added to the hierarchy through a call to instantiateModelContext

Specified by:
delete in interface ViewContext

getSubContext

public ViewContext getSubContext(java.lang.String name)
Description copied from interface: ViewContext
Returns the first ViewContext with a given name to exist in this ViewContext

Specified by:
getSubContext in interface ViewContext
Parameters:
name -
Returns:
ViewContext (never null)

getSubContexts

public java.util.List getSubContexts(java.lang.String name)
Description copied from interface: ViewContext
Returns a read-only List of all ViewContexts with a given name

Specified by:
getSubContexts in interface ViewContext
Parameters:
name -
Returns:
List of ViewContext (may be zero length). Never Null.

getComponent

public nextapp.echo.Component getComponent(java.lang.String name)
Description copied from interface: ViewContext
Returns the first component bound to a given name in this context.

Specified by:
getComponent in interface ViewContext
Parameters:
name -
Returns:
bound component (never null)

getComponents

public java.util.List getComponents(java.lang.String name)
Description copied from interface: ViewContext
Returns a read-only list of all Components bound to this ViewContext with the given name

Specified by:
getComponents in interface ViewContext
Parameters:
name -
Returns:
List of Component (may be zero length). Never null.

listComponents

public java.util.Set listComponents()
Specified by:
listComponents in interface ViewContext
Returns:
A Set of String names for all components in this context

listSubContexts

public java.util.Set listSubContexts()
Specified by:
listSubContexts in interface ViewContext
Returns:
A Set of String names for all sub contexts in this context

listModelContexts

public java.util.Set listModelContexts()
Specified by:
listModelContexts in interface ViewContext
Returns:
A Set of String names for all model contexts in this context

getParentContext

public ViewContext getParentContext()
Specified by:
getParentContext in interface ViewContext
Returns:
The parent context or null if root or unregistered

getView

public View getView()
Specified by:
getView in interface ViewContext
Returns:
The root view that this context is a part of

getRootComponent

public nextapp.echo.Component getRootComponent()
Description copied from interface: ViewContext
Each ViewContext is represented by a single root component

Specified by:
getRootComponent in interface ViewContext
Returns:
root Component


Copyright © 2004 Terry Laurenzo. All Rights Reserved.