org.enhydra.barracuda.core.comp
Class BLink

java.lang.Object
  extended byorg.enhydra.barracuda.core.comp.AbstractBComponent
      extended byorg.enhydra.barracuda.core.comp.BComponent
          extended byorg.enhydra.barracuda.core.comp.BAction
              extended byorg.enhydra.barracuda.core.comp.BLink
All Implemented Interfaces:
BContainer, StateMap

public class BLink
extends BAction

BLink is used to manipulate any element in a DOM template that is capable of generating a URL request. In the case of HTML, this would typically include <a>, <input>, and <button> elements.

In most cases you will not actually need to bind the component to a view in order to use it--if you return it from a model, this will be done for you automatically. If however, you intend to use the component standalone (ie. manually attaching it to a specific node in the DOM) or inline (ie. in a toString()), then you MUST BIND IT TO A VIEW before rendering, or an error will be generated.

Because BLink may often be used for inling, it includes constructors that conveniently allow you to specify the a ViewContext (ie. instead of an actual View)


Field Summary
protected  boolean allowMarkupInText
           
protected static org.apache.log4j.Logger logger
           
protected  String target
           
protected  String text
           
 
Fields inherited from class org.enhydra.barracuda.core.comp.BAction
actionEvent, actionUrl, disableBackButton, disableFormLocking, listeners, params, scriptFunctions
 
Fields inherited from class org.enhydra.barracuda.core.comp.BComponent
attrs, enabled, name, rs, VISIBILITY_MARKER, visible
 
Fields inherited from class org.enhydra.barracuda.core.comp.AbstractBComponent
children, dvc, isStepChild, parent, statemap, stepChildren, tempViews, validated, views
 
Constructor Summary
BLink()
          Public noargs constructor
BLink(String itext)
          Public constructor which creates the component and sets the text, and target values.
BLink(String itext, ControlEvent iactionEvent)
          Public constructor which creates the component and sets the text and action values.
BLink(String itext, ControlEvent iactionEvent, ViewContext idvc)
          Public constructor which creates the component and sets the text and action values.
BLink(String itext, String iactionUrl)
          Public constructor which creates the component and sets the text and action values.
BLink(String itext, String iactionUrl, ViewContext idvc)
          Public constructor which creates the component and sets the text and action values.
 
Method Summary
 boolean allowMarkupInText()
          See if we allow markup in the text
 String getTarget()
          Get the target for this particular component
 String getText()
          Get the text for this particular component
 void setAllowMarkupInText(boolean val)
          Do we wish to allow markup in this text (defaults to false)
 void setTarget(String itarget)
          Set the target for this particular component
 void setText(String itext)
          Set the text for this particular component
 
Methods inherited from class org.enhydra.barracuda.core.comp.BAction
addEventListener, addScriptFunction, getAction, getAction, getDisableBackButton, getDisableFormLocking, getParams, getScriptFunctions, hasAction, removeEventListener, setAction, setAction, setDisableBackButton, setDisableFormLocking, setParam, setParam
 
Methods inherited from class org.enhydra.barracuda.core.comp.BComponent
addView, getAttr, getAttrMap, getFirstView, getName, getRenderStrategy, getViews, isEnabled, isVisible, postRender, preRender, removeAllViews, removeView, render, render, renderView, renderView, setAttr, setEnabled, setEnabled, setName, setRenderStrategy, setView, setVisible, setVisible, supports
 
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

logger

protected static final org.apache.log4j.Logger logger

text

protected String text

target

protected String target

allowMarkupInText

protected boolean allowMarkupInText
Constructor Detail

BLink

public BLink()
Public noargs constructor


BLink

public BLink(String itext)
Public constructor which creates the component and sets the text, and target values. This link will fire the default action event (unless you manually specify an action).

Parameters:
itext - the text string that backs this component

BLink

public BLink(String itext,
             String iactionUrl)
Public constructor which creates the component and sets the text and action values.

Parameters:
itext - the text string that backs this component
iactionUrl - the action url to be fired (opt--if null, the default action specified in the template will be fired)

BLink

public BLink(String itext,
             String iactionUrl,
             ViewContext idvc)
Public constructor which creates the component and sets the text and action values. This constructor takes a ViewContext object which will be used to create a default view for the component (ie. use this constructor for inling a BLink)

Parameters:
itext - the text string that backs this component
iactionUrl - the action url to be fired (opt--if null, the default action specified in the template will be fired)
idvc - the default ViewContext (opt--its presence allows the component to be rendered as markup in toString())

BLink

public BLink(String itext,
             ControlEvent iactionEvent)
Public constructor which creates the component and sets the text and action values.

Parameters:
itext - the text string that backs this component
iactionEvent - the action event to be fired (opt--if null, the default ActionEvent will be fired)

BLink

public BLink(String itext,
             ControlEvent iactionEvent,
             ViewContext idvc)
Public constructor which creates the component and sets the text and action values. This constructor takes a ViewContext object which will be used to create a default view for the component (ie. use this constructor for inling a BLink)

Parameters:
itext - the text string that backs this component
iactionEvent - the action event to be fired (opt--if null, the default ActionEvent will be fired)
idvc - the default ViewContext (opt--its presence allows the component to be rendered as markup in toString())
Method Detail

setText

public void setText(String itext)
Set the text for this particular component

Parameters:
itext - the text representation of this component

getText

public String getText()
Get the text for this particular component

Returns:
the text for this particular component

setTarget

public void setTarget(String itarget)
Set the target for this particular component

Parameters:
itarget - the ext representation of the target

getTarget

public String getTarget()
Get the target for this particular component

Returns:
the target for this particular component

setAllowMarkupInText

public void setAllowMarkupInText(boolean val)
Do we wish to allow markup in this text (defaults to false)

Parameters:
val - true if we wish to allow markup in the text

allowMarkupInText

public boolean allowMarkupInText()
See if we allow markup in the text

Returns:
true if we wish to allow markup in the text


Copyright © 2003 BarracudaMVC.org All Rights Reserved.