echoxul.view
Interface ViewContext

All Known Implementing Classes:
ViewContextImpl

public interface ViewContext

The view context is what the echo controller interacts with to locate and manipulate individual echo view components. ViewContexts can be arranged into a hierarchy, depending on the needs of the application.

Author:
Terry Laurenzo

Method Summary
 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()
           
 

Method Detail

instantiateModelContext

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

Parameters:
name -
Returns:
newly created ViewContext

delete

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

Throws:
ViewException - if the operation is not allowed

getSubContext

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

Parameters:
name -
Returns:
ViewContext (never null)
Throws:
ViewNotFoundException - if the sub context does not exist

getSubContexts

public java.util.List getSubContexts(java.lang.String name)
Returns a read-only List of all ViewContexts with a given name

Parameters:
name -
Returns:
List of ViewContext (may be zero length). Never Null.

getComponent

public nextapp.echo.Component getComponent(java.lang.String name)
Returns the first component bound to a given name in this context.

Parameters:
name -
Returns:
bound component (never null)
Throws:
ViewNotFoundException - if the component does not exist

getComponents

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

Parameters:
name -
Returns:
List of Component (may be zero length). Never null.

listComponents

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

listSubContexts

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

listModelContexts

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

getParentContext

public ViewContext getParentContext()
Returns:
The parent context or null if root or unregistered

getView

public View getView()
Returns:
The root view that this context is a part of

getRootComponent

public nextapp.echo.Component getRootComponent()
Each ViewContext is represented by a single root component

Returns:
root Component


Copyright © 2004 Terry Laurenzo. All Rights Reserved.