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
ConstructorDescriptionCmsSingleFileUploadHandler
(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.void
initializeFileInput
(CmsFileInput fileInput) Custom setup method for newly created file inputs.void
onChange
(CmsFileInput fileInput) Notifies the button handler that the file input field's value has changed.void
setButton
(I_CmsUploadButton button) This method should be called when the handler is set on a button.void
setCloseHandler
(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> closeHandler) Sets the dialog close handler.void
setTargetFileName
(String fileName) Sets the target file name.void
setTargetFileNamePrefix
(String targetFileNamePrefix) Sets the target file name prefix.void
setTargetFolderPath
(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_CmsUploadButtonHandler
Custom setup method for newly created file inputs.- Specified by:
initializeFileInput
in interfaceI_CmsUploadButtonHandler
- Parameters:
fileInput
- the new file input- See Also:
-
onChange
Description copied from interface:I_CmsUploadButtonHandler
Notifies the button handler that the file input field's value has changed.- Specified by:
onChange
in interfaceI_CmsUploadButtonHandler
- Parameters:
fileInput
- the file input- See Also:
-
setButton
Description copied from interface:I_CmsUploadButtonHandler
This method should be called when the handler is set on a button.- Specified by:
setButton
in 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
-