|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.FormSection
com.arsdigita.cms.ui.FileUploadSection
A form section with two widgets: a mime-type selection widget and a file upload widget. The section will attempt to automatically guess the mime type from the filename (if necessary), and return the mime type.
Field Summary | |
static String |
FILE_UPLOAD
The file upload widget |
static String |
GUESS_MIME
Automatically guess the mime type |
static String |
MIME_TYPE
The mime type widget |
static String |
versionId
|
Fields inherited from class com.arsdigita.bebop.FormSection |
m_formModel, m_panel |
Fields inherited from class com.arsdigita.bebop.SimpleComponent |
m_attr |
Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Constructor Summary | |
FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel,
String mimePrefix,
String defaultMimeType)
Construct a new FileUploadSection |
|
FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel,
String mimePrefix,
String defaultMimeType,
com.arsdigita.bebop.Container panel)
Construct a new FileUploadSection |
|
FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel,
String mimePrefix,
String defaultMimeType,
String parameterPrefix)
Construct a new FileUploadSection |
|
FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel,
String mimePrefix,
String defaultMimeType,
String parameterPrefix,
com.arsdigita.bebop.Container panel)
Construct a new FileUploadSection |
|
FileUploadSection(String mimeLabel,
String mimePrefix,
String defaultMimeType)
Deprecated. use the same constructor but with the GlobalizedMessage for the mimeLabel |
|
FileUploadSection(String mimeLabel,
String mimePrefix,
String defaultMimeType,
com.arsdigita.bebop.Container panel)
Deprecated. use the same constructor but with the GlobalizedMessage for the mimeLabel |
|
FileUploadSection(String mimeLabel,
String mimePrefix,
String defaultMimeType,
String parameterPrefix)
Deprecated. use the same constructor but with the GlobalizedMessage for the mimeLabel |
|
FileUploadSection(String mimeLabel,
String mimePrefix,
String defaultMimeType,
String parameterPrefix,
com.arsdigita.bebop.Container panel)
Deprecated. use the same constructor but with the GlobalizedMessage for the mimeLabel |
Method Summary | |
static void |
addMimeOptions(com.arsdigita.bebop.form.OptionGroup w,
String mimePrefix)
Add mime-type options to the option group by loading all mime types which match a certain prefix from the database |
File |
getFile(com.arsdigita.bebop.event.FormSectionEvent e)
Obtain a File object from the file upload widget. |
String |
getFileName(com.arsdigita.bebop.event.FormSectionEvent e)
Obtain a filename from the file upload widget. |
com.arsdigita.bebop.form.FileUpload |
getFileUploadWidget()
|
String |
getFileUploadWidgetName()
|
com.arsdigita.mimetypes.MimeType |
getMimeType(com.arsdigita.bebop.event.FormSectionEvent e)
Try to guess the mime type from the filename, and return it. |
com.arsdigita.bebop.form.SingleSelect |
getMimeTypeWidget()
|
String |
getMimeTypeWidgetName()
|
String |
getParameterPrefix()
|
void |
setMimeType(com.arsdigita.bebop.event.FormSectionEvent e,
String mimeType)
Set the value for the mime type widget. |
Methods inherited from class com.arsdigita.bebop.FormSection |
add, add, addCancelListener, addInitListener, addProcessListener, addSubmissionListener, addValidationListener, children, contains, createInitListener, createProcessListener, createSubmissionListener, createValidationListener, fireCancel, fireInit, fireProcess, fireSubmitted, fireValidate, forwardInit, forwardProcess, forwardSubmission, forwardValidation, generateXML, get, getModel, getPanel, indexOf, isEmpty, lock, process, register, removeCancelListener, removeInitListener, removeProcessListener, removeSubmissionListener, removeValidationListener, respond, size |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, register, setAttribute, setClassAttr, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible |
Methods inherited from class com.arsdigita.bebop.Completable |
addCompletionListener, fireCompletionEvent |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.arsdigita.bebop.Component |
getClassAttr, getIdAttr, getKey, getStyleAttr, isVisible, register, setClassAttr, setIdAttr, setKey, setStyleAttr, setVisible |
Methods inherited from interface com.arsdigita.util.Lockable |
isLocked |
Field Detail |
public static final String versionId
public static final String MIME_TYPE
public static final String FILE_UPLOAD
public static final String GUESS_MIME
Constructor Detail |
public FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel, String mimePrefix, String defaultMimeType, com.arsdigita.bebop.Container panel)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failspanel
- The panel that is to be used to lay out the
componentspublic FileUploadSection(String mimeLabel, String mimePrefix, String defaultMimeType, com.arsdigita.bebop.Container panel)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failspanel
- The panel that is to be used to lay out the
componentspublic FileUploadSection(String mimeLabel, String mimePrefix, String defaultMimeType, String parameterPrefix, com.arsdigita.bebop.Container panel)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failsparameterPrefix
- Prepended to MIME_TYPE and FILE_UPLOAD for
parameter names so that more than 1 file upload widgets may be
used per formpanel
- The panel that is to be used to lay out the
componentspublic FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel, String mimePrefix, String defaultMimeType, String parameterPrefix, com.arsdigita.bebop.Container panel)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failsparameterPrefix
- Prepended to MIME_TYPE and FILE_UPLOAD for
parameter names so that more than 1 file upload widgets may be
used per formpanel
- The panel that is to be used to lay out the
componentspublic FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel, String mimePrefix, String defaultMimeType, String parameterPrefix)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failsparameterPrefix
- Prepended to MIME_TYPE and FILE_UPLOAD for
parameter names so that more than 1 file upload widgets may be
used per formpublic FileUploadSection(String mimeLabel, String mimePrefix, String defaultMimeType, String parameterPrefix)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failsparameterPrefix
- Prepended to MIME_TYPE and FILE_UPLOAD for
parameter names so that more than 1 file upload widgets may be
used per formpublic FileUploadSection(String mimeLabel, String mimePrefix, String defaultMimeType)
mimeLabel
- The label for the mime type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failspublic FileUploadSection(com.arsdigita.globalization.GlobalizedMessage mimeLabel, String mimePrefix, String defaultMimeType)
mimeLabel
- The GlobalizedMessage for the label for the mime
type widgetmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.defaultMimeType
- The default mime type that should be
assumed if the guessing failsMethod Detail |
public com.arsdigita.mimetypes.MimeType getMimeType(com.arsdigita.bebop.event.FormSectionEvent e)
e
- The form section eventpublic File getFile(com.arsdigita.bebop.event.FormSectionEvent e)
e
- The form section eventpublic String getFileName(com.arsdigita.bebop.event.FormSectionEvent e)
e
- The form section eventpublic void setMimeType(com.arsdigita.bebop.event.FormSectionEvent e, String mimeType)
e
- The form section eventmimeType
- The mime type to set, such as "textr/html" or "img/jpeg"public com.arsdigita.bebop.form.SingleSelect getMimeTypeWidget()
public com.arsdigita.bebop.form.FileUpload getFileUploadWidget()
public String getParameterPrefix()
public String getFileUploadWidgetName()
public String getMimeTypeWidgetName()
public static void addMimeOptions(com.arsdigita.bebop.form.OptionGroup w, String mimePrefix)
w
- The mime type widget to which options should be addedmimePrefix
- Populate the mime type widget with all
mime types that match the prefix. Some of the possible
prefixes are "text", "image", "binary", etc.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |