com.plumtree.xpshared.htmlconstructs
Class PTListItem

java.lang.Object
  extended by com.plumtree.xpshared.htmlconstructs.PTListItem
Direct Known Subclasses:
UIListItem

public abstract class PTListItem
extends java.lang.Object

Author:
beng This class generates an HTMLElement that renders an item in a list.

Constructor Summary
PTListItem(HTMLAnchor a)
          Call this method to construct a new PTListItem.
PTListItem(java.lang.String title)
          Call this method to construct a new PTListItem.
PTListItem(java.lang.String title, java.lang.String titleHRef)
          Call this method to construct a new PTListItem.
 
Method Summary
 void AddItemCellsToRow(HTMLTableRow myRow)
          Call this method to add HTMLTableCell objects describing this item to the passed HTMLTableRow.
 void AddProperty(java.lang.String sName, java.lang.String sVal)
          Call this method to add a name/value property pair to this item.
 void AddSubLink(HTMLAnchor a, boolean bNew, boolean bUpdated)
          Call this method to add a sublink to this list item.
 void AllowBreaksInMainCell()
          Call this method to allow line breaks added to the main cell of this item.
 void EnableCheckbox(java.lang.String checkboxName, java.lang.String checkboxValue, java.lang.String checkboxAlt, boolean bSelected)
          Call this method to cause this item to display a checkbox input.
 void EnableSelectionInput(HTMLInputTypes type, java.lang.String inputName, java.lang.String inputValue, java.lang.String inputAlt, boolean bSelected)
          Call this method to cause this item to display a selection input allowing the user to select this item among the list of items.
 java.lang.String GetCellHeight()
           
 HTMLAnchor GetEditAnchor()
           
 HTMLTable GetItemAsTable()
          Call this method to obtain an HTMLTable that will render this list item as it is currently configured.
protected abstract  HTMLElement GetNewIndicator()
           
 HTMLAnchor GetPreviewAnchor()
           
 HTMLInput GetSelectionInput()
           
protected abstract  HTMLElement GetUpdatedIndicator()
           
 void SetAlwaysDrawEditItemCell(boolean b)
          Call this method to force this item to draw the HTMLTableCell in which the edit button is nested whether the edit button is set or not.
 void SetAlwaysDrawItemPreviewCell(boolean b)
          Call this method to force this item to draw the HTMLTableCell in which the preview button is nested whether the preview button is set or not.
 void SetAlwaysDrawItemTypeCell(boolean b)
          Call this method to force this item to draw the HTMLTableCell in which the item type image is nested whether the item type image is set or not.
 void SetAlwaysDrawSelectionInputCell(boolean b)
          Call this method to force this item to draw the HTMLTableCell in which the selection input is nested whether the selection input is set or not.
 void SetApprovalStateImage(PTImageType image, java.lang.String imgAlt)
           
 void SetCellHeight(java.lang.String s)
           
 void SetDescription(java.lang.String s)
          Call this method to set the description for this list item.
 void SetItemEditButton(PTImageType image, java.lang.String imgAlt, java.lang.String editHRef)
          Call this method to set the image/href that allows users to edit this item.
 void SetItemPreviewButton(PTImageType image, java.lang.String imgAlt, java.lang.String previewHRef)
          Call this method to set the image/href that allows users to preview this item.
 void SetItemTypeImage(HTMLImg image)
           
 void SetItemTypeImage(PTImageType image, java.lang.String imgAlt)
          Call this method to set the image that indicates the type of this item.
 void SetMaxNumSubLinksDisplayed(int i)
          Call this method to set the maximum number of sub links displayed with this item.
 void SetNew(boolean b)
          Call this method to toggle the newness of this list item.
 void SetPropertiesLink(HTMLAnchor a)
          Call this method to set the properties link on this list item.
 void SetRowStyleClass(PTStyleClass styleClass)
          Call this method to set the style class for the HTMLTableRow rendering this item.
 void SetTableStyleClass(PTStyleClass s)
           
 void SetTitle(java.lang.String s)
           
 void SetTitle(java.lang.String s, java.lang.String sHref)
           
 void SetTitleStyleClass(PTStyleClass s)
           
 void SetUpdated(boolean b)
          Call this method to toggle the updatedness of this list item.
 void SuppressBreaksInMainCell()
          Call this method to supress line breaks added to the main cell of this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PTListItem

public PTListItem(java.lang.String title,
                  java.lang.String titleHRef)
Call this method to construct a new PTListItem.

Parameters:
title - Pass a String that is the title of this item.
titleHRef - Pass a String that is the href of this title.

PTListItem

public PTListItem(java.lang.String title)
Call this method to construct a new PTListItem.



Use this constructor if you wish for the title of this item to be just a String, as opposed to an anchor.

Parameters:
title - Pass a String that is the title of this item.

PTListItem

public PTListItem(HTMLAnchor a)
Call this method to construct a new PTListItem.

Parameters:
a - Pass the HTMLAnchor that will appear as the title of this item.
Method Detail

GetNewIndicator

protected abstract HTMLElement GetNewIndicator()

GetUpdatedIndicator

protected abstract HTMLElement GetUpdatedIndicator()

GetEditAnchor

public HTMLAnchor GetEditAnchor()

GetPreviewAnchor

public HTMLAnchor GetPreviewAnchor()

SetTitle

public void SetTitle(java.lang.String s)

SetTitle

public void SetTitle(java.lang.String s,
                     java.lang.String sHref)

SuppressBreaksInMainCell

public void SuppressBreaksInMainCell()
Call this method to supress line breaks added to the main cell of this item. A break after the title anchor will still be drawn.


AllowBreaksInMainCell

public void AllowBreaksInMainCell()
Call this method to allow line breaks added to the main cell of this item. This is the default state of a list item, so calling this method is unnecessary unless SuppressBreaksInMainCell has been called previously.


AddItemCellsToRow

public void AddItemCellsToRow(HTMLTableRow myRow)
Call this method to add HTMLTableCell objects describing this item to the passed HTMLTableRow.

Parameters:
myRow - HTMLTableRow
Throws:
HTMLException

AddProperty

public void AddProperty(java.lang.String sName,
                        java.lang.String sVal)
Call this method to add a name/value property pair to this item.

Parameters:
sName - String name
sVal - String value

AddSubLink

public void AddSubLink(HTMLAnchor a,
                       boolean bNew,
                       boolean bUpdated)
Call this method to add a sublink to this list item. Each sublink can be new and/or updated.

Parameters:
a - HTMLAnchor
m_bNew - boolean
m_bUpdated - boolean

EnableCheckbox

public void EnableCheckbox(java.lang.String checkboxName,
                           java.lang.String checkboxValue,
                           java.lang.String checkboxAlt,
                           boolean bSelected)
Call this method to cause this item to display a checkbox input.

Parameters:
checkboxName - Pass a String that is the name of this checkbox.
checkboxValue -
checkboxAlt - Pass a String that is the alt attribute of this checkbox.
bSelected - whether on not this input is checked

EnableSelectionInput

public void EnableSelectionInput(HTMLInputTypes type,
                                 java.lang.String inputName,
                                 java.lang.String inputValue,
                                 java.lang.String inputAlt,
                                 boolean bSelected)
Call this method to cause this item to display a selection input allowing the user to select this item among the list of items.

Parameters:
type - HTMLInputType should be either radio or checkbox.
inputName - String input name
inputValue - String input value
inputAlt - String input alt
bSelected - whether on not this input is checked

GetSelectionInput

public HTMLInput GetSelectionInput()

GetCellHeight

public java.lang.String GetCellHeight()
Returns:

GetItemAsTable

public HTMLTable GetItemAsTable()
Call this method to obtain an HTMLTable that will render this list item as it is currently configured.

Returns:
Throws:
HTMLException

SetAlwaysDrawEditItemCell

public void SetAlwaysDrawEditItemCell(boolean b)
Call this method to force this item to draw the HTMLTableCell in which the edit button is nested whether the edit button is set or not. By default, this cell is not drawn, but if you wish for some items in a table to contain this button while others do not, then this HTMLTableCell should always be drawn.

Parameters:
b - boolean

SetAlwaysDrawItemPreviewCell

public void SetAlwaysDrawItemPreviewCell(boolean b)
Call this method to force this item to draw the HTMLTableCell in which the preview button is nested whether the preview button is set or not. By default, this cell is not drawn, but if you wish for some items in a table to contain this button while others do not, then this HTMLTableCell should always be drawn.

Parameters:
b - boolean

SetAlwaysDrawItemTypeCell

public void SetAlwaysDrawItemTypeCell(boolean b)
Call this method to force this item to draw the HTMLTableCell in which the item type image is nested whether the item type image is set or not. By default, this cell is not drawn, but if you wish for some items in a table to contain this image while others do not, then this HTMLTableCell should always be drawn.

Parameters:
b - boolean

SetAlwaysDrawSelectionInputCell

public void SetAlwaysDrawSelectionInputCell(boolean b)
Call this method to force this item to draw the HTMLTableCell in which the selection input is nested whether the selection input is set or not. By default, this cell is not drawn, but if you wish for some items in a table to contain this input while others do not, then this HTMLTableCell should always be drawn.

Parameters:
b - boolean

SetApprovalStateImage

public void SetApprovalStateImage(PTImageType image,
                                  java.lang.String imgAlt)
Parameters:
image -
imgAlt -

SetCellHeight

public void SetCellHeight(java.lang.String s)
Parameters:
s -

SetDescription

public void SetDescription(java.lang.String s)
Call this method to set the description for this list item.

Parameters:
s - String

SetItemEditButton

public void SetItemEditButton(PTImageType image,
                              java.lang.String imgAlt,
                              java.lang.String editHRef)
Call this method to set the image/href that allows users to edit this item.

Calling this method will cause the generated table to contain one additional column.

Parameters:
image - Pass a PTImageType that contains the edit button image.
imgAlt - Pass a String that is the alt attribute of this image.
editHRef - Pass the HRef that redirect the user to a page allowing this item to be edited. Pass null, and the edit button will be merely and edit image.

SetItemPreviewButton

public void SetItemPreviewButton(PTImageType image,
                                 java.lang.String imgAlt,
                                 java.lang.String previewHRef)
Call this method to set the image/href that allows users to preview this item.

Calling this method will cause the generated table to contain one additional column.

Parameters:
image - Pass a PTImageType that contains the preview button image.
imgAlt - Pass a String that is the alt attribute of this image.
previewHRef - Pass the HRef that redirect the user to a page allowing this item to be pre viewed.

SetItemTypeImage

public void SetItemTypeImage(PTImageType image,
                             java.lang.String imgAlt)
Call this method to set the image that indicates the type of this item.

Calling this method will cause the generated table to contain one additional column.

Parameters:
image - Pass a PTImageType that indicates the image describing this item's type.
imgAlt - Pass a String that is the alt attribute of this image.

SetItemTypeImage

public void SetItemTypeImage(HTMLImg image)
Parameters:
image -

SetMaxNumSubLinksDisplayed

public void SetMaxNumSubLinksDisplayed(int i)
Call this method to set the maximum number of sub links displayed with this item.

Parameters:
i - int

SetNew

public void SetNew(boolean b)
Call this method to toggle the newness of this list item.

Parameters:
b - boolean

SetPropertiesLink

public void SetPropertiesLink(HTMLAnchor a)
Call this method to set the properties link on this list item.

Parameters:
a - HTMLAnchor link

SetRowStyleClass

public void SetRowStyleClass(PTStyleClass styleClass)
Call this method to set the style class for the HTMLTableRow rendering this item.

Parameters:
styleClass - Pass a PTStyleClass.

SetTableStyleClass

public void SetTableStyleClass(PTStyleClass s)
Parameters:
s -

SetTitleStyleClass

public void SetTitleStyleClass(PTStyleClass s)
Parameters:
s -

SetUpdated

public void SetUpdated(boolean b)
Call this method to toggle the updatedness of this list item.

Parameters:
b - boolean



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.