com.filenet.wcm.toolkit.server.util.ui
Class WcmAnchor

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.ui.WcmAnchor
Direct Known Subclasses:
WcmIconAnchor, WcmImageAnchor

public class WcmAnchor
extends java.lang.Object

This class is a base implementation of an HTML hyperlink anchor.


Field Summary
protected  boolean disabled
          Indicates the anchor is disabled.
protected  java.lang.String extraAttributes
          Any additional anchor HTML attributes.
protected  boolean hidden
          Indicates the anchor is hidden.
protected  java.lang.String id
          Anchor id.
protected  java.lang.String label
          The anchor label.
protected  WcmString locLabel
          The anchor label in WcmString format.
protected  java.lang.String onClick
          Value of onClick attribute;
protected  java.lang.String onContextMenu
          Value of onContextMenu attribute.
protected  boolean popup
          Indicates a popup anchor.
protected  java.lang.String toolTip
          The anchor tooltip.
protected  WcmURL urlObject
          The anchor WcmURL object.
protected  java.lang.String urlString
          The anchor url string.
protected  int windowHeight
          Window Height
protected  int windowWidth
          Window Width
 
Constructor Summary
protected WcmAnchor()
          Contructs a new WcmAnchor object.
  WcmAnchor(java.lang.String url, java.lang.String label)
          Contructs a new WcmAnchor object.
  WcmAnchor(java.lang.String url, java.lang.String label, java.lang.String id)
          Contructs a new WcmAnchor object.
  WcmAnchor(java.lang.String url, WcmString localizedLabel)
          Contructs a new WcmAnchor object.
  WcmAnchor(java.lang.String url, WcmString localizedLabel, java.util.Locale locale)
          Contructs a new WcmAnchor object.
  WcmAnchor(java.lang.String url, WcmString localizedLabel, java.lang.String id)
          Contructs a new WcmAnchor object.
  WcmAnchor(WcmURL url, java.lang.String label)
          Contructs a new WcmAnchor object.
  WcmAnchor(WcmURL url, WcmString localizedLabel)
          Contructs a new WcmAnchor object.
  WcmAnchor(WcmURL url, WcmString localizedLabel, java.util.Locale locale)
          Contructs a new WcmAnchor object.
 
Method Summary
static WcmAnchor createNonLocalized(java.lang.String url, java.lang.String label)
          Deprecated. Use String based constructor instead.
 java.lang.String getCloseTagHTML()
          Returns the anchor close tag HTML.
 java.lang.String getHTML()
          Generates and returns the WcmAnchor HTML.
 java.lang.String getHTML(java.util.Locale locale)
          Generates and returns the WcmAnchor HTML.
 java.lang.String getHTML(java.lang.String extraAttributes)
          Generates and returns the WcmAnchor HTML.
 java.lang.String getHTML(java.lang.String extraAttributes, java.util.Locale locale)
          Generates and returns the WcmAnchor HTML.
 java.lang.String getId()
          Returns anchor id
 java.lang.String getLabel()
          Returns the anchor label.
 java.lang.String getLabel(java.util.Locale locale)
          Returns the anchor label.
 java.lang.String getOpenTagHTML()
          Returns the anchor open tag HTML.
 java.lang.String getOpenTagHTML(java.lang.String extraAttributes)
          Creates the anchor open tag HTML with the extra HTML attributes and returns the open tag HTML.
 java.lang.String getToolTip()
          Returns the anchor tooltip.
 java.lang.String getURL()
          Returns the WcmAnchor url string.
 int getWindowHeight()
           
 int getWindowWidth()
           
 boolean isDisabled()
          Returns true to indicate a disabled anchor.
 boolean isHidden()
          Returns true to indicate a hidden anchor.
 boolean isPopup()
          Returns true to indicate a pop up anchor.
 void setDisabled(boolean disabled)
          Sets the anchor disabled property.
 void setHidden(boolean hidden)
          Sets the anchor hidden property.
 void setId(java.lang.String id)
          Sets anchor id
 void setNonLocalizedLabel(java.lang.String newLabel)
          Sets label attribute of anchor
 void setOnClick(java.lang.String javaScript)
          Sets onClick attribute of an anchor
 void setOnContextMenu(java.lang.String javaScript)
          Sets onContextMenu attribute of an anchor
 void setPopup(boolean popup)
          Sets the anchor pop up property.
 void setToolTip(java.lang.String toolTip)
          Sets the anchor tooltip.
 void setToolTip(WcmString localizedToolTip)
          Sets the anchor tooltip.
 void setToolTip(WcmString localizedToolTip, java.util.Locale locale)
          Sets the anchor tooltip.
 void setURL(java.lang.String url)
          Set the URL to a new value.
 void setURL(WcmURL wcmUrl)
          Set the URL to a new value.
 void setWindowHeight(int windowHeight)
           
 void setWindowWidth(int windowWidth)
           
 java.lang.String toString()
          Returns the anchor label and url string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

urlObject

protected WcmURL urlObject
The anchor WcmURL object. The WcmURL object contains the anchor url string. Either the urlString is set or the urlObject is set.


urlString

protected java.lang.String urlString
The anchor url string. Either the urlString is set or the urlObject is set.


label

protected java.lang.String label
The anchor label. The label should already be localized since it was converted from a WcmString object.


locLabel

protected WcmString locLabel
The anchor label in WcmString format.


toolTip

protected java.lang.String toolTip
The anchor tooltip. The tooltip should already be localized since it was converted from a WcmString object.


extraAttributes

protected java.lang.String extraAttributes
Any additional anchor HTML attributes.


popup

protected boolean popup
Indicates a popup anchor. A new window is opened when the user clicks on the anchor link.


disabled

protected boolean disabled
Indicates the anchor is disabled.


hidden

protected boolean hidden
Indicates the anchor is hidden.


id

protected java.lang.String id
Anchor id.


onContextMenu

protected java.lang.String onContextMenu
Value of onContextMenu attribute.


onClick

protected java.lang.String onClick
Value of onClick attribute;


windowHeight

protected int windowHeight
Window Height


windowWidth

protected int windowWidth
Window Width

Constructor Detail

WcmAnchor

protected WcmAnchor()
Contructs a new WcmAnchor object. This default constructor has no implementation. It allows subclasses to define their own constructors.


WcmAnchor

public WcmAnchor(java.lang.String url,
                 WcmString localizedLabel)
Contructs a new WcmAnchor object.

Parameters:
url - The url string of the new anchor.
localizedLabel - The localized label of the new anchor.

WcmAnchor

public WcmAnchor(java.lang.String url,
                 WcmString localizedLabel,
                 java.util.Locale locale)
Contructs a new WcmAnchor object.

Parameters:
url - The url string of the new anchor.
localizedLabel - The localized label of the new anchor.
locale - client locale

WcmAnchor

public WcmAnchor(java.lang.String url,
                 WcmString localizedLabel,
                 java.lang.String id)
Contructs a new WcmAnchor object.

Parameters:
url - The url string of the new anchor.
localizedLabel - The localized label of the new anchor.
id - as String

WcmAnchor

public WcmAnchor(WcmURL url,
                 WcmString localizedLabel)
Contructs a new WcmAnchor object.

Parameters:
url - The WcmURL object. The WcmURL object contains the anchor url string.
localizedLabel - The localized label of the new anchor.

WcmAnchor

public WcmAnchor(WcmURL url,
                 WcmString localizedLabel,
                 java.util.Locale locale)
Contructs a new WcmAnchor object.

Parameters:
url - The WcmURL object. The WcmURL object contains the anchor url string.
localizedLabel - The localized label of the new anchor.
locale - client locale

WcmAnchor

public WcmAnchor(WcmURL url,
                 java.lang.String label)
Contructs a new WcmAnchor object.

Parameters:
url - The WcmURL object. The WcmURL object contains the anchor url string.
label - The label of the new anchor.

WcmAnchor

public WcmAnchor(java.lang.String url,
                 java.lang.String label)
Contructs a new WcmAnchor object.

Parameters:
url - The url string of the new anchor.
label - The label of the new anchor.

WcmAnchor

public WcmAnchor(java.lang.String url,
                 java.lang.String label,
                 java.lang.String id)
Contructs a new WcmAnchor object.

Parameters:
url - The url string of the new anchor.
label - The label of the new anchor.
Method Detail

createNonLocalized

public static WcmAnchor createNonLocalized(java.lang.String url,
                                           java.lang.String label)
Deprecated. Use String based constructor instead.

Creates a new non localized WcmAnchor object.

Parameters:
url - The url string of the new anchor.
label - The label of the new anchor.
Returns:
WcmAnchor A new WcmAnchor object.

setURL

public void setURL(java.lang.String url)
Set the URL to a new value.

Parameters:
url -

setURL

public void setURL(WcmURL wcmUrl)
Set the URL to a new value.

Parameters:
wcmUrl -

getURL

public java.lang.String getURL()
Returns the WcmAnchor url string.

Returns:
String The url string of the anchor.

getHTML

public java.lang.String getHTML(java.lang.String extraAttributes,
                                java.util.Locale locale)
Generates and returns the WcmAnchor HTML.

Parameters:
extraAttributes - Any additional anchor HTML attributes. For a disabled anchor, the extra attributes will be added to the <span> tag. Otherwise, it is added to the <a> tag.
Returns:
String The anchor HTML string.

getHTML

public java.lang.String getHTML(java.lang.String extraAttributes)
Generates and returns the WcmAnchor HTML.

Parameters:
extraAttributes - Any additional anchor HTML attributes. For a disabled anchor, the extra attributes will be added to the <span> tag. Otherwise, it is added to the <a> tag.
Returns:
String The anchor HTML string.

getHTML

public java.lang.String getHTML()
Generates and returns the WcmAnchor HTML.

Returns:
String The anchor HTML string.

getHTML

public java.lang.String getHTML(java.util.Locale locale)
Generates and returns the WcmAnchor HTML.

Parameters:
locale - client locale
Returns:
String The anchor HTML string.

getOpenTagHTML

public java.lang.String getOpenTagHTML(java.lang.String extraAttributes)
Creates the anchor open tag HTML with the extra HTML attributes and returns the open tag HTML.

Parameters:
extraAttributes - Any additional anchor HTML attributes. For a disabled anchor, the extra attributes will be added to the <span> tag. Otherwise, it is added to the <a> tag.
Returns:
String The anchor open tag HTML string.

getOpenTagHTML

public java.lang.String getOpenTagHTML()
Returns the anchor open tag HTML.

Returns:
String The anchor open tag HTML string.

getCloseTagHTML

public java.lang.String getCloseTagHTML()
Returns the anchor close tag HTML.

Returns:
String The anchor close tag HTML string.

setOnContextMenu

public void setOnContextMenu(java.lang.String javaScript)
Sets onContextMenu attribute of an anchor

Parameters:
javaScript -

setOnClick

public void setOnClick(java.lang.String javaScript)
Sets onClick attribute of an anchor

Parameters:
javaScript -

getLabel

public java.lang.String getLabel()
Returns the anchor label.

Returns:
String The anchor label.

getLabel

public java.lang.String getLabel(java.util.Locale locale)
Returns the anchor label.

Parameters:
locale - client locale
Returns:
String The anchor label.

setNonLocalizedLabel

public void setNonLocalizedLabel(java.lang.String newLabel)
Sets label attribute of anchor

Parameters:
newLabel -

getToolTip

public java.lang.String getToolTip()
Returns the anchor tooltip.

Returns:
String The anchor tooltip.

setToolTip

public void setToolTip(WcmString localizedToolTip)
Sets the anchor tooltip.

Parameters:
localizedToolTip - The anchor localized tooltip.

setToolTip

public void setToolTip(WcmString localizedToolTip,
                       java.util.Locale locale)
Sets the anchor tooltip.

Parameters:
localizedToolTip - The anchor localized tooltip.
locale - client locale

setToolTip

public void setToolTip(java.lang.String toolTip)
Sets the anchor tooltip.

Parameters:
toolTip - The anchor localized tooltip.

isPopup

public boolean isPopup()
Returns true to indicate a pop up anchor. Othewise returns false.

Returns:
boolean true or false.

setPopup

public void setPopup(boolean popup)
Sets the anchor pop up property.

Parameters:
popup - Set to true to create a pop up anchor.

isHidden

public boolean isHidden()
Returns true to indicate a hidden anchor. Othewise returns false.

Returns:
boolean true or false.

setHidden

public void setHidden(boolean hidden)
Sets the anchor hidden property.

Parameters:
hidden - Set to true to hide the anchor.

isDisabled

public boolean isDisabled()
Returns true to indicate a disabled anchor. Othewise returns false.

Returns:
boolean true or false.

setDisabled

public void setDisabled(boolean disabled)
Sets the anchor disabled property.

Parameters:
disabled - Set to true to disable the anchor.

toString

public java.lang.String toString()
Returns the anchor label and url string.

Returns:
String The label and the url string as "label (url)".

getId

public java.lang.String getId()
Returns anchor id

Returns:
anchor id

setId

public void setId(java.lang.String id)
Sets anchor id

Parameters:
id - anchor id

getWindowHeight

public int getWindowHeight()

setWindowHeight

public void setWindowHeight(int windowHeight)

getWindowWidth

public int getWindowWidth()

setWindowWidth

public void setWindowWidth(int windowWidth)


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.