org.gwtbootstrap3.extras.notify.client.ui
Class NotifySettings

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by org.gwtbootstrap3.extras.notify.client.ui.NotifySettings

public class NotifySettings
extends JavaScriptObject

This class represent basic Notify's settings, that you can use to customize display of each Notify.

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

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

Constructor Summary
protected NotifySettings()
          Default constructor
 
Method Summary
 void makeDefault()
          Make this NotifySettings as default for all new Notifies.
static NotifySettings newSettings()
          Creates a new instance of NotifySettings.
 void setAllowDismiss(boolean allowDismiss)
          If false, the data-notify="dismiss" element in the template will be hidden.
 void setAnimation(Animation enter, Animation exit)
          Set Animation to Notify when it enters and exit the screen.
 void setAnimation(String enter, String exit)
          Set custom CSS style for animations of Notify when it enters and exits the screen.
 void setClosedHandler(NotifyClosedHandler handler)
          Set the Notify's closed event handler.
 void setCloseHandler(NotifyCloseHandler handler)
          Set the Notify's close event handler.
 void setDelay(int mDelay)
          Set delay, how long Notify stays on screen.
 void setElement(String element)
          Set element name or class or ID to append Notify to.
 void setIconType(NotifyIconType iconType)
          Set icon type you will use for Notify.
 void setNewestOnTop(boolean newestOnTop)
          If true, newer notifications push down older ones.
 void setOffset(int offX, int offY)
          Set offset (space between Notify and screen/browser edges) for each axis.
 void setPauseOnMouseOver(boolean pauseOnMouseOver)
          Pause countdown of display timeout when mouse is hovering above the Notify.
 void setPlacement(NotifyPlacement placement)
          Set placement of Notify on screen.
 void setPosition(NotifyPosition position)
          Set custom position to the Notify container element.
 void setShowHandler(NotifyShowHandler handler)
          Set the Notify's show event handler.
 void setShownHandler(NotifyShownHandler handler)
          Set the Notify's shown event handler.
 void setSpacing(int space)
          Set custom spacing between two Notifies.
 void setTemplate(String html)
          Set custom HTML Template of Notify.
 void setTimer(int timer)
          Set timer.
 void setType(NotifyType type)
          Set type of Notify (CSS style class name).
 void setType(String customType)
          Set custom style name to Notify.
 void setUrlTarget(NotifyUrlTarget urlTarget)
          Set custom URL target.

Defaults to NotifyUrlTarget.BLANK.
 void setUrlTarget(String customUrlTarget)
          Set custom URL target.
 void setZIndex(int zIndex)
          Set custom Z-index.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotifySettings

protected NotifySettings()
Default constructor

Method Detail

newSettings

public static NotifySettings newSettings()
Creates a new instance of NotifySettings.

Returns:
a new instance of NotifySettings.

setElement

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

Parameters:
element - Name, class or ID

setPosition

public final void setPosition(NotifyPosition position)
Set custom position to the Notify container element. Default is null.

Parameters:
position - one of STATIC, FIXED, RELATIVE, ABSOLUTE, or null

setType

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

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

setType

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

Parameters:
customType - Style name to set

setPlacement

public final void setPlacement(NotifyPlacement placement)
Set placement of Notify on screen. Default placement is NotifyPlacement.TOP_RIGHT.

Parameters:
placement - Notify's placement on screen
See Also:
NotifyPlacement

setAllowDismiss

public final void setAllowDismiss(boolean allowDismiss)
If false, the data-notify="dismiss" element in the template will be hidden. Default is true.

Parameters:
allowDismiss - if false, the close icon will be hidden

setNewestOnTop

public final void setNewestOnTop(boolean newestOnTop)
If true, newer notifications push down older ones. Default is false.

WARNING: Be careful when setting newestOnTop to true when a placement that already contains a notification has newest_on_top to false. It may cause issues with the plug-ins ability to place the notification in the correct location.

Parameters:
newestOnTop - if true, newer notifications push down older ones
Since:
3.0.0

setOffset

public final void setOffset(int offX,
                            int offY)
Set offset (space between Notify 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 Notifies. 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 Notify 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 Notify. If timer > remaining delay, Notify is hidden after delay runs out (ignoring timer).

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

setUrlTarget

public final void setUrlTarget(NotifyUrlTarget urlTarget)
Set custom URL target.

Defaults to NotifyUrlTarget.BLANK.

Parameters:
urlTarget - URL target

setUrlTarget

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

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

Parameters:
customUrlTarget - URL target

setPauseOnMouseOver

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

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

setAnimation

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

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

setAnimation

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

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

setShowHandler

public final void setShowHandler(NotifyShowHandler handler)
Set the Notify's show event handler. The show event fires immediately when the show instance method is called.

Parameters:
handler -

setShownHandler

public final void setShownHandler(NotifyShownHandler handler)
Set the Notify's shown event handler. This event is fired when the modal has been made visible to the user (will wait for CSS transitions to complete).

Parameters:
handler -

setCloseHandler

public final void setCloseHandler(NotifyCloseHandler handler)
Set the Notify's close event handler. This event is fired immediately when the notification is closing.

Parameters:
handler -

setClosedHandler

public final void setClosedHandler(NotifyClosedHandler handler)
Set the Notify's closed event handler. This event is fired when the modal has finished closing and is removed from the document (will wait for CSS transitions to complete).

Parameters:
handler -

setIconType

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

Defaults to NotifyIconType.CLASS.

Parameters:
iconType - the icon type
See Also:
NotifyIconType

setTemplate

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

<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">
  <button type="button" aria-hidden="true" class="close" data-notify="dismiss">x</button>
  <span data-notify="icon"></span>
  <span data-notify="title">{1}</span>
  <span data-notify="message">{2}</span>
  <div class="progress" data-notify="progressbar">
    <div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>
  </div>
  <a href="{3}" target="{4}" data-notify="url"></a>
</div>

Where:

Parameters:
html - Custom HTML template
See Also:
at: http://bootstrap-notify.remabledesigns.com/

makeDefault

public final void makeDefault()
Make this NotifySettings as default for all new Notifies.

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



Copyright © 2015. All rights reserved.