org.ultrawork.wtk.mc
Class Link

java.lang.Object
  |
  +--org.ultrawork.wtk.mc.Link
All Implemented Interfaces:
Component

public class Link
extends java.lang.Object
implements Component

A component that renders an Html <a href=...">label</a> link.

It can be associated with a java.util.ResourceBundle to provide i18n.

Version:
0.2
Author:
Nicolas Bonvin

Field Summary
private  java.lang.String bundleName
           
private  java.lang.String href
           
private  java.lang.String key
           
private  java.lang.String label
           
private  java.lang.String page
           
 
Fields inherited from interface org.ultrawork.wtk.mc.Component
LOCALE_KEY
 
Constructor Summary
Link(java.lang.String label)
           
Link(java.lang.String key, java.lang.String bundleName)
           
 
Method Summary
protected  java.lang.String computeLabel(javax.servlet.http.HttpSession session)
           
protected  java.lang.String computeUrl(javax.servlet.ServletRequest request)
           
protected  java.lang.String createHtmlLink(javax.servlet.ServletRequest request, javax.servlet.http.HttpSession session)
           
 java.lang.String getBundleName()
          Gets the bundleName
 java.lang.String getHref()
          Gets the href
 java.lang.String getKey()
          Gets the key
 java.lang.String getLabel()
          Gets the label
 java.lang.String getPage()
          Gets the page
 void setBundleName(java.lang.String bundleName)
          Sets the bundleName
 void setHref(java.lang.String href)
          Sets the href
 void setKey(java.lang.String key)
          Sets the key
 void setLabel(java.lang.String label)
          Sets the label
 void setPage(java.lang.String page)
          Sets the page
 java.lang.String toString()
           
 void write(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Writes the component to the http response.
 void write(javax.servlet.jsp.PageContext pageContext)
          Writes the component to the current page.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

label

private java.lang.String label

key

private java.lang.String key

bundleName

private java.lang.String bundleName

href

private java.lang.String href

page

private java.lang.String page
Constructor Detail

Link

public Link(java.lang.String label)

Link

public Link(java.lang.String key,
            java.lang.String bundleName)
Method Detail

getHref

public java.lang.String getHref()
Gets the href
Returns:
Returns a String

setHref

public void setHref(java.lang.String href)
Sets the href
Parameters:
href - The href to set

getPage

public java.lang.String getPage()
Gets the page
Returns:
Returns a String

setPage

public void setPage(java.lang.String page)
Sets the page
Parameters:
page - The page to set

getLabel

public java.lang.String getLabel()
Gets the label
Returns:
Returns a String

setLabel

public void setLabel(java.lang.String label)
Sets the label
Parameters:
label - The label to set

getKey

public java.lang.String getKey()
Gets the key
Returns:
Returns a String

setKey

public void setKey(java.lang.String key)
Sets the key
Parameters:
key - The key to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

write

public void write(javax.servlet.jsp.PageContext pageContext)
           throws java.io.IOException,
                  javax.servlet.ServletException
Description copied from interface: Component
Writes the component to the current page.
Specified by:
write in interface Component
See Also:
Component.write(PageContext)

write

public void write(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Description copied from interface: Component
Writes the component to the http response.
Specified by:
write in interface Component

computeUrl

protected java.lang.String computeUrl(javax.servlet.ServletRequest request)
                               throws java.net.MalformedURLException

computeLabel

protected java.lang.String computeLabel(javax.servlet.http.HttpSession session)

createHtmlLink

protected java.lang.String createHtmlLink(javax.servlet.ServletRequest request,
                                          javax.servlet.http.HttpSession session)
                                   throws java.net.MalformedURLException

getBundleName

public java.lang.String getBundleName()
Gets the bundleName
Returns:
Returns a String

setBundleName

public void setBundleName(java.lang.String bundleName)
Sets the bundleName
Parameters:
bundleName - The bundleName to set


Copyright 2002 - ultrawork