|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.barracuda.core.comp.AbstractBComponent
org.enhydra.barracuda.core.comp.BComponent
Defines the base component class from which all other Barracuda components are derived. Its Swing counterpart would be JComponent.
Field Summary | |
protected Map |
attrs
|
protected boolean |
enabled
|
protected static org.apache.log4j.Logger |
logger
|
protected String |
name
|
protected RenderStrategy |
rs
|
static String |
VISIBILITY_MARKER
|
protected boolean |
visible
|
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent |
children, dvc, isStepChild, parent, statemap, stepChildren, tempViews, validated, views |
Constructor Summary | |
BComponent()
|
Method Summary | |
void |
addView(View view)
Bind a component to a view |
Object |
getAttr(Object attr)
get an attribute associated with this particular component. |
Map |
getAttrMap()
get a copy of the underlying component attribute Map |
protected View |
getFirstView()
|
String |
getName()
Get the name for this component |
RenderStrategy |
getRenderStrategy()
Get the render strategy for this component |
List |
getViews()
Get a list of all the views for this component. |
boolean |
isEnabled()
See if the component is enabled |
boolean |
isVisible()
Get the component visibility |
protected void |
postRender(ViewContext vc,
int depth)
Cleanup after rendering. |
protected void |
preRender(ViewContext vc,
int depth)
Prep phase before rendering. |
void |
removeAllViews()
Remove all views from this component |
boolean |
removeView(View view)
Remove a view from this component |
void |
render(ViewContext vc)
Render the component for a view with the specified ViewContext. |
protected void |
render(ViewContext vc,
int depth)
|
protected void |
renderView(View view,
ViewContext vc)
Render a specific view for the component. |
protected void |
renderView(View view,
ViewContext vc,
int depth)
|
void |
setAttr(Object attr,
Object val)
set an attribute for this particular component. |
void |
setEnabled(boolean val)
Enable/disable the component |
void |
setEnabled(boolean val,
boolean recurse)
Enable/disable the component recursively |
void |
setName(String iname)
Set the name for this component. |
void |
setRenderStrategy(RenderStrategy irs)
Set the render strategy for this component and all its children. |
void |
setView(View view)
Set the components primary view. |
void |
setVisible(boolean val)
Set the component visibility |
void |
setVisible(boolean val,
boolean recurse)
Set the component visibility recursively |
boolean |
supports(ViewContext vc)
Determine if a specific ViewContext is supported by this component |
Methods inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent |
addChild, addStepChild, addStepChild, addTempView, clearState, destroyCycle, findComponentMap, findRendererFactory, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRootComponent, getState, getStateKeys, getStateValues, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setDefaultViewContext, setParent, toRef, toString, toString, validate |
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
public static final String VISIBILITY_MARKER
protected String name
protected boolean visible
protected boolean enabled
protected Map attrs
protected RenderStrategy rs
Constructor Detail |
public BComponent()
Method Detail |
public void setName(String iname)
Note that for several types of views (HTMLAnchorElement, HTMLAppletElement, HTMLButtonElement, HTMLFormElement, HTMLFrameElement, HTMLIFrameElement, HTMLInputElement, HTMLMapElement, HTMLMetaElement, HTMLObjectElement, HTMLParamElement, HTMLSelectElement, and HTMLTextAreaElement) this property will be used in rendering if it is actually set. This means that if you set the component name, and it is bound to a view that is backed by one of these nodes, then the name attribute in that node will be overridden. So be careful!!!
setName
in interface BContainer
setName
in class AbstractBComponent
iname
- the name for this componentpublic String getName()
getName
in interface BContainer
getName
in class AbstractBComponent
public void setVisible(boolean val)
setVisible
in class AbstractBComponent
val
- true if the component should be visiblepublic void setVisible(boolean val, boolean recurse)
setVisible
in class AbstractBComponent
val
- true if the component should be visiblerecurse
- true if we want to set this value recursivelypublic boolean isVisible()
isVisible
in class AbstractBComponent
public void setEnabled(boolean val)
setEnabled
in class AbstractBComponent
val
- true if the component should be enabledpublic void setEnabled(boolean val, boolean recurse)
setEnabled
in class AbstractBComponent
val
- true if the component should be enabledrecurse
- true if we want to set this value recursivelypublic boolean isEnabled()
isEnabled
in class AbstractBComponent
public void setView(View view)
setView
in class AbstractBComponent
view
- the view to which this component is boundpublic void addView(View view)
addView
in class AbstractBComponent
view
- the view to which this component is boundpublic boolean removeView(View view)
removeView
in class AbstractBComponent
public void removeAllViews()
removeAllViews
in class AbstractBComponent
public List getViews()
getViews
in class AbstractBComponent
protected View getFirstView()
public void setAttr(Object attr, Object val)
setAttr
in class AbstractBComponent
attr
- the attribute nameval
- the attribute valuepublic Object getAttr(Object attr)
getAttr
in class AbstractBComponent
attr
- the attribute name
public Map getAttrMap()
getAttrMap
in class AbstractBComponent
public void setRenderStrategy(RenderStrategy irs)
If the value is null, it will inherit setting from parent. If the setting for the root parent is null, it will default to RenderStrategy.DEFAULT_RENDER_STRATEGY
irs
- the RenderStrategypublic RenderStrategy getRenderStrategy()
public void render(ViewContext vc) throws RenderException
render
in class AbstractBComponent
vc
- ViewContext for the client view
RenderException
- if the particular View cannot be renderedprotected void render(ViewContext vc, int depth) throws RenderException
RenderException
protected void preRender(ViewContext vc, int depth)
protected final void renderView(View view, ViewContext vc) throws RenderException
view
- View to be renderedvc
- ViewContext for the client view
RenderException
- if the particular View cannot be renderedprotected void renderView(View view, ViewContext vc, int depth) throws RenderException
RenderException
protected void postRender(ViewContext vc, int depth)
public boolean supports(ViewContext vc)
supports
in class AbstractBComponent
vc
- ViewContext for the client view
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |