org.olat.core.gui.components.download
Class DownloadComponent

java.lang.Object
  extended by org.olat.core.gui.components.Component
      extended by org.olat.core.gui.components.download.DownloadComponent

public class DownloadComponent
extends Component

Description:
The download component displays a link which when pressed triggers a file download in a new window.

Initial Date: 09.12.2009

Author:
gnaegi

Constructor Summary
DownloadComponent(java.lang.String name, VFSLeaf downloadItem)
          Constructor to create a download component that will use the file name as display text and the appropriate file icon
DownloadComponent(java.lang.String name, VFSLeaf downloadItem, java.lang.String linkText, java.lang.String linkToolTip, java.lang.String linkCssIconClass)
          Detailed constructor
 
Method Summary
 ComponentRenderer getHTMLRendererSingleton()
           
 java.lang.String getLinkCssIconClass()
           
 java.lang.String getLinkText()
           
 java.lang.String getLinkToolTip()
           
 void setDownloadItem(VFSLeaf downloadItem)
           
 void setLinkCssIconClass(java.lang.String linkCssIconClass)
           
 void setLinkText(java.lang.String linkText)
           
 void setLinkToolTip(java.lang.String linkToolTip)
           
 
Methods inherited from class org.olat.core.gui.components.Component
addListener, debuginfoGetListeners, dispatchRequest, getAndClearLatestFiredEvent, getComponentName, getDispatchID, getExtendedDebugInfo, getLatestDispatchedController, getListenerInfo, getParent, getSpanAsDomReplaceable, getTimestamp, getTranslator, isDirty, isDirtyForUser, isDomReplaceable, isEnabled, isVisible, setDirty, setDomReplaceable, setEnabled, setSpanAsDomReplaceable, setVisible, toString, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DownloadComponent

public DownloadComponent(java.lang.String name,
                         VFSLeaf downloadItem)
Constructor to create a download component that will use the file name as display text and the appropriate file icon

Parameters:
name -
downloadItem -

DownloadComponent

public DownloadComponent(java.lang.String name,
                         VFSLeaf downloadItem,
                         java.lang.String linkText,
                         java.lang.String linkToolTip,
                         java.lang.String linkCssIconClass)
Detailed constructor

Parameters:
name - The component name
downloadFile - The VFS item to be downloaded
linkText - an optional link text
linkToolTip - an optional tool tip (hover text over link)
linkCssIconClass - an optional css icon class. Note that b_with_small_icon_left will be added when this argument is used. Use the render argument when you want to provide additional CSS classes.
Method Detail

setDownloadItem

public void setDownloadItem(VFSLeaf downloadItem)
Parameters:
downloadItem - the VFS item to download

getLinkText

public java.lang.String getLinkText()
Returns:
The optional link text or NULL to only display an icon

setLinkText

public void setLinkText(java.lang.String linkText)
Parameters:
linkText -

getLinkToolTip

public java.lang.String getLinkToolTip()
Returns:
The optional link tooltip or NULL if not available

setLinkToolTip

public void setLinkToolTip(java.lang.String linkToolTip)
Parameters:
linkToolTip - The optional link tooltip or NULL if not available

getLinkCssIconClass

public java.lang.String getLinkCssIconClass()
Returns:
The link icon css class or NULL if no css should be used

setLinkCssIconClass

public void setLinkCssIconClass(java.lang.String linkCssIconClass)
Parameters:
linkCssIconClass - The link icon css class or NULL if no css should be used. Note that b_with_small_icon_left will be added when this argument is used. Use the render argument when you want to provide additional CSS classes.

getHTMLRendererSingleton

public ComponentRenderer getHTMLRendererSingleton()
Specified by:
getHTMLRendererSingleton in class Component
See Also:
Component.getHTMLRendererSingleton()