Example usage for com.vaadin.ui Notification show

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

Introduction

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

Prototype

public static Notification show(String caption) 

Source Link

Document

Shows a notification message on the middle of the current page.

Usage

From source file:com.vphakala.CustomerUI.java

public void createCustomer() {
    if (service.create(new Customer(0L, firstName.getValue(), lastName.getValue(), email.getValue())) == true) {
        Notification.show("create OK");
        updateGrid();/*from w  w  w  . j  a  va2 s  .  co m*/
        firstName.clear();
        lastName.clear();
        email.clear();
    } else {
        Notification.show("Create failed");
    }
}

From source file:com.vphakala.CustomerUI.java

public void readCustomer() {
    List customers = service.read(firstName.getValue(), lastName.getValue());
    if (customers.isEmpty() == true) {
        Notification.show("Read: not found");
    } else {//from w w w .  j a  v  a2 s.c om
        customer = (Customer) customers.get(0);
        BeanFieldGroup.bindFieldsUnbuffered(customer, this);
    }

}

From source file:com.vphakala.SubscriberUI.java

public void createSubscriber() {
    if (service.create(new Subscriber(0L, email.getValue(), phoneNumber.getValue(),
            new BigDecimal(balance.getValue()))) == true) {
        Notification.show("create OK");
    } else {//from w  w  w . j  av  a2 s.co m
        Notification.show("Create failed");
    }
}

From source file:com.vphakala.SubscriberUI.java

public void readSubscriber() {
    List subscribers = service.read(email.getValue());
    if (subscribers.isEmpty() == true) {
        Notification.show("Read: not found");
        create.setEnabled(true);/*w  w  w . ja va  2s .co  m*/
    } else {
        create.setEnabled(false);
        subscriber = (Subscriber) subscribers.get(0);
        BeanFieldGroup.bindFieldsUnbuffered(subscriber, this);
        this.email.setReadOnly(true);
    }
}

From source file:com.vphakala.VaadinUI.java

@Override
protected void init(VaadinRequest request) {

    customerTab = new CustomerUI(customerService);
    subscriberTab = new SubscriberUI(subscriberService);

    mainLayout = new TabSheet();

    mainLayout.addSelectedTabChangeListener(new TabSheet.SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            TabSheet tabsheet = event.getTabSheet();
            Layout tab = (Layout) tabsheet.getSelectedTab();
            if (tab == subscriberTab) {
                subscriberTab.setUIFields(customerTab.getEmail().getValue());
            } else if (tab == customerTab) {
                // no action needed
            } else {
                Notification.show("*** shit happens ***");
            }/* w  ww. j a  v  a2s .  com*/
        }
    });

    mainLayout.addTab(customerTab);
    mainLayout.addTab(subscriberTab);

    setContent(mainLayout);
}

From source file:com.wcs.vaadin.userinactivity.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);/*from w  w w.  ja  va  2 s. com*/
    Label label = new Label("A window will pop up, when no action in " + SESSION_TIMEOUT + " second.");
    label.setStyleName("h1");
    layout.addComponent(label);
    layout.addComponent(new Button("Button"));
    setContent(layout);
    UserInactivityExtension userInactivityExtension = UserInactivityExtension.init(this);
    sessionTimeoutHandler = userInactivityExtension.initSessionTimeoutHandler();
    sessionTimeoutHandler.addTimeoutListener(new SessionTimeoutHandler.SessionTimeoutListener() {

        @Override
        public void timeout() {
            sessionTimeoutHandler.stop();
            openCountDownWindow();
        }
    });
    sessionTimeoutHandler.start(SESSION_TIMEOUT);
    userInactivityExtension.addActionListener(new UserInactivityExtension.ActionListener() {

        @Override
        public void action() {
            if (sessionTimeoutHandler.isRunning()) {
                Notification.show("OK, " + SESSION_TIMEOUT + " seconds from now");
            }
        }
    });
}

From source file:com.wcs.wcslib.vaadin.widget.filtertablestate.WidgetTestApplication.java

License:Apache License

private FilterTableStateHandler createFilterTableStateHandler() {
    return new FilterTableStateHandler() {
        @Override//from   w ww  .  java  2s.  c om
        public void save(FilterTableStateProfile profile) {
            Notification.show("The profile has been saved!");
        }

        @Override
        public void delete(String profileName) {
            Notification.show("The profile has been removed!");
        }

        @Override
        public Set<FilterTableStateProfile> load() {
            return buildProfiles();
        }

        @Override
        public String getDefaultProfile() {
            return null;
        }

        @Override
        public void setDefaultProfile(String profileName) {
            if (profileName == null) {
                Notification.show("Default profile has been turned off!");
            } else {
                Notification.show("Default profile has been set: " + profileName);
            }
        }
    };
}

From source file:com.wcs.wcslib.vaadin.widget.filtertablestate.WidgetTestApplication.java

License:Apache License

private FilterTableClickFunctionHandler createClickFunctionHandler() {
    return new FilterTableClickFunctionHandler() {
        Set<ClickFunction> functions = createClickFunctions();

        @Override/*from   w ww. j ava2 s.  c  o  m*/
        public Set<ClickFunction> load() {
            return functions;
        }

        @Override
        public void setSelected(Integer functionCode) {
            FunctionCode fc = FunctionCode.findByCode(functionCode);
            if (fc != null) {
                filterTable.setSelectable(fc.selectable);
                filterTable.setMultiSelect(fc.multiselect);
                filterTable.setValue(null);
                filterTable.refreshRowCache();
                Notification.show("Function has been selected: " + fc.label);
            }
        }

        @Override
        public Integer getDefaultFunctionCode() {
            return FunctionCode.DISABLE_SELECT.code;
        }
    };
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.WidgetTestApplication.java

License:Apache License

private void createUploadFinishedHandler() {
    uploadFinishedHandler = new UploadFinishedHandler() {
        @Override/*from   w w w .j a v  a2 s.c  o  m*/
        public void handleFile(InputStream stream, String fileName, String mimeType, long length) {
            Notification.show(fileName + " upsloaded.");
        }
    };
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.FolderView.java

@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
    //  throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    if (event.getParameters() == null || event.getParameters().isEmpty()) {
        this.addComponent(new EmptyView());
        return;//w w  w.  ja  v  a 2 s.  c  o m
    } else {
        this.loadFolder(event.getParameters());
        Notification note = new Notification("Notificaton", event.getParameters().toString(),
                Notification.Type.TRAY_NOTIFICATION);
        note.show(Page.getCurrent());
    }
    //   event.getParameters()));
}