/** * Sets the caption part of the notification message. * * @param caption * The message caption */ public void setCaption(String caption) { getState().caption = caption; }
/** * Checks whether caption and description are interpreted as HTML or plain * text. * * @return {@code true} if the texts are used as HTML, {@code false} if used * as plain text * @see #setHtmlContentAllowed(boolean) */ public boolean isHtmlContentAllowed() { return getState(false).htmlContentAllowed; }
/** * Gets the delay before the notification disappears. * * @return the delay in milliseconds, {@value #DELAY_FOREVER} indicates the * message has to be clicked. */ public int getDelayMsec() { return getState(false).delay; }
/** * Gets the style name for the notification message. * * @return The style name */ public String getStyleName() { return getState(false).styleName; }
/** * Sets the description part of the notification message. * * @param description * The message description */ public void setDescription(String description) { getState().description = description; }
/** * Sets the delay before the notification disappears. * * @param delayMsec * the desired delay in milliseconds, {@value #DELAY_FOREVER} to * require the user to click the message */ public void setDelayMsec(int delayMsec) { getState().delay = delayMsec; }
/** * Sets the style name for the notification message. * * @param styleName * The desired style name */ public void setStyleName(String styleName) { getState().styleName = styleName; }
/** * Gets the caption part of the notification message. * * @return The message caption */ public String getCaption() { return getState(false).caption; }
/** * Gets the description part of the notification message. * * @return The message description */ public String getDescription() { return getState(false).description; }
/** * Gets the position of the notification message. * * @return The position */ public Position getPosition() { return getState(false).position; }
/** * Sets whether html is allowed in the caption and description. If set to * true, the texts are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the * texts are passed to the browser as plain text. * * @param htmlContentAllowed * true if the texts are used as html, false if used as plain * text */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { getState().htmlContentAllowed = htmlContentAllowed; }
/** * Sets the position of the notification message. * * @param position * The desired notification position, not {@code null} */ public void setPosition(Position position) { if (position == null) { throw new IllegalArgumentException("Position can not be null"); } getState().position = position; }