org.cafesip.gwtcomp.client.ui
Class MessageBar

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by org.cafesip.gwtcomp.client.ui.MessageBar
All Implemented Interfaces:
HasHandlers, EventListener

public class MessageBar
extends Composite

A message bar is a panel that can be added to any GWT panel/form/etc and is used to display informational, error, or warning messages. The message bar displays only one message at a time.

Screen-Shots:

Author:
Amit Chatterjee

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Field Summary
static int SEVERITY_ERROR
           
static int SEVERITY_INFORMATIONAL
           
static int SEVERITY_NONE
           
static int SEVERITY_WARNING
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MessageBar()
          A constructor for this class.
 
Method Summary
 void clearMessage()
          Clears the message
 int getSeverity()
          Returns the serverity of the currently-displayed message.
 String getText()
          Returns the text of the message being displayed.
 boolean isAudioEnabled()
          Returns whether audio messaging is enabled.
 void setAudioEnabled(boolean audioEnabled)
          Sets audio messaging.
 void setMessage(String text)
          Prints an informational message.
 void setMessage(String text, int severity)
          Prints a message with a given severity.
 void setSeverity(int severity)
          Sets the severity of the currently-displayed message.
 void setText(String text)
          Sets the text of the message.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEVERITY_NONE

public static final int SEVERITY_NONE
See Also:
Constant Field Values

SEVERITY_INFORMATIONAL

public static final int SEVERITY_INFORMATIONAL
See Also:
Constant Field Values

SEVERITY_WARNING

public static final int SEVERITY_WARNING
See Also:
Constant Field Values

SEVERITY_ERROR

public static final int SEVERITY_ERROR
See Also:
Constant Field Values
Constructor Detail

MessageBar

public MessageBar()
A constructor for this class.

Method Detail

setMessage

public void setMessage(String text)
Prints an informational message.

Parameters:
text - message to print.

setMessage

public void setMessage(String text,
                       int severity)
Prints a message with a given severity.

Parameters:
text - message to print.
severity - of the message (see the constants defined above).

clearMessage

public void clearMessage()
Clears the message


isAudioEnabled

public boolean isAudioEnabled()
Returns whether audio messaging is enabled.

Returns:
true if audio is enabled

setAudioEnabled

public void setAudioEnabled(boolean audioEnabled)
Sets audio messaging. If audio messaging is set, an audio is played depending on the severity level. It is disabled by default.

Parameters:
audioEnabled - true if audio is enabled.

getSeverity

public int getSeverity()
Returns the serverity of the currently-displayed message.

Returns:
Returns the severity.

setSeverity

public void setSeverity(int severity)
Sets the severity of the currently-displayed message.

Parameters:
severity - The severity to set.

getText

public String getText()
Returns the text of the message being displayed.

Returns:
Returns the text.

setText

public void setText(String text)
Sets the text of the message.

Parameters:
text - The text to set.


Copyright © 2010 Cafesip.org. All Rights Reserved.