com.sun.webui.jsf.component
Class Anchor

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.sun.webui.jsf.component.WebuiComponent
              extended by com.sun.webui.jsf.component.Anchor
All Implemented Interfaces:
com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.NamingContainer, javax.faces.component.StateHolder

public class Anchor
extends WebuiComponent
implements com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.NamingContainer

The Anchor component is used to create an XHTML <a> anchor element.

Use the webuijsf:anchor tag to

The value of the id attribute of the rendered anchor element will be the component id, not the component's client id. In order to obtain the DOM node of the anchor element, on the client, the component id must be used and not the component's client id. This means that the component id must be unique in the page and not just unique within the closest NamingContainer.

The anchor component has an attribute called disabled which when set to true will prevent the anchor from being generating a request when it is clicked.

When UIParameter components are specified as children to the anchor component, the renderer processes these children and appends the name and value specified in the UIParameter component as query paramters to the url.


Field Summary
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
Anchor()
          Default constructor.
 
Method Summary
 java.lang.String getAccessKey()
          This attribute assigns an access key to an element.
 java.lang.String getCharset()
          Specifies the character encoding of the target URL/p>
 java.lang.String getCoords()
          Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
          Returns the id of an HTML element suitable to receive the focus.
 java.lang.String getHtmlTemplate()
          Get alternative HTML template to be used by the anchor component.
 javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context, Label label)
          Return a component instance that can be referenced by a Label in order to evaluate the required and valid states of this component.
 java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
          Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute.
 java.lang.String getOnBlur()
          Scripting code executed when this element loses focus.
 java.lang.String getOnClick()
          Scripting code that is executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code executed when a mouse double click occurs over this component.
 java.lang.String getOnFocus()
          Scripting code that is executed when the anchor component receives focus.
 java.lang.String getOnKeyDown()
          Scripting code that is executed when the user presses down on a key while the anchor component has focus.
 java.lang.String getOnKeyPress()
          Scripting code that is executed when the user presses and releases a key while the component has focus.
 java.lang.String getOnKeyUp()
          Scripting code executed when the user releases a key while the component has focus.
 java.lang.String getOnMouseDown()
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
          Deprecated.  
 java.lang.String getRel()
          Specifies the relationship between the current document and the target URL
 java.lang.String getRendererType()
          Return the renderer type for this component.
 java.lang.String getRev()
          Specifies the relationship between the target URL and the current document
 java.lang.String getShape()
          The shape of the hot spot on the screen (for use in client-side image maps).
 java.lang.String getStyle()
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 int getTabIndex()
          Position of this element in the tabbing order of the current document.
 java.lang.String getTarget()
          The resource at the specified URL is displayed in the frame that is specified with the target attribute.
 java.lang.Object getText()
           
 java.lang.String getToolTip()
          Sets the value of the title attribute for the HTML element.
 java.lang.String getType()
          The MIME content type of the resource specified by the anchor component.
 java.lang.String getUrl()
          Absolute, relative, or context relative (starting with "/") URL to the resource selected by this anchor.
 java.lang.String getUrlLang()
          The language code of the resource designated by this anchor.
 boolean isDisabled()
          Flag indicating that clicking this component by the user is not currently permitted.
 boolean isVisible()
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setAccessKey(java.lang.String accessKey)
          This attribute assigns an access key to an element.
 void setCharset(java.lang.String charset)
          Specifies the character encoding of the target URL/p>
 void setCoords(java.lang.String coords)
          Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps
 void setDisabled(boolean disabled)
          Flag indicating that clicking this component by the user is not currently permitted.
 void setHtmlTemplate(java.lang.String htmlTemplate)
          Get alternative HTML template to be used by the anchor component.
 void setOnBlur(java.lang.String onBlur)
          Scripting code executed when this element loses focus.
 void setOnClick(java.lang.String onClick)
          Scripting code that is executed when a mouse click occurs over this component.
 void setOnDblClick(java.lang.String onDblClick)
          Scripting code that is executed when a mouse double click occurs over this component.
 void setOnFocus(java.lang.String onFocus)
          Scripting code that is executed when the anchor component receives focus.
 void setOnKeyDown(java.lang.String onKeyDown)
          Scripting code thta is executed when the user presses down on a key while the anchor component has focus.
 void setOnKeyPress(java.lang.String onKeyPress)
          Scripting code that is executed when the user presses and releases a key while the component has focus.
 void setOnKeyUp(java.lang.String onKeyUp)
          Scripting code executed when the user releases a key while the component has focus.
 void setOnMouseDown(java.lang.String onMouseDown)
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 void setOnMouseMove(java.lang.String onMouseMove)
          Scripting code executed when the user moves the mouse pointer while over the component.
 void setOnMouseOut(java.lang.String onMouseOut)
          Scripting code executed when a mouse out movement occurs over this component.
 void setOnMouseOver(java.lang.String onMouseOver)
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 void setOnMouseUp(java.lang.String onMouseUp)
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 void setRel(java.lang.String rel)
          Specifies the relationship between the current document and the target URL
 void setRev(java.lang.String rev)
          Specifies the relationship between the target URL and the current document
 void setShape(java.lang.String shape)
          The shape of the hot spot on the screen (for use in client-side image maps).Used with the coords attribute.
 void setStyle(java.lang.String style)
          CSS style or styles to be applied to the outermost HTML element when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class or classes to be applied to the outermost HTML element when this component is rendered.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order of the current document.
 void setTarget(java.lang.String target)
          The resource at the specified URL is displayed in the frame that is specified with the target attribute.
 void setText(java.lang.Object text)
          The text to be displayed for the anchor element.
 void setToolTip(java.lang.String toolTip)
          Sets the value of the title attribute for the HTML element.
 void setType(java.lang.String type)
          The MIME content type of the resource specified by the anchor component.
 void setUrl(java.lang.String url)
          Absolute, relative, or context relative (starting with "/") URL to the resource selected by this anchor.
 void setUrlLang(java.lang.String urlLang)
          The language code of the resource designated by this anchor.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 
Methods inherited from class com.sun.webui.jsf.component.WebuiComponent
processDecodes, processUpdates, processValidators, setId, setRendered
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, getValueExpression, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding, setValueExpression
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Anchor

public Anchor()
Default constructor.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Specified by:
getFamily in class javax.faces.component.UIComponent

getRendererType

public java.lang.String getRendererType()

Return the renderer type for this component.

Overrides:
getRendererType in class javax.faces.component.UIComponentBase

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order of the current document. Tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getToolTip

public java.lang.String getToolTip()

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.


setToolTip

public void setToolTip(java.lang.String toolTip)

Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.

See Also:
getToolTip()

getShape

public java.lang.String getShape()

The shape of the hot spot on the screen (for use in client-side image maps). Used with the coords attribute.Valid values are: default (entire region); rect (rectangular region); circle (circular region); and poly (polygonal region).


setShape

public void setShape(java.lang.String shape)

The shape of the hot spot on the screen (for use in client-side image maps).Used with the coords attribute. Valid values are: default (entire region); rect (rectangular region); circle (circular region); and poly (polygonal region).

See Also:
getShape()

getRel

public java.lang.String getRel()

Specifies the relationship between the current document and the target URL


setRel

public void setRel(java.lang.String rel)

Specifies the relationship between the current document and the target URL


getRev

public java.lang.String getRev()

Specifies the relationship between the target URL and the current document


setRev

public void setRev(java.lang.String rev)

Specifies the relationship between the target URL and the current document


getCoords

public java.lang.String getCoords()

Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps


setCoords

public void setCoords(java.lang.String coords)

Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps


getType

public java.lang.String getType()

The MIME content type of the resource specified by the anchor component.


setType

public void setType(java.lang.String type)

The MIME content type of the resource specified by the anchor component.

See Also:
getType()

getUrl

public java.lang.String getUrl()

Absolute, relative, or context relative (starting with "/") URL to the resource selected by this anchor. If the url attribute is specified, clicking the anchor sends the browser to the new location. If UIParameter components are specified as child to the anchor component, then the renderer processes these name value pairs of the UIParameter components and appends them as query parameters to the specified url.


setUrl

public void setUrl(java.lang.String url)

Absolute, relative, or context relative (starting with "/") URL to the resource selected by this anchor. If the url attribute is specified, clicking the anchor sends the browser to the new location. If UIParameter components are specified as child to the anchor component, then the renderer processes these name value pairs of the UIParameter components and appends them as query parameters to the specified url.


getUrlLang

public java.lang.String getUrlLang()

The language code of the resource designated by this anchor.


setUrlLang

public void setUrlLang(java.lang.String urlLang)

The language code of the resource designated by this anchor.

See Also:
getUrlLang()

isVisible

public boolean isVisible()

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

getTarget

public java.lang.String getTarget()

The resource at the specified URL is displayed in the frame that is specified with the target attribute. Values such as "_blank" that are valid for the target attribute of a HTML anchor element are also valid for this attribute in this component


setTarget

public void setTarget(java.lang.String target)

The resource at the specified URL is displayed in the frame that is specified with the target attribute. Values such as "_blank" that are valid for the target attribute of a HTML anchor element are also valid for this attribute in this component

See Also:
getTarget()

getText

public java.lang.Object getText()

setText

public void setText(java.lang.Object text)

The text to be displayed for the anchor element.

See Also:
getText()

getLabeledElementId

public java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute. If the ComplexComponent has sub-compoents, and one of the sub-components is the target of a label, if that sub-component is a ComplexComponent, then getLabeledElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

Specified by:
getLabeledElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request
Returns:
An abolute id suitable for the value of an HTML LABEL element's for attribute.

getIndicatorComponent

public javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context,
                                                               Label label)
Return a component instance that can be referenced by a Label in order to evaluate the required and valid states of this component. This implementation returns null. Anchor does not support the required or valid states

Specified by:
getIndicatorComponent in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The current FacesContext instance
label - The Label that labels this component.
Returns:
a UIComponent in order to evaluate the required and valid states.

getFocusElementId

public java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
Returns the id of an HTML element suitable to receive the focus. If the ComplexComponent has sub-compoents, and one of the sub-components is to reveive the focus, if that sub-component is a ComplexComponent, then getFocusElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

This implementations returns the value of getLabeledElementId.

Specified by:
getFocusElementId in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext used for the request

getPrimaryElementID

public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
Deprecated. 

Implement this method so that it returns the DOM ID of the HTML element which should receive focus when the component receives focus, and to which a component label should apply. Usually, this is the first element that accepts input.

Specified by:
getPrimaryElementID in interface com.sun.webui.jsf.component.ComplexComponent
Parameters:
context - The FacesContext for the request
Returns:
The client id, also the JavaScript element id
See Also:
getLabeledElementId(javax.faces.context.FacesContext), getFocusElementId(javax.faces.context.FacesContext)

getOnBlur

public java.lang.String getOnBlur()

Scripting code executed when this element loses focus.


setOnBlur

public void setOnBlur(java.lang.String onBlur)

Scripting code executed when this element loses focus.

See Also:
getOnBlur()

getOnClick

public java.lang.String getOnClick()

Scripting code that is executed when a mouse click occurs over this component. If the component submits the form (by using the action attribute), the script that you use with the onClick attribute should not return from the function. When the action attribute is used, the component handles the return with a script that is appended to the anchor element's onclick property. When you supply an onClick attribute, this return script is appended after your script in the anchor's onclick. You can return from your script to abort the submit process if necessary.


setOnClick

public void setOnClick(java.lang.String onClick)

Scripting code that is executed when a mouse click occurs over this component. If the component submits the form (by using the action attribute), the script that you use with the onClick attribute should not return from the function. When the action attribute is used, the component handles the return with a script that is appended to the anchor element's onclick property. When you supply an onClick attribute, this return script is appended after your script in the anchor's onclick. You can return from your script to abort the submit process if necessary.

See Also:
getOnClick()

getOnDblClick

public java.lang.String getOnDblClick()

Scripting code executed when a mouse double click occurs over this component.


setOnDblClick

public void setOnDblClick(java.lang.String onDblClick)

Scripting code that is executed when a mouse double click occurs over this component.

See Also:
getOnDblClick()

getOnFocus

public java.lang.String getOnFocus()

Scripting code that is executed when the anchor component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.


setOnFocus

public void setOnFocus(java.lang.String onFocus)

Scripting code that is executed when the anchor component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.

See Also:
getOnFocus()

getOnKeyDown

public java.lang.String getOnKeyDown()

Scripting code that is executed when the user presses down on a key while the anchor component has focus.


setOnKeyDown

public void setOnKeyDown(java.lang.String onKeyDown)

Scripting code thta is executed when the user presses down on a key while the anchor component has focus.

See Also:
getOnKeyDown()

getOnKeyPress

public java.lang.String getOnKeyPress()

Scripting code that is executed when the user presses and releases a key while the component has focus.


setOnKeyPress

public void setOnKeyPress(java.lang.String onKeyPress)

Scripting code that is executed when the user presses and releases a key while the component has focus.

See Also:
getOnKeyPress()

getOnKeyUp

public java.lang.String getOnKeyUp()

Scripting code executed when the user releases a key while the component has focus.


setOnKeyUp

public void setOnKeyUp(java.lang.String onKeyUp)

Scripting code executed when the user releases a key while the component has focus.

See Also:
getOnKeyUp()

getOnMouseDown

public java.lang.String getOnMouseDown()

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.


setOnMouseDown

public void setOnMouseDown(java.lang.String onMouseDown)

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseDown()

getOnMouseMove

public java.lang.String getOnMouseMove()

Scripting code executed when the user moves the mouse pointer while over the component.


setOnMouseMove

public void setOnMouseMove(java.lang.String onMouseMove)

Scripting code executed when the user moves the mouse pointer while over the component.

See Also:
getOnMouseMove()

getOnMouseOut

public java.lang.String getOnMouseOut()

Scripting code executed when a mouse out movement occurs over this component.


setOnMouseOut

public void setOnMouseOut(java.lang.String onMouseOut)

Scripting code executed when a mouse out movement occurs over this component.

See Also:
getOnMouseOut()

getOnMouseOver

public java.lang.String getOnMouseOver()

Scripting code executed when the user moves the mouse pointer into the boundary of this component.


setOnMouseOver

public void setOnMouseOver(java.lang.String onMouseOver)

Scripting code executed when the user moves the mouse pointer into the boundary of this component.

See Also:
getOnMouseOver()

getOnMouseUp

public java.lang.String getOnMouseUp()

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.


setOnMouseUp

public void setOnMouseUp(java.lang.String onMouseUp)

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.

See Also:
getOnMouseUp()

getCharset

public java.lang.String getCharset()

Specifies the character encoding of the target URL/p>


setCharset

public void setCharset(java.lang.String charset)

Specifies the character encoding of the target URL/p>


getAccessKey

public java.lang.String getAccessKey()

This attribute assigns an access key to an element. An access key is a single character from the document character set.


setAccessKey

public void setAccessKey(java.lang.String accessKey)

This attribute assigns an access key to an element. An access key is a single character from the document character set.


getStyle

public java.lang.String getStyle()

CSS style or styles to be applied to the outermost HTML element when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style or styles to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class or classes to be applied to the outermost HTML element when this component is rendered.

See Also:
getStyleClass()

getHtmlTemplate

public java.lang.String getHtmlTemplate()
Get alternative HTML template to be used by the anchor component.


setHtmlTemplate

public void setHtmlTemplate(java.lang.String htmlTemplate)
Get alternative HTML template to be used by the anchor component.


isDisabled

public boolean isDisabled()

Flag indicating that clicking this component by the user is not currently permitted.


setDisabled

public void setDisabled(boolean disabled)

Flag indicating that clicking this component by the user is not currently permitted.

See Also:
isDisabled()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIComponentBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIComponentBase


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.