Package org.eurekastreams.web.client.ui.common.notifier

Examples of org.eurekastreams.web.client.ui.common.notifier.Notification


                        boolean newStatus = ev.getResponse().getReceiveNewActivityNotifications();
                        setSubscribeStatus(newStatus);

                        String msg = newStatus ? "You will now receive emails for new activities to this stream"
                                : "You will no longer receive emails for new activities to this stream";
                        eventBus.notifyObservers(new ShowNotificationEvent(new Notification(msg)));
                    }
                });
        eventBus.addObserver(GotStreamActivitySubscriptionResponseEvent.class,
                new Observer<GotStreamActivitySubscriptionResponseEvent>()
                {
View Full Code Here


            public void onClick(final ClickEvent event)
            {
                StreamBookmarksModel.getInstance().insert(currentScopeId);
                addBookmark.setVisible(false);
                EventBus.getInstance().notifyObservers(
                        new ShowNotificationEvent(new Notification("You have bookmarked this stream.")));
            }
        });

        subscribeViaEmail.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                if (!isSubscribed)
                {
                    if (currentStream.getScopeType().equals(ScopeType.GROUP))
                    {
                        Dialog.showCentered(new GroupEmailSubscribeOptionsDialogContent(currentStream.getUniqueKey()));
                    }
                    else if (currentStream.getScopeType().equals(ScopeType.PERSON))
                    {
                        PersonActivitySubscriptionModel.getInstance().insert(currentStream.getUniqueKey());
                        setSubscribeStatus(true);
                    }
                }
                else
                {
                    Deletable<String> deletable = null;

                    if (currentStream.getScopeType().equals(ScopeType.GROUP))
                    {
                        deletable = GroupActivitySubscriptionModel.getInstance();
                    }
                    else if (currentStream.getScopeType().equals(ScopeType.PERSON))
                    {
                        deletable = PersonActivitySubscriptionModel.getInstance();
                    }

                    if (deletable != null)
                    {
                        deletable.delete(currentStream.getUniqueKey());
                        setSubscribeStatus(false);
                    }
                }
            }
        });

        addToStartPage.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                // For the app's location, use the current URL minus a few parameters we know we don't want. (They are
                // used by other lists, but get left in the URL when switching tabs.)
                // We don't build the URL from the stream id, since that doesn't take search terms into account.
                HashMap<String, String> params = new HashMap<String, String>();
                params.put("listId", null);
                params.put("listFilter", null);
                params.put("listSort", null);
                params.put("startIndex", null);
                params.put("endIndex", null);
                String url = Session.getInstance().generateUrl(new CreateUrlRequest(params));

                // make a version of the query that doesn't have the exclusion list
                JSONObject request = currentRequestObj;
                if (request.containsKey("exclude"))
                {
                    request = new JSONObject();
                    for (String key : currentRequestObj.keySet())
                    {
                        if (!"exclude".equals(key))
                        {
                            request.put(key, currentRequestObj.get(key));
                        }
                    }
                }
                // TODO: get correct title from somewhere.
                String prefs = "{\"streamQuery\":"
                        + makeJsonString(STREAM_URL_TRANSFORMER.getUrl(null, request.toString()))
                        + ",\"gadgetTitle\":" + makeJsonString(currentDisplayName) + ",\"streamLocation\":"
                        + makeJsonString(url) + "}";

                GadgetModel.getInstance().insert(
                        new AddGadgetToStartPageRequest("{d7a58391-5375-4c76-b5fc-a431c42a7555}", null, prefs));
                EventBus.getInstance()
                        .notifyObservers(
                                new ShowNotificationEvent(new Notification(
                                        "This stream will now show up on your start page.")));
            }
        });

        createFilter.addClickHandler(new ClickHandler()
View Full Code Here

                {
                    if (inFeatured)
                    {
                        FeaturedStreamModel.getInstance().delete(featuredStreamDTO.getId());
                        EventBus.getInstance().notifyObservers(
                                new ShowNotificationEvent(new Notification(
                                        "Stream has been removed from the featured streams list.")));
                    }
                    else
                    {
                        Dialog.showCentered(new FeatureDialogContent(featuredStreamDTO));
View Full Code Here

TOP

Related Classes of org.eurekastreams.web.client.ui.common.notifier.Notification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.