com.vaadin.shared.Position Java Examples

The following examples show how to use com.vaadin.shared.Position. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ErrorView.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void enter(final ViewChangeListener.ViewChangeEvent event) {
    final DashboardMenuItem view = dashboardMenu.getByViewName(event.getViewName());
    if (view == null) {
        message.setValue(i18n.getMessage("message.error.view", event.getViewName()));
        return;
    }
    if (dashboardMenu.isAccessDenied(event.getViewName())) {
        final Notification nt = new Notification("Access denied",
                i18n.getMessage("message.accessdenied.view", event.getViewName()), Type.ERROR_MESSAGE, false);
        nt.setStyleName(SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE);
        nt.setPosition(Position.BOTTOM_RIGHT);
        nt.show(UI.getCurrent().getPage());
        message.setValue(i18n.getMessage("message.accessdenied.view", event.getViewName()));
    }
}
 
Example #2
Source File: ViewClientCriterion.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Displays a message box telling that the action is not allowed.
 *
 * @param drag
 *            the current drag event holding the context.
 */
private void showErrorNotification(final VDragEvent drag) {
    final VNotification n = VNotification.createNotification(SPUILabelDefinitions.SP_DELAY,
            drag.getTransferable().getDragSource().getWidget());
    n.show(getDraggableTemplate().notificationMsg(errorMessage).asString(), Position.BOTTOM_RIGHT,
            SPUIStyleDefinitions.SP_NOTIFICATION_ERROR_MESSAGE_STYLE);
}
 
Example #3
Source File: NotificationMessage.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Decorate.
 * 
 * @param styleName
 *            style name of message
 * @param caption
 *            message caption
 * @param description
 *            message description
 * @param autoClose
 *            flag to indicate enable close option
 */
private void decorate(final String styleName, final String caption, final String description,
        final Boolean autoClose) {
    setCaption(caption);
    setDescription(description);
    setStyleName(styleName);
    setHtmlContentAllowed(false);
    setPosition(Position.BOTTOM_RIGHT);
    if (autoClose) {
        setDelayMsec(SPUILabelDefinitions.SP_DELAY);
    } else {
        setDelayMsec(-1);
    }
}
 
Example #4
Source File: HawkbitErrorNotificationMessage.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Constructor of HawkbitErrorNotificationMessage
 * 
 * @param style
 *            style of the notification message
 * @param caption
 *            caption of the notification message
 * @param description
 *            text which is displayed in the notification
 * @param autoClose
 *            boolean if notification is closed after random click (true) or
 *            closed by clicking on the notification (false)
 */
public HawkbitErrorNotificationMessage(final String style, final String caption, final String description,
        final boolean autoClose) {
    super(caption);
    setStyleName(style);
    if (autoClose) {
        setDelayMsec(SPUILabelDefinitions.SP_DELAY);
    } else {
        setDelayMsec(-1);
    }
    setHtmlContentAllowed(true);
    setPosition(Position.BOTTOM_RIGHT);
    setDescription(description);
}
 
Example #5
Source File: MNotification.java    From viritin with Apache License 2.0 2 votes vote down vote up
/**
 * See: {@link #setPosition(com.vaadin.shared.Position)}
 *
 * @param position The desired notification position
 * @return this (for method chaining)
 * @see #setPosition(com.vaadin.shared.Position)
 */
public MNotification withPosition(Position position) {
    setPosition(position);
    return this;
}