org.gwtbootstrap3.extras.growl.client.ui
Class GrowlOptions

java.lang.Object
  extended by org.gwtbootstrap3.extras.growl.client.ui.GrowlOptions

public class GrowlOptions
extends Object

This class represent basic Growl`s options, that you can use to customize display of each Growl.

You can also set current state as default for all new Growls.

Author:
jeffisenhart, Sven Jacobs, Joshua Godi, Pavel Zlámal
See Also:
makeDefault()

Constructor Summary
GrowlOptions()
           
 
Method Summary
 void makeDefault()
          Make this GrowlOptions setting as default for all new Growls.
 void setAllowDismiss(boolean allowDismiss)
          Allow display of dismiss button [X] in top right corner of Growl.
 void setAnimation(Animation enter, Animation exit)
          Set Animation to Growl when it enters and exit the screen.
 void setAnimation(String enter, String exit)
          Set custom CSS style for animations of Growl when it enters and exits the screen.
 void setDelay(int mDelay)
          Set delay, how long Growl stays on screen.
 void setElement(String element)
          Set element name or class or ID to append Growl to.
 void setIconType(String iconType)
          Set type of icon you will use for Growl.
 void setOffset(int offX, int offY)
          Set offset (space between Growl and screen/browser edges) for each axis.
 void setPause(boolean pauseOnMouseOver)
          Pause countdown of display timeout when mouse is hovering above the Growl.
 void setPosition(GrowlPosition position)
          Set position of Growl on screen.
 void setSpacing(int space)
          Set custom spacing between two Growls.
 void setTemplate(String html)
          Set custom HTML Template of Growl.
 void setTimer(int timer)
          Set timer.
 void setType(GrowlType type)
          Set type of Growl (CSS style class name).
 void setType(String customType)
          Set custom style name to Growl.
 void setUrlTarget(String urlTarget)
          Set custom URL target.
 void setZIndex(int zIndex)
          Set custom Z-index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrowlOptions

public GrowlOptions()
Method Detail

setElement

public final void setElement(String element)
Set element name or class or ID to append Growl to. Default is 'body'.

Parameters:
element - Name, class or ID

setPosition

public final void setPosition(GrowlPosition position)
Set position of Growl on screen. Default position is TOP_RIGHT.

Parameters:
position - Growl`s position.
See Also:
GrowlPosition

setAllowDismiss

public final void setAllowDismiss(boolean allowDismiss)
Allow display of dismiss button [X] in top right corner of Growl. Default is TRUE.

Parameters:
allowDismiss - TRUE = display dismiss button / FALSE = hide dismiss button

setOffset

public final void setOffset(int offX,
                            int offY)
Set offset (space between Growl and screen/browser edges) for each axis. Default is 20 PX for both.

Parameters:
offX - Offset for X axis in PX
offY - Offset for Y axis in PX

setSpacing

public final void setSpacing(int space)
Set custom spacing between two Growls. Default is 10 PX.

Parameters:
space - Spacing in PX

setZIndex

public final void setZIndex(int zIndex)
Set custom Z-index. Default is 1031.

Parameters:
zIndex - Z-index

setDelay

public final void setDelay(int mDelay)
Set delay, how long Growl stays on screen. Default is 5000 ms. Set to zero for unlimited time.

Parameters:
mDelay - Delay in milliseconds or zero for unlimited

setTimer

public final void setTimer(int timer)
Set timer. It's value is removed from remaining 'delay' on each 'timer' period. This way you can speed up hiding of Growl. If timer > remaining delay, Growl is hidden after delay runs out (ignoring timer).

Parameters:
timer - Time in milliseconds
See Also:
setDelay(int)

setUrlTarget

public final void setUrlTarget(String urlTarget)
Set custom URL target. Default is "_blank".

See http://www.w3schools.com/tags/att_a_target.asp for possible values.

Parameters:
urlTarget - URL target

setPause

public final void setPause(boolean pauseOnMouseOver)
Pause countdown of display timeout when mouse is hovering above the Growl. Countdown continues (not restarted) if mouse leaves the Growl.

Parameters:
pauseOnMouseOver - TRUE = pause / FALSE = not pause

setAnimation

public final void setAnimation(Animation enter,
                               Animation exit)
Set Animation to Growl when it enters and exit the screen. Default is enter = Animation.FADE_IN_DOWN, exit = Animation.FADE_OUT_UP

Parameters:
enter - animation style when Growl enters the screen
exit - animation style when Growl exists the screen
See Also:
Animation

setAnimation

public final void setAnimation(String enter,
                               String exit)
Set custom CSS style for animations of Growl when it enters and exits the screen. You must write your own CSS animation definition.

Parameters:
enter - animation style when Growl enters the screen
exit - animation style when Growl exists the screen

setIconType

public final void setIconType(String iconType)
Set type of icon you will use for Growl. Default is 'class', which allows to use iconic fonts like FontAwesome. If you want to use images instead of class, set value to "image".

Parameters:
iconType - "class" or "image"

setTemplate

public final void setTemplate(String html)
Set custom HTML Template of Growl. Default value is:

<div data-growl="container" class="alert" role="alert">
  <button type="button" class="close" data-growl="dismiss">
    <span aria-hidden="true">×</span>
    <span class="sr-only">Close</span>
  </button>
  <span data-growl="icon"></span>
  <span data-growl="title"></span>
  <span data-growl="message"></span>
  <a href="#" data-growl="url"></a>
</div>

See documentation at: http://bootstrap-growl.remabledesigns.com/

Parameters:
html - Custom HTML template

makeDefault

public final void makeDefault()
Make this GrowlOptions setting as default for all new Growls.

Values set to this GrowlOptions overrides original default values. If value for some property is not set, original default value is kept.


setType

public final void setType(GrowlType type)
Set type of Growl (CSS style class name). Default is INFO.

Parameters:
type - one of INFO, WARNING, DANGER, SUCCESS
See Also:
GrowlType

setType

public final void setType(String customType)
Set custom style name to Growl. Resulting class name is "alert-[customType]".

Parameters:
customType - Style name to set


Copyright © 2015. All rights reserved.