nextapp.echo.filetransfer
Class UploadSelect

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by nextapp.echo.filetransfer.UploadSelect
All Implemented Interfaces:
java.io.Serializable, Component

public class UploadSelect
extends AbstractComponent

A component that allows users to upload files to the application from remote clients.

See Also:
Serialized Form

Field Summary
static java.lang.String ACTIVE_CHANGED_PROPERTY
           
static java.lang.String DISABLED_SEND_TEXT_CHANGED_PROPERTY
           
static java.lang.String DISPLAY_SEND_CHANGED_PROPERTY
           
static java.lang.String ENABLED_SEND_TEXT_CHANGED_PROPERTY
           
static int ERROR_SIZELIMIT_EXCEEDED
           
static int ERROR_UNKNOWN_REASON
           
static java.lang.String HEIGHT_CHANGED_PROPERTY
           
static java.lang.String WIDTH_CHANGED_PROPERTY
           
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
UploadSelect()
          Creates an upload selector.
 
Method Summary
 void addUploadListener(UploadListener l)
          Adds an UploadListener to be notified of file uploads.
 void fileUpload(java.io.InputStream in, int size, java.lang.String contentType, java.lang.String filename)
          Notifies the upload listener that a file has been uploaded.
 java.lang.String getDisabledSendButtonText()
          Returns text displayed in "Send" button when it is disabled.
 java.lang.String getEnabledSendButtonText()
          Returns text displayed in "Send" button when it is enabled.
 int getHeight()
          Returns the height of the upload select component.
 UploadListener getUploadListener()
          Returns the upload listener that will process file uploads when they occur.
 int getWidth()
          Returns the width of the upload select component.
 boolean isActive()
          Returns whether the file upload field is active.
 boolean isRequired()
           
 boolean isSendButtonDisplayed()
          Returns whether the "Send" button should be displayed.
 boolean isShowFullPath()
           
 void removeUploadListener(UploadListener l)
          Removes a (the) UploadListener from this UploadSelect.
 void setActive(boolean newValue)
          Sets whether the file upload field is active.
 void setDisabledSendButtonText(java.lang.String string)
          Sets the text displayed in the "Send" button when it is disabled.
 void setEnabledSendButtonText(java.lang.String string)
          Sets the text displayed in the "Send" button when it is enabled.
 void setHeight(int newValue)
          Sets the height of the upload select component.
 void setRequired(boolean required)
           
 void setSendButtonDisplayed(boolean b)
          Sets whether the "Send" button should be displayed when the component is rendered.
 void setShowFullPath(boolean showFullPath)
           
 void setUploadListener(UploadListener newValue)
          Sets the upload listener that will process file uploads when they occur.
 void setWidth(int newValue)
          Sets the width of the upload select component.
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setClientId, setEnabled, setFocused, setFont, setForeground, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED_SEND_TEXT_CHANGED_PROPERTY

public static final java.lang.String ENABLED_SEND_TEXT_CHANGED_PROPERTY
See Also:
Constant Field Values

DISABLED_SEND_TEXT_CHANGED_PROPERTY

public static final java.lang.String DISABLED_SEND_TEXT_CHANGED_PROPERTY
See Also:
Constant Field Values

DISPLAY_SEND_CHANGED_PROPERTY

public static final java.lang.String DISPLAY_SEND_CHANGED_PROPERTY
See Also:
Constant Field Values

ACTIVE_CHANGED_PROPERTY

public static final java.lang.String ACTIVE_CHANGED_PROPERTY
See Also:
Constant Field Values

HEIGHT_CHANGED_PROPERTY

public static final java.lang.String HEIGHT_CHANGED_PROPERTY
See Also:
Constant Field Values

WIDTH_CHANGED_PROPERTY

public static final java.lang.String WIDTH_CHANGED_PROPERTY
See Also:
Constant Field Values

ERROR_SIZELIMIT_EXCEEDED

public static final int ERROR_SIZELIMIT_EXCEEDED
See Also:
Constant Field Values

ERROR_UNKNOWN_REASON

public static final int ERROR_UNKNOWN_REASON
See Also:
Constant Field Values
Constructor Detail

UploadSelect

public UploadSelect()
Creates an upload selector.

Method Detail

addUploadListener

public void addUploadListener(UploadListener l)
                       throws java.util.TooManyListenersException
Adds an UploadListener to be notified of file uploads. This listener is unicast, only one may be added.

Parameters:
l - The listener to add.
Throws:
java.util.TooManyListenersException

fileUpload

public void fileUpload(java.io.InputStream in,
                       int size,
                       java.lang.String contentType,
                       java.lang.String filename)
Notifies the upload listener that a file has been uploaded.

Parameters:
in - The inputstream containing the file.
size - The length of the input stream.
contentType - The content type of the uploaded file.
filename - The name of the file, as specified by the client uploading it.

getHeight

public int getHeight()
Returns the height of the upload select component.

Returns:
the height of the upload select component.

getDisabledSendButtonText

public java.lang.String getDisabledSendButtonText()
Returns text displayed in "Send" button when it is disabled.

Returns:
The text displayed in "Send" button when it is disabled.

getEnabledSendButtonText

public java.lang.String getEnabledSendButtonText()
Returns text displayed in "Send" button when it is enabled.

Returns:
The text displayed in "Send" button when it is enabled.

getUploadListener

public UploadListener getUploadListener()
Returns the upload listener that will process file uploads when they occur.

Returns:
The upload listener that will process file uploads when they occur.

getWidth

public int getWidth()
Returns the width of the upload select component.

Returns:
the width of the upload select component.

isActive

public boolean isActive()
Returns whether the file upload field is active.

Returns:
True if the file upload field is active.

removeUploadListener

public void removeUploadListener(UploadListener l)
Removes a (the) UploadListener from this UploadSelect.

Parameters:
l - The listener to remove.

setActive

public void setActive(boolean newValue)
Sets whether the file upload field is active. Only active upload fields will allow uploads.

Parameters:
newValue - The new active state.

setHeight

public void setHeight(int newValue)
Sets the height of the upload select component.

Parameters:
newValue - The new height value.

setUploadListener

public void setUploadListener(UploadListener newValue)
Sets the upload listener that will process file uploads when they occur.

Parameters:
newValue - The UploadListener that will process file uploads.

setWidth

public void setWidth(int newValue)
Sets the width of the upload select component.

Parameters:
newValue - The new width value.

setDisabledSendButtonText

public void setDisabledSendButtonText(java.lang.String string)
Sets the text displayed in the "Send" button when it is disabled.

Parameters:
string - text for the disabled button

setEnabledSendButtonText

public void setEnabledSendButtonText(java.lang.String string)
Sets the text displayed in the "Send" button when it is enabled.

Parameters:
string - text for the enabled button

isSendButtonDisplayed

public boolean isSendButtonDisplayed()
Returns whether the "Send" button should be displayed. By default, the button is displayed for the benefit of View environments (such as certain Web browsers) that do not support the automatic upload of a file once selected.

Returns:
true if the button will be displayed when the component is rendered

setSendButtonDisplayed

public void setSendButtonDisplayed(boolean b)
Sets whether the "Send" button should be displayed when the component is rendered. This is a hint to the component's user interface peer and may be ignored. Peers that know the button is necessary because of limitations of the View environment (for example, on some Web browsers) should ignore this hint.

Parameters:
b - hint that the "Send" button should or should not be displayed

isShowFullPath

public boolean isShowFullPath()

setShowFullPath

public void setShowFullPath(boolean showFullPath)

isRequired

public boolean isRequired()

setRequired

public void setRequired(boolean required)