EchoPoint API - 3.0.0b5
App Webcontainer

echopoint.tucana
Class DownloadCommand

java.lang.Object
  extended by echopoint.tucana.DownloadCommand
All Implemented Interfaces:
Serializable, Command, RenderIdSupport

public class DownloadCommand
extends Object
implements Command, RenderIdSupport, Serializable

A command used to enqueue a file (or similar) to the client for downlaoding from the server.

The following code shows the simplest form of using this command:

   import java.io.File;
   import echopoint.tucana.DownloadButton

     ...
     final File file = new File( "/tmp/test.txt" );
     final DownloadButton button = new DownloadButton( file );
     button.setText( "Download file" );
     button.setStyleName( "mystyle" );
     parent.add( button );
 

Version:
$Id: DownloadCommand.java 100 2008-11-12 19:17:24Z sptrakesh $
Author:
Echo File Transfer Library, Rakesh 2008-11-10
See Also:
DownloadButton, Serialized Form

Constructor Summary
DownloadCommand()
          Constructs a new download command.
DownloadCommand(DownloadProvider provider)
          Constructs a new download command, whose data will be taken from the passed DownloadProvider.
 
Method Summary
 DownloadCallback getCallback()
          Accessor for property 'callback'.
 DownloadProvider getProvider()
          Returns the download provider.
 String getRenderId()
          Returns the render id.
protected  void notifyCallback(DownloadEvent event)
          Notify the download progress callback handler of updates to the download process.
 void setCallback(DownloadCallback callback)
          Mutator for property 'callback'.
 void setProvider(DownloadProvider newValue)
          Sets the download provider from which to get the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DownloadCommand

public DownloadCommand()
Constructs a new download command.


DownloadCommand

public DownloadCommand(DownloadProvider provider)
Constructs a new download command, whose data will be taken from the passed DownloadProvider.

Parameters:
provider - the provider from which to get the data.
Method Detail

getProvider

public DownloadProvider getProvider()
Returns the download provider.

Returns:
the download provider.

setProvider

public void setProvider(DownloadProvider newValue)
Sets the download provider from which to get the data.

Parameters:
newValue - the download provider from which to get the data.

getRenderId

public String getRenderId()
Returns the render id.

Specified by:
getRenderId in interface RenderIdSupport
Returns:
the render id.

getCallback

public DownloadCallback getCallback()
Accessor for property 'callback'.

Returns:
Value for property 'callback'.

setCallback

public void setCallback(DownloadCallback callback)
Mutator for property 'callback'.

Parameters:
callback - Value to set for property 'callback'.

notifyCallback

protected void notifyCallback(DownloadEvent event)
Notify the download progress callback handler of updates to the download process.

Parameters:
event - The progress event.

EchoPoint API - 3.0.0b5
App Webcontainer