Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.ui
Class BaseRenderer

java.lang.Object
  |
  +--oracle.cabo.ui.BaseRenderer
All Implemented Interfaces:
Renderer
Direct Known Subclasses:
ElementRenderer

public class BaseRenderer
extends java.lang.Object
implements Renderer

Basic implementation of Renderer.

The protected hooks on this class are called in the following order:


Field Summary
protected static int NO_CHILD_INDEX
          Value passed to renderIndexedChild to indicate that no child exists.
 
Constructor Summary
BaseRenderer()
           
 
Method Summary
protected  int getNextRenderedChildIndex(RenderingContext context, UINode parentNode, int afterChildIndex)
           
protected  UINode getNextRenderedChildNode(RenderingContext context, UINode parentNode, int afterChildIndex)
          Returns the next child UINode that will be rendered after the passed in index.
protected  int getVisibleIndexedChildCount(RenderingContext context, UINode node)
          Convenience function to return the number of non-skipped indexed children.
protected  void postrender(RenderingContext context, UINode node)
          Called to render the portion after the contents.
protected  void prerender(RenderingContext context, UINode node)
          Called to render the portion before the contents.
 void render(RenderingContext context, UINode node)
          Render a UINode in a RenderingContext.
protected  void renderBetweenIndexedChildren(RenderingContext context, UINode node)
          Called to render between each set of rendered indexed children.
protected  void renderBetweenIndexedChildren(RenderingContext context, UINode node, int nextIndex)
          Called to render between each set of rendered indexed children.
protected  void renderChild(RenderingContext context, UINode child)
          Called to render a child.
protected  void renderContent(RenderingContext context, UINode node)
           
protected  void renderIndexedChild(RenderingContext context, UINode node, int childIndex)
          Called to render an indexed child.
protected  void renderIndexedChild(RenderingContext context, UINode node, int currVisChildIndex, int prevVisChildIndex, int nextVisChildIndex, int ithRenderedChild)
          Called each time an indexed child needs to be rendered.
protected  void renderNamedChild(RenderingContext context, UINode node, java.lang.String childName)
          Called to render a named child.
protected  void renderNamedChild(RenderingContext context, UINode node, UINode child, java.lang.String childName)
          Called to render a named child.
protected  boolean skipChild(RenderingContext context, UINode node, UINode child)
          Called to determine if a specific child should be skipped.
static boolean skipNode(RenderingContext context, UINode node)
          Determines if a specific UINode should be skipped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHILD_INDEX

protected static final int NO_CHILD_INDEX
Value passed to renderIndexedChild to indicate that no child exists.

See Also:
renderIndexedChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, int, int, int, int)
Constructor Detail

BaseRenderer

public BaseRenderer()
Method Detail

skipNode

public static boolean skipNode(RenderingContext context,
                               UINode node)
Determines if a specific UINode should be skipped.
Parameters:
context - the rendering context
node - the node under consideration
Returns:
true for nodes with a UIConstants.RENDERED_ATTR attribute set to Boolean.FALSE.

render

public void render(RenderingContext context,
                   UINode node)
            throws java.io.IOException
Render a UINode in a RenderingContext. Subclassers should not need to override this method.
Specified by:
render in interface Renderer
Parameters:
context - the rendering context
node - the current UINode

renderContent

protected void renderContent(RenderingContext context,
                             UINode node)
                      throws java.io.IOException

getNextRenderedChildNode

protected final UINode getNextRenderedChildNode(RenderingContext context,
                                                UINode parentNode,
                                                int afterChildIndex)
Returns the next child UINode that will be rendered after the passed in index.

See Also:
getNextRenderedChildIndex(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, int)

getNextRenderedChildIndex

protected int getNextRenderedChildIndex(RenderingContext context,
                                        UINode parentNode,
                                        int afterChildIndex)
Parameters:
afterChildIndex - The indexed children coming after this index, will be considered. To find the first rendered child use NO_CHILD_INDEX
Returns:
the index of the next child UINode that must be rendered, or NO_CHILD_INDEX if there is none.
See Also:
getNextRenderedChildNode(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, int)

renderIndexedChild

protected void renderIndexedChild(RenderingContext context,
                                  UINode node,
                                  int currVisChildIndex,
                                  int prevVisChildIndex,
                                  int nextVisChildIndex,
                                  int ithRenderedChild)
                           throws java.io.IOException
Called each time an indexed child needs to be rendered. The previous visible child is passed in to provide renderers with additional context information.

The default implementation is call the three-argument version of renderIndexedChild().

See Also:
renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

prerender

protected void prerender(RenderingContext context,
                         UINode node)
                  throws java.io.IOException
Called to render the portion before the contents. Default implementation does nothing.
Parameters:
context - the rendering context
node - the current UINode

postrender

protected void postrender(RenderingContext context,
                          UINode node)
                   throws java.io.IOException
Called to render the portion after the contents. Default implementation does nothing.
Parameters:
context - the rendering context
node - the current UINode

renderBetweenIndexedChildren

protected void renderBetweenIndexedChildren(RenderingContext context,
                                            UINode node)
                                     throws java.io.IOException
Called to render between each set of rendered indexed children.
Parameters:
context - the rendering context
node - the current UINode

renderBetweenIndexedChildren

protected void renderBetweenIndexedChildren(RenderingContext context,
                                            UINode node,
                                            int nextIndex)
                                     throws java.io.IOException
Called to render between each set of rendered indexed children.
Parameters:
context - the rendering context
node - the current UINode
index - the index of the next child to be rendered

skipChild

protected boolean skipChild(RenderingContext context,
                            UINode node,
                            UINode child)
Called to determine if a specific child should be skipped. This method is called for both named children and indexed children. The default implementation returns true for nodes with a rendered attribute set to Boolean.FALSE.

Parameters:
context - the rendering context
node - the current UINode
child - the child under consideration

See Also:
getVisibleIndexedChildCount(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

renderIndexedChild

protected void renderIndexedChild(RenderingContext context,
                                  UINode node,
                                  int childIndex)
                           throws java.io.IOException
Called to render an indexed child. The default implementation will update the context as needed (e.g., calling pushChild() and popChild()) and then call renderChild().

See Also:
renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

renderNamedChild

protected final void renderNamedChild(RenderingContext context,
                                      UINode node,
                                      java.lang.String childName)
                               throws java.io.IOException
Called to render a named child. Retrieves the child, then calls the four-argument version of this function.

See Also:
renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

renderNamedChild

protected void renderNamedChild(RenderingContext context,
                                UINode node,
                                UINode child,
                                java.lang.String childName)
                         throws java.io.IOException
Called to render a named child. Renderers that render named children should call this method to do the actual rendering. The default implementation will update the context as needed (e.g., calling pushChild() and popChild()) and render the child.

See Also:
renderChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode)

renderChild

protected void renderChild(RenderingContext context,
                           UINode child)
                    throws java.io.IOException
Called to render a child. This method does not update the rendering context (by calling pushChild() and popChild() as needed); subclasses need to use renderIndexedChild() or renderNamedChild() for that purpose.

Parameters:
context - the rendering context
node - the current UINode
child - the child under consideration

getVisibleIndexedChildCount

protected int getVisibleIndexedChildCount(RenderingContext context,
                                          UINode node)
Convenience function to return the number of non-skipped indexed children.

Parameters:
context - the rendering context
node - the current UINode

See Also:
skipChild(oracle.cabo.ui.RenderingContext, oracle.cabo.ui.UINode, oracle.cabo.ui.UINode)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.