|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.comp.AbstractBComponent
org.barracudamvc.core.comp.BComponent
public class BComponent
Defines the base component class from which all other Barracuda components are derived. Its Swing counterpart would be JComponent.
Field Summary | |
---|---|
static String |
DEFAULT_ENCODING
|
protected boolean |
enabled
|
protected String |
enc
|
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.barracudamvc.core.comp.AbstractBComponent |
---|
attrs, children, dvc, isStepChild, parent, statemap, stepChildren, tempViews, validated, views |
Constructor Summary | |
---|---|
BComponent()
|
Method Summary | |
---|---|
BComponent |
addView(View view)
Bind a component to a view |
protected String |
decodeStr(String s)
Actually decode a string based on the current encoding - note that we eat any acceptions that get thrown; if they occur we simply re-encode using UTF-8 |
protected String |
encodeStr(String s)
Actually encode a string based on the current encoding - note that we eat any acceptions that get thrown; if they occur we simply re-encode using UTF-8 |
String |
getEncoding()
Get the encoding for this component. |
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. |
BComponent |
removeAllViews()
Remove all views from this component |
boolean |
removeView(View view)
Remove a view from this component |
BComponent |
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)
|
BComponent |
setEnabled(boolean val)
Enable/disable the component |
BComponent |
setEnabled(boolean val,
boolean recurse)
Enable/disable the component recursively |
void |
setEncoding(String ienc)
Set the encoding for this component (and all children, unless they specifically specify a different encoding). |
BContainer |
setName(String iname)
Set the name for this component. |
BComponent |
setRenderStrategy(RenderStrategy irs)
Set the render strategy for this component and all its children. |
BComponent |
setView(View view)
Set the components primary view. |
BComponent |
setVisible(boolean val)
Set the component visibility |
BComponent |
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.barracudamvc.core.comp.AbstractBComponent |
---|
addChild, addStepChild, addStepChild, addTempView, clearState, destroyCycle, findComponentMap, findRendererFactory, getAttr, getAttrMap, getChild, getChildren, getDefaultViewContext, getParent, getRenderer, getRenderer, getRendererFactory, getRootComponent, getState, getStateKeys, getStateStore, hasChildren, hasViews, initCycle, installRendererFactory, invalidate, isStepChild, printStackTrace, printStackTrace, printStackTrace, putState, removeAll, removeAllStepChildren, removeChild, removeChild, removeState, setAttr, 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
public static String DEFAULT_ENCODING
protected String name
protected boolean visible
protected boolean enabled
protected RenderStrategy rs
protected String enc
Constructor Detail |
---|
public BComponent()
Method Detail |
---|
public BContainer 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 BComponent setVisible(boolean val)
setVisible
in class AbstractBComponent
val
- true if the component should be visiblepublic BComponent 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 BComponent setEnabled(boolean val)
setEnabled
in class AbstractBComponent
val
- true if the component should be enabledpublic BComponent 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 setEncoding(String ienc)
enc
- the encoding for this component (null = look to parent)public String getEncoding()
protected String encodeStr(String s)
protected String decodeStr(String s)
public BComponent setView(View view)
setView
in class AbstractBComponent
view
- the view to which this component is boundpublic BComponent 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 BComponent removeAllViews()
removeAllViews
in class AbstractBComponent
public List getViews()
getViews
in class AbstractBComponent
protected View getFirstView()
public BComponent 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 BComponent 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 |