Example usage for com.vaadin.ui Notification Notification

List of usage examples for com.vaadin.ui Notification Notification

Introduction

In this page you can find the example usage for com.vaadin.ui Notification Notification.

Prototype

public Notification(String caption) 

Source Link

Document

Creates a "humanized" notification message.

Usage

From source file:uicomponents.PoolingTable.java

License:Open Source License

private void initDragAndDrop(final ClientSideCriterion acceptCriterion) {
    poolTable.setDropHandler(new DropHandler() {
        /**//from   w  ww  .  j ava 2 s . c om
         * 
         */
        private static final long serialVersionUID = 4057757595986300434L;

        @Override
        public void drop(final DragAndDropEvent dropEvent) {
            // criteria verify that this is safe
            final DataBoundTransferable t = (DataBoundTransferable) dropEvent.getTransferable();
            if (!(t.getSourceComponent() instanceof Table)) {
                return;
            }

            Table source = (Table) t.getSourceComponent();
            Object sourceItemId = t.getItemId();
            if (!moveSampleToPool(source, sourceItemId)) {
                Notification n = new Notification("Sample is already in this pool.");
                n.setDelayMsec(3000);
                n.show(Page.getCurrent());
            }
            resizeTable();
        }

        @Override
        public AcceptCriterion getAcceptCriterion() {
            return new And(acceptCriterion, AcceptItem.ALL);
        }
    });
}