WUI : API


org.westofj.wui
Class WAnchor

java.lang.Object
  extended byorg.westofj.wui.Widget
      extended byorg.westofj.wui.WAnchor

public class WAnchor
extends Widget

Renders an HTML link. The rendered link is client side, the link URL is rendered into the generated display HTML directly. For an indirect link that makes a call back to the server before redirecting the client to the target URL, use WExternalLinkor WExternalPage.

Version:
$Revision: 1.5 $, $Date: 2004/03/15 23:55:02 $
Author:
bill

Constructor Summary
WAnchor()
          Constructs an anchor widget.
WAnchor(String text)
          Constructs an anchor widget with the specified label.
WAnchor(WDisplayable text)
          Constructs an anchor widget with the specified label.
 
Method Summary
 Color getColor()
          Returns the color of the anchor.
 WFont getFont()
          Returns the font of the anchor.
 Color getLinkColor()
          Returns the link color.
 WDisplayable getText()
          Returns the label of the anchor widget.
 String getUrl()
          Returns the target URL of the anchor.
 boolean isEnabled()
          Returns true if the anchor is enabled, false otherwise.
 void render(WRunner runner, WRenderContext context, PrintWriter out)
          Renders the widget to the display.
 void setColor(Color color)
          Sets the color of the anchor.
 void setEnabled(boolean enabled)
          Enables or disables the anchor.
 void setFont(WFont font)
          Sets the font of the anchor.
 void setLinkColor(Color linkColor)
          Sets the link color.
 void setText(String text)
          Sets the label of the anchor.
 void setText(WDisplayable text)
          Sets the label of the anchor.
 void setUrl(String url)
          Sets the target URL.
 
Methods inherited from class org.westofj.wui.Widget
addChangeListener, getRunner, handleNoParams, handleParams, hasChangeListeners, removeChangeListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WAnchor

public WAnchor()
Constructs an anchor widget.


WAnchor

public WAnchor(String text)
Constructs an anchor widget with the specified label.

Parameters:
text - the label of the anchor.

WAnchor

public WAnchor(WDisplayable text)
Constructs an anchor widget with the specified label.

Parameters:
text - the label of the anchor.
Method Detail

getColor

public Color getColor()
Returns the color of the anchor.

Returns:
Returns the color of the anchor.

getFont

public WFont getFont()
Returns the font of the anchor.

Returns:
Returns the font of the anchor.

getLinkColor

public Color getLinkColor()
Returns the link color.

Returns:
Returns the linkColor.

getText

public WDisplayable getText()
Returns the label of the anchor widget.

Returns:
WDisplayable the label of the anchor widget.

getUrl

public String getUrl()
Returns the target URL of the anchor.

Returns:
String the target URL of the anchor.

isEnabled

public boolean isEnabled()
Returns true if the anchor is enabled, false otherwise.

Returns:
boolean true if the anchor is enabled, false otherwise.

render

public void render(WRunner runner,
                   WRenderContext context,
                   PrintWriter out)
            throws WRenderException
Description copied from class: Widget
Renders the widget to the display.

Specified by:
render in class Widget
Parameters:
runner - the current runner context.
out - the output for the display.
Throws:
WRenderException

setColor

public void setColor(Color color)
Sets the color of the anchor.

Parameters:
color - The color to set.

setEnabled

public void setEnabled(boolean enabled)
Enables or disables the anchor.

Parameters:
enabled - true if the anchor is enabled, false otherwise.

setFont

public void setFont(WFont font)
Sets the font of the anchor.

Parameters:
font - The font to set.

setLinkColor

public void setLinkColor(Color linkColor)
Sets the link color.

Parameters:
linkColor - The linkColor to set.

setText

public void setText(String text)
Sets the label of the anchor.

Parameters:
text - the label of the anchor.

setText

public void setText(WDisplayable text)
Sets the label of the anchor.

Parameters:
text - The label of the anchor.

setUrl

public void setUrl(String url)
Sets the target URL.

Parameters:
url - the new target URL.

Copyright (c) 2003 West of J - All rights reserved.