Package org.opencms.ui.client
Class CmsSingleFileUploadHandler
- java.lang.Object
-
- org.opencms.ui.client.CmsSingleFileUploadHandler
-
- All Implemented Interfaces:
I_CmsUploadButtonHandler
public class CmsSingleFileUploadHandler extends java.lang.Object implements I_CmsUploadButtonHandler
Handles single file uploads. Allows to specify the target file name.
-
-
Constructor Summary
Constructors Constructor Description CmsSingleFileUploadHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, java.lang.String dialogTitle)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getFileName(java.lang.String originalFileName)
Returns the new file name.java.lang.String
getTargetFolderPath()
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(java.lang.String fileName)
Sets the target file name.void
setTargetFileNamePrefix(java.lang.String targetFileNamePrefix)
Sets the target file name prefix.void
setTargetFolderPath(java.lang.String folderPath)
Sets the target folder path.
-
-
-
Constructor Detail
-
CmsSingleFileUploadHandler
public CmsSingleFileUploadHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, java.lang.String dialogTitle)
Constructor.- Parameters:
contextFactory
- the upload context factorydialogTitle
- the dialog title
-
-
Method Detail
-
getFileName
public java.lang.String getFileName(java.lang.String originalFileName)
Returns the new file name.- Parameters:
originalFileName
- the original file name- Returns:
- the new file name
-
getTargetFolderPath
public java.lang.String getTargetFolderPath()
Returns the targetFolderPath.- Returns:
- the targetFolderPath
-
initializeFileInput
public void initializeFileInput(CmsFileInput fileInput)
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:
I_CmsUploadButtonHandler.initializeFileInput(org.opencms.gwt.client.ui.input.upload.CmsFileInput)
-
onChange
public void onChange(CmsFileInput fileInput)
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:
I_CmsUploadButtonHandler.onChange(org.opencms.gwt.client.ui.input.upload.CmsFileInput)
-
setButton
public void setButton(I_CmsUploadButton button)
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:
I_CmsUploadButtonHandler.setButton(org.opencms.gwt.client.ui.input.upload.I_CmsUploadButton)
-
setCloseHandler
public void setCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> closeHandler)
Sets the dialog close handler.- Parameters:
closeHandler
- the close handler
-
setTargetFileName
public void setTargetFileName(java.lang.String fileName)
Sets the target file name.- Parameters:
fileName
- the target file name
-
setTargetFileNamePrefix
public void setTargetFileNamePrefix(java.lang.String targetFileNamePrefix)
Sets the target file name prefix.- Parameters:
targetFileNamePrefix
- the target file name prefix to set
-
setTargetFolderPath
public void setTargetFolderPath(java.lang.String folderPath)
Sets the target folder path.- Parameters:
folderPath
- the target folder path
-
-