|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.comp.AbstractBComponent
This class provides the abstract implementation for BComponent. NOTE: You should never extend from this class. This class is primarily implemented as an abstract class for code-hiding purposes. ALL BARRACUDA COMPONENTS MUST EXTEND FROM BComponent. If that causes you problems, ask Christian why this must be the case.
Field Summary | |
protected Map |
attrs
|
protected List |
children
|
protected Object |
dvc
|
protected boolean |
isStepChild
|
protected static org.apache.log4j.Logger |
logger
|
protected BContainer |
parent
|
protected StateMap |
statemap
|
protected List |
stepChildren
|
protected List |
tempViews
|
protected boolean |
validated
|
protected List |
views
|
Constructor Summary | |
AbstractBComponent()
|
Method Summary | |
BContainer |
addChild(BContainer child)
Add a child container to this one |
BComponent |
addStepChild(BContainer child)
Add a step child; step children are automatically removed after each render. |
BComponent |
addStepChild(BContainer child,
boolean inheritParentAttrs)
Add a step child; step children are automatically removed after each render. |
BComponent |
addTempView(View tview)
Add a temporary view; temp views are automatically removed after each render |
abstract BComponent |
addView(View view)
|
void |
clearState()
clear all state information |
void |
destroyCycle()
Destroy cycle. |
protected Map |
findComponentMap(Class cl)
Look for a factory that can render either this class or its parent class. |
protected RendererFactory |
findRendererFactory(Class cl,
Map domMap)
Look for a factory that can render either this class or its parent class. |
Object |
getAttr(Object attr)
get an attribute associated with this particular component. |
Map |
getAttrMap()
return a reference to the underlying component attribute Map |
BContainer |
getChild(int index)
Get a child container at a given index |
List |
getChildren()
Gets a list of all child BContainers. |
ViewContext |
getDefaultViewContext()
Get the default ViewContext. |
abstract String |
getName()
|
BContainer |
getParent()
Get the parent container. |
Renderer |
getRenderer(Class domCl)
|
Renderer |
getRenderer(View view)
This method allows a component to get a reference to the appropriate renderer. |
AbstractBComponent |
getRootComponent()
|
Object |
getState(Object key)
get a property in this StateMap |
Set |
getStateKeys()
get a keyset for this StateMap (whether or not the set is backed by the data store depends on the implementation) |
Map |
getStateStore()
get a copy of the underlying Map |
abstract List |
getViews()
|
boolean |
hasChildren()
Determine whether this container has any children |
boolean |
hasViews()
Determine whether the component has any views (either regular or temp) |
void |
initCycle()
Initialize cycle. |
static void |
installRendererFactory(RendererFactory rf,
Class compCl,
Class domCl)
This allows developers to install custom renderers for specific classes of components. |
BContainer |
invalidate()
Invalidates the container and all parent containers above it. |
abstract boolean |
isEnabled()
|
boolean |
isStepChild()
Determine whether this component is a step child |
abstract boolean |
isVisible()
|
void |
printStackTrace(int depth,
org.apache.log4j.Logger logger)
|
protected void |
printStackTrace(int depth,
org.apache.log4j.Logger logger,
OutputStream out)
For debugging purposes. |
void |
printStackTrace(int depth,
OutputStream out)
|
void |
putState(Object key,
Object val)
set a property in this StateMap |
BContainer |
removeAll()
Remove all child containers from this one |
BComponent |
removeAllStepChildren()
Remove all step children |
abstract BComponent |
removeAllViews()
|
BContainer |
removeChild(BContainer child)
Remove a child container from this one |
BContainer |
removeChild(int index)
Remove a child container for a given index |
Object |
removeState(Object key)
remove a property in this StateMap |
abstract boolean |
removeView(View view)
|
abstract BComponent |
render(ViewContext vc)
|
Attrs |
setAttr(Object attr,
Object val)
set an attribute for this particular component. |
BComponent |
setDefaultViewContext(ViewContext idvc)
Set the default ViewContext. |
abstract BComponent |
setEnabled(boolean val)
|
abstract BComponent |
setEnabled(boolean val,
boolean recurse)
|
abstract BContainer |
setName(String iname)
|
BContainer |
setParent(BContainer iparent)
Set the parent container. |
abstract BComponent |
setView(View view)
|
abstract BComponent |
setVisible(boolean val)
|
abstract BComponent |
setVisible(boolean val,
boolean recurse)
|
abstract boolean |
supports(ViewContext vc)
|
String |
toRef()
Get the component reference |
String |
toString()
Get a String representation of the component |
String |
toString(ViewContext vc)
Provide a String representation of the component. |
BContainer |
validate()
Invalidates the container and all child containers below it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final org.apache.log4j.Logger logger
protected BContainer parent
protected List children
protected List stepChildren
protected boolean isStepChild
protected List views
protected List tempViews
protected Object dvc
protected boolean validated
protected StateMap statemap
protected Map attrs
Constructor Detail |
public AbstractBComponent()
Method Detail |
public abstract BContainer setName(String iname)
setName
in interface BContainer
public abstract String getName()
getName
in interface BContainer
public abstract BComponent setVisible(boolean val)
public abstract BComponent setVisible(boolean val, boolean recurse)
public abstract boolean isVisible()
public abstract BComponent setEnabled(boolean val)
public abstract BComponent setEnabled(boolean val, boolean recurse)
public abstract boolean isEnabled()
public abstract BComponent setView(View view)
public abstract BComponent addView(View view)
public abstract boolean removeView(View view)
public abstract BComponent removeAllViews()
public abstract List getViews()
public abstract BComponent render(ViewContext vc) throws RenderException
RenderException
public abstract boolean supports(ViewContext vc)
public BComponent setDefaultViewContext(ViewContext idvc)
idvc
- the default ViewContextpublic ViewContext getDefaultViewContext()
public AbstractBComponent getRootComponent()
public static void installRendererFactory(RendererFactory rf, Class compCl, Class domCl)
rf
- the RendererFactory to be registeredcompCl
- the target document classdomCl
- the target dom classpublic Renderer getRenderer(View view) throws NoSuitableRendererException
NoSuitableRendererException
public Renderer getRenderer(Class domCl) throws NoSuitableRendererException
NoSuitableRendererException
protected Map findComponentMap(Class cl)
protected RendererFactory findRendererFactory(Class cl, Map domMap)
public void initCycle()
public void destroyCycle()
public BContainer setParent(BContainer iparent)
setParent
in interface BContainer
iparent
- the parent containerpublic BContainer getParent()
getParent
in interface BContainer
public BContainer addChild(BContainer child)
addChild
in interface BContainer
child
- the child container to be addedpublic BContainer getChild(int index)
getChild
in interface BContainer
index
- the index of the child containerpublic BContainer removeChild(BContainer child)
removeChild
in interface BContainer
child
- the a child container to be removed
public BContainer removeChild(int index)
removeChild
in interface BContainer
index
- of the child container to be removed
public BContainer removeAll()
removeAll
in interface BContainer
public boolean hasChildren()
hasChildren
in interface BContainer
public List getChildren()
getChildren
in interface BContainer
public boolean isStepChild()
public BComponent addStepChild(BContainer child)
child
- the step child container to be addedpublic BComponent addStepChild(BContainer child, boolean inheritParentAttrs)
child
- the step child container to be addedinheritParentAttrs
- true if we want the step child to
inherit the parent's settings for visibility/enabledpublic BComponent removeAllStepChildren()
public BComponent addTempView(View tview)
tview
- the temp view to be addedpublic boolean hasViews()
public BContainer invalidate()
invalidate
in interface BContainer
public BContainer validate()
validate
in interface BContainer
public void putState(Object key, Object val)
putState
in interface StateMap
key
- the state key objectval
- the state value objectpublic Object getState(Object key)
getState
in interface StateMap
key
- the state key object
public Object removeState(Object key)
removeState
in interface StateMap
key
- the key object
public Set getStateKeys()
getStateKeys
in interface StateMap
public Map getStateStore()
getStateStore
in interface StateMap
public void clearState()
clearState
in interface StateMap
public Attrs setAttr(Object attr, Object val)
setAttr
in interface Attrs
attr
- the attribute nameval
- the attribute valuepublic Object getAttr(Object attr)
getAttr
in interface Attrs
attr
- the attribute name
public Map getAttrMap()
getAttrMap
in interface Attrs
public String toRef()
public String toString()
public String toString(ViewContext vc)
public void printStackTrace(int depth, org.apache.log4j.Logger logger)
public void printStackTrace(int depth, OutputStream out)
protected void printStackTrace(int depth, org.apache.log4j.Logger logger, OutputStream out)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |