org.cruxframework.crux.widgets.client.dialog
Class ConfirmDialog

java.lang.Object
  extended by org.cruxframework.crux.widgets.client.dialog.ConfirmDialog
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasCloseHandlers<ConfirmDialog>, com.google.gwt.event.logical.shared.HasOpenHandlers<ConfirmDialog>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.IsWidget, HasCancelHandlers, HasOkHandlers

public class ConfirmDialog
extends Object
implements HasOkHandlers, HasCancelHandlers, com.google.gwt.user.client.ui.HasAnimation, com.google.gwt.user.client.ui.IsWidget, com.google.gwt.event.logical.shared.HasCloseHandlers<ConfirmDialog>, com.google.gwt.event.logical.shared.HasOpenHandlers<ConfirmDialog>

A simple confirm dialog box

Author:
Thiago da Rosa de Bustamante

Constructor Summary
ConfirmDialog()
          Constructor
 
Method Summary
 com.google.gwt.event.shared.HandlerRegistration addCancelHandler(CancelHandler handler)
          Adds a handler for the Cancel button click event
 com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<ConfirmDialog> handler)
           
static void addDefaultCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<ConfirmDialog> defaultCloseHandler)
          Add a default close handler that will be appended to each created object
static void addDefaultOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<ConfirmDialog> defaultOpenHandler)
          Add a default open handler that will be appended to each created object
 com.google.gwt.event.shared.HandlerRegistration addOkHandler(OkHandler handler)
          Adds a handler for the OK button click event
 com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<ConfirmDialog> handler)
           
 com.google.gwt.user.client.ui.Widget asWidget()
           
 void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
           
 String getCancelLabel()
           
 String getDialogTitle()
          Get the dialog box title
 String getMessage()
          Gets the message to be displayed to the user
 String getOkLabel()
           
 String getTitle()
           
 void hide()
          Hides the message dialog
 boolean isAnimationEnabled()
           
 void setAnimationEnabled(boolean animationEnabled)
           
 void setCancelLabel(String cancelLabel)
           
 void setDialogTitle(com.google.gwt.safehtml.shared.SafeHtml title)
           
 void setDialogTitle(String title)
          Set the dialog box title
 void setHeight(String height)
           
 void setMessage(com.google.gwt.safehtml.shared.SafeHtml message)
          Sets the message to be displayed to the user
 void setMessage(String message)
          Sets the message to be displayed to the user
 void setOkLabel(String okLabel)
           
 void setStyleName(String styleName)
           
 void setTitle(String title)
           
 void setWidth(String width)
           
 void show()
          Show message dilaog.
static ConfirmDialog show(String title, String message, OkHandler okHandler, CancelHandler cancelHandler)
          Shows a confirm dialog
static ConfirmDialog show(String title, String message, String okLabel, String cancelLabel, OkHandler okHandler, CancelHandler cancelHandler)
          Shows a confirm dialog
static ConfirmDialog show(String dialogTitle, String message, String okLabel, String cancelLabel, OkHandler okHandler, CancelHandler cancelHandler, String styleName, boolean animationEnabled)
          Shows a confirm dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfirmDialog

public ConfirmDialog()
Constructor

Method Detail

getDialogTitle

public String getDialogTitle()
Get the dialog box title

Returns:

setDialogTitle

public void setDialogTitle(com.google.gwt.safehtml.shared.SafeHtml title)

setDialogTitle

public void setDialogTitle(String title)
Set the dialog box title

Parameters:
title -

isAnimationEnabled

public boolean isAnimationEnabled()
Specified by:
isAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation
See Also:
HasAnimation.isAnimationEnabled()

getMessage

public String getMessage()
Gets the message to be displayed to the user

Returns:
the message

setMessage

public void setMessage(com.google.gwt.safehtml.shared.SafeHtml message)
Sets the message to be displayed to the user

Parameters:
message -

setMessage

public void setMessage(String message)
Sets the message to be displayed to the user

Parameters:
message -

asWidget

public com.google.gwt.user.client.ui.Widget asWidget()
Specified by:
asWidget in interface com.google.gwt.user.client.ui.IsWidget

setStyleName

public void setStyleName(String styleName)
Parameters:
styleName -

setWidth

public void setWidth(String width)
Parameters:
width -

setHeight

public void setHeight(String height)
Parameters:
height -

setTitle

public void setTitle(String title)
Parameters:
title -

getTitle

public String getTitle()
Returns:

setAnimationEnabled

public void setAnimationEnabled(boolean animationEnabled)
Specified by:
setAnimationEnabled in interface com.google.gwt.user.client.ui.HasAnimation
See Also:
HasAnimation.setAnimationEnabled(boolean)

addOkHandler

public com.google.gwt.event.shared.HandlerRegistration addOkHandler(OkHandler handler)
Adds a handler for the OK button click event

Specified by:
addOkHandler in interface HasOkHandlers

addCancelHandler

public com.google.gwt.event.shared.HandlerRegistration addCancelHandler(CancelHandler handler)
Adds a handler for the Cancel button click event

Specified by:
addCancelHandler in interface HasCancelHandlers

show

public void show()
Show message dilaog. The dialog is centered and the screen is blocked for edition


hide

public void hide()
Hides the message dialog


setOkLabel

public void setOkLabel(String okLabel)
Parameters:
okLabel -

setCancelLabel

public void setCancelLabel(String cancelLabel)
Parameters:
cancelLabel -

getOkLabel

public String getOkLabel()
Returns:

getCancelLabel

public String getCancelLabel()
Returns:

show

public static ConfirmDialog show(String title,
                                 String message,
                                 OkHandler okHandler,
                                 CancelHandler cancelHandler)
Shows a confirm dialog

Parameters:
title - the text to be displayed as the caption of the message box
message - the text to be displayed in the body of the message box
okHandler - a handler for the OK button click event
cancelHandler - a handler for the Cancel button click event

show

public static ConfirmDialog show(String title,
                                 String message,
                                 String okLabel,
                                 String cancelLabel,
                                 OkHandler okHandler,
                                 CancelHandler cancelHandler)
Shows a confirm dialog

Parameters:
title - the text to be displayed as the caption of the message box
message - the text to be displayed in the body of the message box
okLabel - the text to be displayed in the body of the message box
cancelLabel - the text to be displayed in the body of the message box
okHandler - a handler for the OK button click event
cancelHandler - a handler for the Cancel button click event

show

public static ConfirmDialog show(String dialogTitle,
                                 String message,
                                 String okLabel,
                                 String cancelLabel,
                                 OkHandler okHandler,
                                 CancelHandler cancelHandler,
                                 String styleName,
                                 boolean animationEnabled)
Shows a confirm dialog

Parameters:
title - the text to be displayed as the caption of the message box
message - the text to be displayed in the body of the message box
okLabel - the text to be displayed in the body of the message box
cancelLabel - the text to be displayed in the body of the message box
okHandler - a handler for the OK button click event
cancelHandler - a handler for the Cancel button click event
styleName - the name of the CSS class to be applied in the message box element
animationEnabled - true to enable animations while showing or hiding the message box

fireEvent

public void fireEvent(com.google.gwt.event.shared.GwtEvent<?> event)
Specified by:
fireEvent in interface com.google.gwt.event.shared.HasHandlers

addCloseHandler

public com.google.gwt.event.shared.HandlerRegistration addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<ConfirmDialog> handler)
Specified by:
addCloseHandler in interface com.google.gwt.event.logical.shared.HasCloseHandlers<ConfirmDialog>

addOpenHandler

public com.google.gwt.event.shared.HandlerRegistration addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<ConfirmDialog> handler)
Specified by:
addOpenHandler in interface com.google.gwt.event.logical.shared.HasOpenHandlers<ConfirmDialog>

addDefaultOpenHandler

public static void addDefaultOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<ConfirmDialog> defaultOpenHandler)
Add a default open handler that will be appended to each created object

Parameters:
defaultOpenHandler -

addDefaultCloseHandler

public static void addDefaultCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<ConfirmDialog> defaultCloseHandler)
Add a default close handler that will be appended to each created object

Parameters:
defaultCloseHandler -


Copyright © 2014. All rights reserved.