Package org.apache.wicket.extensions.ajax.markup.html

Examples of org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink


                File file = (File) item.getModelObject();
                boolean last = item.getIndex() == getList().size() - 1;
               
                // the link to the current path item
                Label name = new Label("pathItem", file.getName() + "/");
                Link link = new IndicatingAjaxFallbackLink("pathItemLink", item
                        .getModel()) {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        pathItemClicked((File) getModelObject(), target);
                    }

                };
                link.add(name);
                item.add(link);
                link.setEnabled(!last);
            }

        });
    }
View Full Code Here


                // odd/even alternate style
                item.add(new SimpleAttributeModifier("class",
                        item.getIndex() % 2 == 0 ? "even" : "odd"));
               
                // navigation/selection links
                AjaxFallbackLink link = new IndicatingAjaxFallbackLink("nameLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        linkNameClicked((File) item.getModelObject(), target);
                    }
                   
                };
                link.add(new Label("name", item.getModel()) {
                    @Override
                    public IConverter getConverter(Class type) {
                        return FILE_NAME_CONVERTER;
                    }
                });
View Full Code Here

    public LabeledLink(String id, Model model, Model labelModel, boolean ajaxified) {
        super(id);

        Link link;
        if (ajaxified) {
            link = new IndicatingAjaxFallbackLink("linkId", model) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    LabeledLink.this.onClick(target);
                }
View Full Code Here

                        final FacetHelper h = (FacetHelper) li.getModelObject();

                        final String filter = h.getFilter();
                        final boolean selected = alreadyFiltered.contains(filter);

                        Link link = new IndicatingAjaxFallbackLink("filterValueLink") {

                            @Override
                            public void onClick(AjaxRequestTarget target) {
                                onFacetChange(target, h.key, h.value, selected);
                            }
                        };
                        // change style if filter is selected
                        if (selected)
                            link.add(new AttributeAppender("class", new Model("filter-rm"), " "));
                        else
                            link.add(new AttributeAppender("class", new Model("filter-add"), " "));

                        link.add(new Label("filterValue", h.displayName));

                        // not clickable if filter would result in 0 docs
                        if (h.count == 0) {
                            link.setEnabled(false);
                            link.add(new AttributeAppender("class", new Model("gray"), " "));
                        }

                        li.add(new Label("filterCount", " (" + h.count + ")"));
                        li.add(link);
                    }
View Full Code Here

                    @Override
                    protected void populateItem(ListItem li) {
                        final FacetHelper h = (FacetHelper) li.getModelObject();
                        final boolean selected = isAlreadyFiltered(h.getFilter());
                        final boolean excluded = isAlreadyExcluded(h.getFilter());
                        Link link = new IndicatingAjaxFallbackLink("filterValueLink") {

                            @Override
                            public void onClick(AjaxRequestTarget target) {
                                if (selected)
                                    onFilterChange(target, h.key, h.value, null);
                                else
                                    onFilterChange(target, h.key, h.value, false);
                            }
                        };
                        Link excludeLink = new IndicatingAjaxFallbackLink("filterExcludeLink") {

                            @Override
                            public void onClick(AjaxRequestTarget target) {
                                if (excluded)
                                    onFilterChange(target, h.key, h.value, null);
                                else
                                    onFilterChange(target, h.key, h.value, true);
                            }
                        };
                        li.add(new Label("filterCount", " (" + h.count + ")"));
                        li.add(link);
                        li.add(excludeLink);

                        /* exlude does not work for filter queries like RT_COUNT.contains(h.key)*/
                        if (USER.contains(h.key) || LANG.contains(h.key))
                            excludeLink.setVisible(true);
                        else
                            excludeLink.setVisible(false);

                        if (excluded)
                            link.add(new AttributeAppender("class", new Model("filter-ex"), " "));

                        // change style if filter is selected
View Full Code Here

            @Override
            public void onClick(AjaxRequestTarget target) {
                onRetweet(tweet, target);
            }
        });
        IndicatingAjaxFallbackLink inReplyOfButton = new IndicatingAjaxFallbackLink("inreplyof") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!inReplyOfClicked)
                        subTweets.addAll(onInReplyOfClick(tweet.getInReplyTwitterId()));

                    inReplyOfClicked = !inReplyOfClicked;
                }
            }
        };

        add(inReplyOfButton);
        if (JTweet.isDefaultInReplyId(tweet.getInReplyTwitterId()))
            inReplyOfButton.setVisible(false);

        IndicatingAjaxFallbackLink rtLink = new IndicatingAjaxFallbackLink("retweeters") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!rtClicked)
                        subTweets.addAll(onReplyClick(tweet.getTwitterId(), true));

                    rtClicked = !rtClicked;
                }
            }
        };

        add(rtLink.add(new Label("retweetersLabel", "retweets " + tweet.getRetweetCount())));
        if (tweet.getRetweetCount() == 0)
            rtLink.setVisible(false);

        IndicatingAjaxFallbackLink replyLink = new IndicatingAjaxFallbackLink("replies") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target != null) {
                    subTweets.clear();
                    target.addComponent(OneTweet.this);
                    if (!rpClicked)
                        subTweets.addAll(onReplyClick(tweet.getTwitterId(), false));

                    rpClicked = !rpClicked;
                }
            }
        };

        add(replyLink.add(new Label("repliesLabel", "replies " + (tweet.getReplyCount() - tweet.getRetweetCount()))));
        if (tweet.getReplyCount() == tweet.getRetweetCount())
            replyLink.setVisible(false);

        add(new AjaxFallbackLink("similarLink") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                onFindSimilarClick(tweet, target);
            }
        });

        add(new IndicatingAjaxFallbackLink("translateLink") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                if (target == null)
                    return;
View Full Code Here

    public LabeledLink(String id, Model model, Model labelModel, boolean ajaxified) {
        super(id);

        Link link;
        if (ajaxified) {
            link = new IndicatingAjaxFallbackLink("linkId", model) {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    LabeledLink.this.onClick(target);
                }
View Full Code Here

    public SavedSearchPanel(String id) {
        super(id);

        tr.put(SAVED_SEARCHES, "Saved Searches");
        Link saveSearch = new IndicatingAjaxFallbackLink("saveSearch") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                SavedSearchPanel.this.onSave(target, new Date().getTime());
            }
        };
        add(saveSearch);

        AjaxFallbackLink link = new IndicatingAjaxFallbackLink("saveInfo") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                SavedSearchPanel.this.onSave(target, new Date().getTime());
            }

            @Override
            public boolean isVisible() {
                return isInitialized && savedSearches.isEmpty();
            }
        };
        add(link.setOutputMarkupId(true));

        add(new WebMarkupContainer("indicatorImage") {

            @Override
            public boolean isVisible() {
                return !isInitialized;
            }
        }.setOutputMarkupId(true));

        // don't know how to utilize IAjaxIndicatorAware + getAjaxIndicatorMarkupId() { return indicator.getMarkupId();
        //add(indicator);

        savedSearchesView = new ListView("filterValues", savedSearches) {

            @Override
            protected void populateItem(ListItem li) {
                final FacetHelper<Long> h = (FacetHelper<Long>) li.getModelObject();
                long tmp = h.value;
                final long ssId = tmp;
                Link link = new IndicatingAjaxFallbackLink("filterValueLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        SavedSearchPanel.this.onClick(target, ssId);
                    }
                };

                String name = h.displayName;
                if (name.length() > 20)
                    name = name.substring(0, 20) + "..";
                else if (name.length() < 1)
                    name = "<empty>";

                if (ssId == 0)
                    name = "last:" + name;

                link.add(new Label("filterValue", name));
                link.add(new AttributeAppender("title", true, new Model(h.displayName), " "));
                Label label4count = new Label("filterCount", " (" + h.count + ")");
                if (h.count < 1) {
                    link.add(new AttributeAppender("class", new Model("gray"), " "));
                    label4count.add(new AttributeAppender("class", new Model("gray"), " "));
                }

                li.add(label4count);
                li.add(link);
View Full Code Here

                File file = (File) item.getModelObject();
                boolean last = item.getIndex() == getList().size() - 1;
               
                // the link to the current path item
                Label name = new Label("pathItem", file.getName() + "/");
                Link link = new IndicatingAjaxFallbackLink("pathItemLink", item
                        .getModel()) {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        pathItemClicked((File) getModelObject(), target);
                    }

                };
                link.add(name);
                item.add(link);
                link.setEnabled(!last);
            }

        });
    }
View Full Code Here

                // odd/even alternate style
                item.add(new SimpleAttributeModifier("class",
                        item.getIndex() % 2 == 0 ? "even" : "odd"));
               
                // navigation/selection links
                AjaxFallbackLink link = new IndicatingAjaxFallbackLink("nameLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        linkNameClicked((File) item.getModelObject(), target);
                    }
                   
                };
                link.add(new Label("name", item.getModel()) {
                    @Override
                    public IConverter getConverter(Class type) {
                        return FILE_NAME_CONVERTER;
                    }
                });
View Full Code Here

TOP

Related Classes of org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink

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.