Package org.opencms.ui.client
Class CmsSingleFileUploadHandler
java.lang.Object
org.opencms.ui.client.CmsSingleFileUploadHandler
- All Implemented Interfaces:
I_CmsUploadButtonHandler
Handles single file uploads. Allows to specify the target file name.
-
Constructor Summary
ConstructorsConstructorDescriptionCmsSingleFileUploadHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, String dialogTitle) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetFileName(String originalFileName) Returns the new file name.Returns the targetFolderPath.voidinitializeFileInput(CmsFileInput fileInput) Custom setup method for newly created file inputs.voidonChange(CmsFileInput fileInput) Notifies the button handler that the file input field's value has changed.voidsetButton(I_CmsUploadButton button) This method should be called when the handler is set on a button.voidsetCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> closeHandler) Sets the dialog close handler.voidsetTargetFileName(String fileName) Sets the target file name.voidsetTargetFileNamePrefix(String targetFileNamePrefix) Sets the target file name prefix.voidsetTargetFolderPath(String folderPath) Sets the target folder path.
-
Constructor Details
-
CmsSingleFileUploadHandler
public CmsSingleFileUploadHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, String dialogTitle) Constructor.- Parameters:
contextFactory- the upload context factorydialogTitle- the dialog title
-
-
Method Details
-
getFileName
Returns the new file name.- Parameters:
originalFileName- the original file name- Returns:
- the new file name
-
getTargetFolderPath
Returns the targetFolderPath.- Returns:
- the targetFolderPath
-
initializeFileInput
Description copied from interface:I_CmsUploadButtonHandlerCustom setup method for newly created file inputs.- Specified by:
initializeFileInputin interfaceI_CmsUploadButtonHandler- Parameters:
fileInput- the new file input- See Also:
-
onChange
Description copied from interface:I_CmsUploadButtonHandlerNotifies the button handler that the file input field's value has changed.- Specified by:
onChangein interfaceI_CmsUploadButtonHandler- Parameters:
fileInput- the file input- See Also:
-
setButton
Description copied from interface:I_CmsUploadButtonHandlerThis method should be called when the handler is set on a button.- Specified by:
setButtonin interfaceI_CmsUploadButtonHandler- Parameters:
button- the button for which the handler instance has been set- See Also:
-
setTargetFileName
Sets the target file name.- Parameters:
fileName- the target file name
-
setTargetFileNamePrefix
Sets the target file name prefix.- Parameters:
targetFileNamePrefix- the target file name prefix to set
-
setTargetFolderPath
Sets the target folder path.- Parameters:
folderPath- the target folder path
-