Class CmsReplaceDialog
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.google.gwt.user.client.ui.PopupPanel
-
- org.opencms.gwt.client.ui.CmsPopup
-
- org.opencms.gwt.client.ui.replace.CmsReplaceDialog
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.EventPreview
,com.google.gwt.user.client.ui.AcceptsOneWidget
,com.google.gwt.user.client.ui.HasAnimation
,com.google.gwt.user.client.ui.HasOneWidget
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.HasWidgets
,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
,com.google.gwt.user.client.ui.IsWidget
,com.google.gwt.user.client.ui.SourcesPopupEvents
,java.lang.Iterable<com.google.gwt.user.client.ui.Widget>
,I_CmsAutoHider
,I_CmsUploadDialog
public class CmsReplaceDialog extends CmsPopup implements I_CmsUploadDialog
The replace resource dialog.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opencms.gwt.client.ui.CmsPopup
CmsPopup.HistoryHandler
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.PopupPanel
com.google.gwt.user.client.ui.PopupPanel.AnimationType, com.google.gwt.user.client.ui.PopupPanel.PositionCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsReplaceContentWidget
m_mainPanel
The main content panel.-
Fields inherited from class org.opencms.gwt.client.ui.CmsPopup
DEFAULT_WIDTH, m_closeCommand, m_notificationWidgetInstalled, m_windowWidth, WIDE_WIDTH
-
-
Constructor Summary
Constructors Constructor Description CmsReplaceDialog(CmsReplaceHandler handler)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.gwt.event.shared.HandlerRegistration
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler)
protected void
cancelReplace()
Cancels the replace process.protected void
cancelUpdateProgress()
Cancels the upload progress timer.java.lang.Runnable
getFinishAction()
Returns the action which should be executed when the upload dialog is finished.protected java.lang.String
getResourceType(CmsFileInfo file)
Returns the resource type name for a given filename.protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync
getUploadService()
Returns the upload service instance.protected java.lang.String
getUploadUri()
Returns the upload JSP uri.void
hide()
Hides the widget.protected void
initContent(org.opencms.gwt.shared.CmsReplaceInfo replaceInfo)
Initializes the dialog content with the replace information.protected void
initContent(org.opencms.util.CmsUUID structureId)
Initializes the dialog content.void
parseResponse(java.lang.String results)
Parses the upload response of the server and decides what to do.protected void
setFileInput(CmsFileInput fileInput)
Sets the file input.void
setFinishAction(java.lang.Runnable action)
Sets an action that should be executed if the upload dialog is finished.void
showErrorReport(java.lang.String message, java.lang.String stacktrace)
Shows the error report.protected void
updateProgress()
Retrieves the progress information from the server.protected void
updateProgressBar(org.opencms.gwt.shared.CmsUploadProgessInfo info)
Updates the progress bar.protected void
uploadFile()
Uploads the selected file.-
Methods inherited from class org.opencms.gwt.client.ui.CmsPopup
add, add, addButton, addButton, addDialogClose, adjustIndex, beginDragging, catchNotifications, center, centerHorizontally, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, clear, continueDragging, createDialogNotificationWidget, doAttachChildren, doDetachChildren, endDragging, getAvailableHeight, getCaption, getChildren, getContainerElement, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, getWidth, hasCaption, hide, insert, insert, insertFront, installNotificationWidget, iterator, onBrowserEvent, onDetach, onPreviewNativeEvent, remove, remove, removeAllButtons, removeButton, removePadding, setBackgroundColor, setCaption, setHeight, setHeight, setMainContent, setPixelSize, setPositionFixed, setSize, setSpecialBackgroundClass, setUseAnimation, setWidget, setWidth, setWidth, show, showArrow, wrapWithBorderPadding
-
Methods inherited from class com.google.gwt.user.client.ui.PopupPanel
addAutoHidePartner, addPopupListener, getAnimationType, getGlassElement, getGlassStyleName, getOffsetHeight, getOffsetWidth, getPopupLeft, getPopupTop, getStyleElement, getTitle, isAnimationEnabled, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, isGlassEnabled, isModal, isPreviewingAllNativeEvents, isShowing, isVisible, onEventPreview, onKeyDownPreview, onKeyPressPreview, onKeyUpPreview, onUnload, removeAutoHidePartner, removePopupListener, setAnimationEnabled, setAnimationType, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled, setGlassEnabled, setGlassStyleName, setModal, setPopupPosition, setPopupPositionAndShow, setPreviewingAllNativeEvents, setTitle, setVisible, showRelativeTo
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencms.gwt.client.ui.I_CmsAutoHider
addAutoHidePartner, isAutoHideEnabled, isAutoHideOnHistoryEventsEnabled, removeAutoHidePartner, setAutoHideEnabled, setAutoHideOnHistoryEventsEnabled
-
-
-
-
Field Detail
-
m_mainPanel
protected CmsReplaceContentWidget m_mainPanel
The main content panel.
-
-
Constructor Detail
-
CmsReplaceDialog
public CmsReplaceDialog(CmsReplaceHandler handler)
Constructor.- Parameters:
handler
- the dialog handler
-
-
Method Detail
-
addCloseHandler
public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel> handler)
- Specified by:
addCloseHandler
in interfacecom.google.gwt.event.logical.shared.HasCloseHandlers<com.google.gwt.user.client.ui.PopupPanel>
- Overrides:
addCloseHandler
in classcom.google.gwt.user.client.ui.PopupPanel
- See Also:
PopupPanel.addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler)
-
getFinishAction
public java.lang.Runnable getFinishAction()
Returns the action which should be executed when the upload dialog is finished.- Returns:
- an action to run when the upload dialog is finished
-
hide
public void hide()
Description copied from interface:I_CmsAutoHider
Hides the widget.- Specified by:
hide
in interfaceI_CmsAutoHider
- Overrides:
hide
in classCmsPopup
- See Also:
CmsPopup.hide()
-
parseResponse
public void parseResponse(java.lang.String results)
Parses the upload response of the server and decides what to do.- Specified by:
parseResponse
in interfaceI_CmsUploadDialog
- Parameters:
results
- a JSON Object
-
setFinishAction
public void setFinishAction(java.lang.Runnable action)
Sets an action that should be executed if the upload dialog is finished.- Parameters:
action
- the action to execute when finished
-
showErrorReport
public void showErrorReport(java.lang.String message, java.lang.String stacktrace)
Shows the error report.- Specified by:
showErrorReport
in interfaceI_CmsUploadDialog
- Parameters:
message
- the message to showstacktrace
- the stacktrace to show
-
cancelReplace
protected void cancelReplace()
Cancels the replace process.
-
cancelUpdateProgress
protected void cancelUpdateProgress()
Cancels the upload progress timer.
-
getResourceType
protected java.lang.String getResourceType(CmsFileInfo file)
Returns the resource type name for a given filename.- Parameters:
file
- the file info- Returns:
- the resource type name
-
getUploadService
protected org.opencms.gwt.shared.rpc.I_CmsUploadServiceAsync getUploadService()
Returns the upload service instance.- Returns:
- the upload service instance
-
getUploadUri
protected java.lang.String getUploadUri()
Returns the upload JSP uri.- Returns:
- the upload JSP uri
-
initContent
protected void initContent(org.opencms.gwt.shared.CmsReplaceInfo replaceInfo)
Initializes the dialog content with the replace information.- Parameters:
replaceInfo
- the replace information
-
initContent
protected void initContent(org.opencms.util.CmsUUID structureId)
Initializes the dialog content.- Parameters:
structureId
- the structure id of the file to replace
-
setFileInput
protected void setFileInput(CmsFileInput fileInput)
Sets the file input.- Parameters:
fileInput
- the file input
-
updateProgress
protected void updateProgress()
Retrieves the progress information from the server.
-
updateProgressBar
protected void updateProgressBar(org.opencms.gwt.shared.CmsUploadProgessInfo info)
Updates the progress bar.- Parameters:
info
- the progress info
-
uploadFile
protected void uploadFile()
Uploads the selected file.
-
-