Package org.opencms.ade.upload.client.ui
Class CmsDialogUploadButtonHandler
- java.lang.Object
-
- org.opencms.ade.upload.client.ui.CmsDialogUploadButtonHandler
-
- All Implemented Interfaces:
I_CmsUploadButtonHandler
public class CmsDialogUploadButtonHandler extends java.lang.Object implements I_CmsUploadButtonHandler
Default upload button handler which is used for the upload dialog.
-
-
Constructor Summary
Constructors Constructor Description CmsDialogUploadButtonHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory)
Creates a new upload button handler.CmsDialogUploadButtonHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, java.lang.String targetFolder, boolean isRootPath)
Creates a new upload button handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
openDialogWithFiles(java.util.List<CmsFileInfo> files)
Opens the upload dialog for the given file references.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 close handler for the dialog.void
setIsTargetRootPath(boolean isTargetRootPath)
Chooses whether the target folder should be interpreted as a root path.void
setPostCreateHandler(java.lang.String postCreateHandler)
Sets the post-create handler.void
setTargetFolder(java.lang.String targetFolder)
Sets the upload target folder.void
setUploadDialog(A_CmsUploadDialog uploadDialog)
Sets the upload dialog instance.protected void
updateDialog()
Updates the dialog with the current close handler and target folder.
-
-
-
Constructor Detail
-
CmsDialogUploadButtonHandler
public CmsDialogUploadButtonHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory)
Creates a new upload button handler.- Parameters:
contextFactory
- the context factory to use for upload contexts
-
CmsDialogUploadButtonHandler
public CmsDialogUploadButtonHandler(com.google.common.base.Supplier<I_CmsUploadContext> contextFactory, java.lang.String targetFolder, boolean isRootPath)
Creates a new upload button handler.- Parameters:
contextFactory
- the context factory to use for upload contextstargetFolder
- the target folderisRootPath
- true fi the target folder is a root path
-
-
Method Detail
-
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)
-
openDialogWithFiles
public void openDialogWithFiles(java.util.List<CmsFileInfo> files)
Opens the upload dialog for the given file references.- Parameters:
files
- the file references
-
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 close handler for the dialog.- Parameters:
closeHandler
- the close handler
-
setIsTargetRootPath
public void setIsTargetRootPath(boolean isTargetRootPath)
Chooses whether the target folder should be interpreted as a root path.- Parameters:
isTargetRootPath
- true if the target folder should be treated as a root path
-
setPostCreateHandler
public void setPostCreateHandler(java.lang.String postCreateHandler)
Sets the post-create handler.- Parameters:
postCreateHandler
- the post-create handler
-
setTargetFolder
public void setTargetFolder(java.lang.String targetFolder)
Sets the upload target folder.- Parameters:
targetFolder
- the upload target folder
-
setUploadDialog
public void setUploadDialog(A_CmsUploadDialog uploadDialog)
Sets the upload dialog instance.- Parameters:
uploadDialog
- the upload dialog instance
-
updateDialog
protected void updateDialog()
Updates the dialog with the current close handler and target folder.
-
-