com.smartgwt.client.util
Class SC

java.lang.Object
  extended by com.smartgwt.client.util.SC

public class SC
extends java.lang.Object


Field Summary
static java.lang.String REF
           
 
Constructor Summary
SC()
           
 
Method Summary
static void ask(java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "Yes" and "No" buttons.
static void ask(java.lang.String title, java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "Yes" and "No" buttons.
static void ask(java.lang.String title, java.lang.String message, BooleanCallback callback, Dialog dialogProperties)
          Show a modal dialog with a message, icon, and "Yes" and "No" buttons.
static void askforValue(java.lang.String title, java.lang.String message, java.lang.String defaultValue, ValueCallback callback, Dialog dialogProperties)
          Show a modal dialog with a text entry box, asking the user to enter a value.
static void askforValue(java.lang.String title, java.lang.String message, ValueCallback callback)
          Show a modal dialog with a text entry box, asking the user to enter a value.
static void askforValue(java.lang.String message, ValueCallback callback)
          Show a modal dialog with a text entry box, asking the user to enter a value.
static void clearPrompt()
          Clear the modal prompt being shown to the user.
static void confirm(java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.
static void confirm(java.lang.String title, java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.
static void confirm(java.lang.String title, java.lang.String message, BooleanCallback callback, Dialog dialogProperties)
          Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.
static void debugger()
           
static void disableFirebug()
          Disable firebug.
static java.lang.String generateID()
           
static java.lang.String getHome()
           
static boolean hasFirebug()
          Return true if Firebug is enabled.
static boolean isIE()
           
static void logEcho(com.google.gwt.core.client.JavaScriptObject value, java.lang.String message)
          Logs the echoed object as a warning, prefixed with an optional message.
static void logEchoAll(com.google.gwt.core.client.JavaScriptObject value, java.lang.String message)
          Logs the echoed object as a warning, prefixed with an optional message.
static void logWarn(java.lang.String message)
          Log a warning.
static void logWarn(java.lang.String message, java.lang.String category)
          Log a warning.
static void say(java.lang.String message)
          Show a modal dialog with a message, icon, and "OK" button.
static void say(java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "OK" button.
static void say(java.lang.String title, java.lang.String message)
          Show a modal dialog with a message, icon, and "OK" button.
static void say(java.lang.String title, java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "OK" button.
static void showConsole()
           
static void showPrompt(java.lang.String message)
          Show a modal prompt to the user.
static void showPrompt(java.lang.String title, java.lang.String message)
          Show a modal prompt to the user.
static void showPrompt(java.lang.String title, java.lang.String message, Dialog dialogProperties)
          Show a modal prompt to the user.
static void warn(java.lang.String message, BooleanCallback callback)
          Show a modal dialog with a message, icon, and "OK" button.
static void warn(java.lang.String title, java.lang.String message, BooleanCallback callback, Dialog dialogProperties)
          Show a modal dialog with a message, icon, and "OK" button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REF

public static final java.lang.String REF
See Also:
Constant Field Values
Constructor Detail

SC

public SC()
Method Detail

generateID

public static java.lang.String generateID()

getHome

public static java.lang.String getHome()

debugger

public static void debugger()

showConsole

public static void showConsole()

hasFirebug

public static boolean hasFirebug()
Return true if Firebug is enabled.

Returns:
true if firebug is enabled

isIE

public static boolean isIE()

disableFirebug

public static void disableFirebug()
Disable firebug.


say

public static void say(java.lang.String message)
Show a modal dialog with a message, icon, and "OK" button. Intended for notifications which are not really warnings (default icon is less severe).

Parameters:
message - the message

say

public static void say(java.lang.String title,
                       java.lang.String message)
Show a modal dialog with a message, icon, and "OK" button. Intended for notifications which are not really warnings (default icon is less severe).

Parameters:
title - the title of the message box
message - the message

say

public static void say(java.lang.String message,
                       BooleanCallback callback)
Show a modal dialog with a message, icon, and "OK" button. Intended for notifications which are not really warnings (default icon is less severe). The callback will receive boolean true for an OK button click, or null if the Dialog is dismissed via the close button.

Parameters:
message - the message
callback - the callback to fire when the user dismisses the dialog.

say

public static void say(java.lang.String title,
                       java.lang.String message,
                       BooleanCallback callback)
Show a modal dialog with a message, icon, and "OK" button. Intended for notifications which are not really warnings (default icon is less severe). The callback will receive boolean true for an OK button click, or null if the Dialog is dismissed via the close button.

Parameters:
title - the title of the message box
message - the message
callback - the callback to fire when the user dismisses the dialog.

ask

public static void ask(java.lang.String message,
                       BooleanCallback callback)
Show a modal dialog with a message, icon, and "Yes" and "No" buttons. The callback will receive boolean true for an OK button click, boolean false for a No button click, or null if the Dialog is dismissed via the close button.

Parameters:
message - the message
callback - the callback to fire when the user dismisses the dialog.

ask

public static void ask(java.lang.String title,
                       java.lang.String message,
                       BooleanCallback callback)
Show a modal dialog with a message, icon, and "Yes" and "No" buttons. The callback will receive boolean true for an OK button click, boolean false for a No button click, or null if the Dialog is dismissed via the close button.

Parameters:
title - the title of the message box
message - the message
callback - the callback to fire when the user dismisses the dialog.

ask

public static void ask(java.lang.String title,
                       java.lang.String message,
                       BooleanCallback callback,
                       Dialog dialogProperties)
Show a modal dialog with a message, icon, and "Yes" and "No" buttons. The callback will receive boolean true for an OK button click, boolean false for a No button click, or null if the Dialog is dismissed via the close button.

Parameters:
title - the title of the message box
message - the message
callback - the callback to fire when the user dismisses the dialog.

askforValue

public static void askforValue(java.lang.String message,
                               ValueCallback callback)
Show a modal dialog with a text entry box, asking the user to enter a value.

As with other convenience methods that show Dialogs, such as #warn(String, String, BooleanCallback) , the dialog is shown and the function immediately returns. When the user responds, the provided callback is called.

If the user clicks OK, the value typed in is passed to the callback (including the empty string ("") if nothing was entered. If the user clicks cancel, the value passed to the callback is null.

A default value for the text field can be passed via properties.defaultValue

Keyboard focus is automatically placed in the text entry field, and hitting the enter key is the equivalent of pressing OK.

Parameters:
message - message to display
callback - Callback to fire when the user clicks a button to dismiss the dialog. This has the single parameter 'value', indicating the user entry, or null if cancel was pressed or the window closed

askforValue

public static void askforValue(java.lang.String title,
                               java.lang.String message,
                               ValueCallback callback)
Show a modal dialog with a text entry box, asking the user to enter a value.

As with other convenience methods that show Dialogs, such as #warn(String, String, BooleanCallback) , the dialog is shown and the function immediately returns. When the user responds, the provided callback is called.

If the user clicks OK, the value typed in is passed to the callback (including the empty string ("") if nothing was entered. If the user clicks cancel, the value passed to the callback is null.

Keyboard focus is automatically placed in the text entry field, and hitting the enter key is the equivalent of pressing OK.

Parameters:
title - the title of the dialog
message - message to display
callback - Callback to fire when the user clicks a button to dismiss the dialog. This has the single parameter 'value', indicating the user entry, or null if cancel was pressed or the window closed

askforValue

public static void askforValue(java.lang.String title,
                               java.lang.String message,
                               java.lang.String defaultValue,
                               ValueCallback callback,
                               Dialog dialogProperties)
Show a modal dialog with a text entry box, asking the user to enter a value.

As with other convenience methods that show Dialogs, such as #warn(String, String, BooleanCallback) , the dialog is shown and the function immediately returns. When the user responds, the provided callback is called.

If the user clicks OK, the value typed in is passed to the callback (including the empty string ("") if nothing was entered. If the user clicks cancel, the value passed to the callback is null.

Keyboard focus is automatically placed in the text entry field, and hitting the enter key is the equivalent of pressing OK.

Parameters:
title - the title of the dialog
message - message to display
defaultValue - the default value of the text field
callback - Callback to fire when the user clicks a button to dismiss the dialog. This has the single parameter 'value', indicating the user entry, or null if cancel was pressed or the window closed
dialogProperties - additional properties of the Dialog

showPrompt

public static void showPrompt(java.lang.String message)
Show a modal prompt to the user. This method will display the message using the Dialog.Prompt singleton object.

Note: if this prompt is to be shown to the user during some slow logic, we advise calling this method, then using DeferredCommand to kick off the slow logic in a separate thread. This ensures that the prompt is showing before the lengthy execution begins.

Parameters:
message - message to display
See Also:
clearPrompt()

showPrompt

public static void showPrompt(java.lang.String title,
                              java.lang.String message,
                              Dialog dialogProperties)
Show a modal prompt to the user. This method will display the message using the Dialog.Prompt singleton object.

Note: if this prompt is to be shown to the user during some slow logic, we advise calling this method, then using DeferredCommand to kick off the slow logic in a separate thread. This ensures that the prompt is showing before the lengthy execution begins.

Parameters:
title - the title of the dialog
message - message to display
dialogProperties - additional properties for the Dialog
See Also:
clearPrompt()

showPrompt

public static void showPrompt(java.lang.String title,
                              java.lang.String message)
Show a modal prompt to the user. This method will display the message using the Dialog.Prompt singleton object.

Note: if this prompt is to be shown to the user during some slow logic, we advise calling this method, then using DeferredCommand to kick off the slow logic in a separate thread. This ensures that the prompt is showing before the lengthy execution begins.

Parameters:
title - the title of the dialog
message - message to display
See Also:
clearPrompt()

clearPrompt

public static void clearPrompt()
Clear the modal prompt being shown to the user.


confirm

public static void confirm(java.lang.String message,
                           BooleanCallback callback)
Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.

The callback will receive boolean true for an OK button click, or null for a Cancel click or if the Dialog is dismissed via the close button.

Parameters:
message - message to display
callback - Callback to fire when the user clicks a button to dismiss the dialog.

confirm

public static void confirm(java.lang.String title,
                           java.lang.String message,
                           BooleanCallback callback)
Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.

The callback will receive boolean true for an OK button click, or null for a Cancel click or if the Dialog is dismissed via the close button.

Parameters:
title - the title of the dialog
message - message to display
callback - Callback to fire when the user clicks a button to dismiss the dialog.

confirm

public static void confirm(java.lang.String title,
                           java.lang.String message,
                           BooleanCallback callback,
                           Dialog dialogProperties)
Show a modal dialog with a message, icon, and "OK" and "Cancel" buttons.

The callback will receive boolean true for an OK button click, or null for a Cancel click or if the Dialog is dismissed via the close button.

Parameters:
title - the title of the dialog
message - message to display
callback - Callback to fire when the user clicks a button to dismiss the dialog.
dialogProperties - additional properties for the Dialog

warn

public static void warn(java.lang.String message,
                        BooleanCallback callback)
Show a modal dialog with a message, icon, and "OK" button.

The callback will receive boolean true for an OK button click, or null if the Dialog is dismissed via the close button.

Parameters:
message - the message
callback - Optional Callback to fire when the user dismisses the dialog.

warn

public static void warn(java.lang.String title,
                        java.lang.String message,
                        BooleanCallback callback,
                        Dialog dialogProperties)
Show a modal dialog with a message, icon, and "OK" button.

The callback will receive boolean true for an OK button click, or null if the Dialog is dismissed via the close button.

Parameters:
message - the message
callback - Optional Callback to fire when the user dismisses the dialog.
dialogProperties - additional properties for the Dialog

logWarn

public static void logWarn(java.lang.String message)
Log a warning.

Parameters:
message - the message to log

logWarn

public static void logWarn(java.lang.String message,
                           java.lang.String category)
Log a warning.

Parameters:
message - the message to log
category - category to log in, defaults to "Log"

logEcho

public static void logEcho(com.google.gwt.core.client.JavaScriptObject value,
                           java.lang.String message)
Logs the echoed object as a warning, prefixed with an optional message.

Parameters:
value - object to echo
message - the message to log

logEchoAll

public static void logEchoAll(com.google.gwt.core.client.JavaScriptObject value,
                              java.lang.String message)
Logs the echoed object as a warning, prefixed with an optional message.

Parameters:
value - object to echo
message - the message to log