echoxul.view
Class ViewComponent

java.lang.Object
  extended bynextapp.echo.Component
      extended byechoxul.view.ViewComponent
All Implemented Interfaces:
java.io.Serializable

public class ViewComponent
extends nextapp.echo.Component

This component serves as a base class for implementing components which are derived from a View. Children should NOT be added to this component explicitly.

During the time between construction and initialization, the subclass or the user of the component must specify the resource location used to lookup the concrete View instance from the ViewCache. Setting the resource location multiple times prior to init() being called results in only the last setting being honored. This allows a subclass to specify a default during construction which can be overriden by the user of the component prior to init().

There are several ways to set the resource location:

Both the constructor and the setViewResource(String) method expect a "resource location" string. This string is a path-like structure which will be resolved by the registered implementation of ViewCache (@see ViewCache). While different implementations of ViewCache can implement custom syntaxes, the following syntaxes will always be supported:

Subclass init() methods must always call super.init() as their first step. After the base class init() method has been called, the call to getViewContext() will be guaranteed to succeed and allows access to the virtual component hierarchy.

Author:
Terry Laurenzo
See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
ViewComponent()
          Default "do-nothing" constructor
ViewComponent(java.lang.String resourcePath)
          Construct a ViewComponent with a default resourcePath
 
Method Summary
 ViewContext getViewContext()
          Return the ViewContext that this instance is wrapping.
protected  void init()
           
 void setResourcePath(java.lang.String resourcePath)
           
 void setView(View view)
           
 void setViewContext(ViewContext viewContext)
           
 
Methods inherited from class nextapp.echo.Component
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewComponent

public ViewComponent()
Default "do-nothing" constructor


ViewComponent

public ViewComponent(java.lang.String resourcePath)
Construct a ViewComponent with a default resourcePath

Parameters:
resourcePath -
Method Detail

setResourcePath

public void setResourcePath(java.lang.String resourcePath)

setViewContext

public void setViewContext(ViewContext viewContext)

setView

public void setView(View view)

init

protected void init()

getViewContext

public ViewContext getViewContext()
Return the ViewContext that this instance is wrapping. Only valid after init() has been executed.

Returns:
The ViewContext which this instance is wrapping.


Copyright © 2004 Terry Laurenzo. All Rights Reserved.