Package org.apache.wicket.behavior

Examples of org.apache.wicket.behavior.AttributeAppender


        rg.add(new Radio("0", new Model(0)).setMarkupId("sbnone"));
        rg.add(new Radio("1", new Model(1)).setMarkupId("sbfriends"));
        rg.add(new Radio("2", new Model(2)).setMarkupId("sbuser"));
        rg.add(userTF);
        if (showSpacer)
            form.add(new AttributeAppender("class", new Model("not-logged-in-spacer"), " "));

        form.add(rg);
       
//        Model hrefModel = new Model() {
//
View Full Code Here


                        @Override
                        public void onClick(AjaxRequestTarget target) {
                            onUrlClick(target, null);
                        }
                    }.add(new AttributeAppender("title", new Model("Deselect all url filters"), " ")));
                } else
                    item.add(new Label("filterName", TITLE));
            }
        });

        ListView urlListView = new ListView("urls", urls) {

            @Override
            public void populateItem(final ListItem item) {
                final Entry<String, Long> url = (Entry) item.getModelObject();

                String title = url.getKey();
                if (title.startsWith("_")) {
                    int index2 = title.indexOf("_", 1);
                    if (index2 > 1)
                        title = title.substring(index2 + 1);
                }
                title = Helper.trimAll(title);
                title = Helper.htmlEntityDecode(title);
                Link contextLink = new AjaxFallbackLink("urlLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        onUrlClick(target, url.getKey());
                    }
                };
                contextLink.add(new AttributeAppender("title",
                        new Model("View Url in Context of " + url.getValue() + " tweets"), " "));
                item.add(contextLink);


                Link directLink = new AjaxFallbackLink("directLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        onDirectUrlClick(target, url.getKey());
                    }
                };
                item.add(directLink);
                directLink.add(new Label("urlLabel", title));
                directLink.add(new AttributeAppender("title", new Model(title), " "));
            }
        };
        add(urlListView);

        HeaderContributor c = new HeaderContributor(new IHeaderContributor() {
View Full Code Here

                        @Override
                        public void onClick(AjaxRequestTarget target) {
                            onFilterChange(target, dtKey, null);
                        }
                    }.add(new AttributeAppender("title", new Model("Remove all filters from '" + dtVal + "'"), " ")));
                } else {
                    String str = "";
                    if (totalHits > 0)
                        str = "Select a date to filter results";
                    Label label = new Label("dateFilter", str);
                    label.add(new AttributeAppender("class", new Model("gray"), " "));
                    item.add(label);
                }
            }
        };
        add(dateFilter);

        ListView items = new ListView("items", facetList) {

            @Override
            public void populateItem(final ListItem item) {
                float zoomer = MAX_HEIGHT_IN_PX / max;
                final FacetHelper entry = (FacetHelper) item.getModelObject();

                Label bar = new Label("itemSpan");
                String additionalDateInfo = entry.count + " tweets";
                String displayName = entry.displayName;
                try {
                    Date date = Helper.toDate(displayName);
                    int index = displayName.indexOf("T");
                    if (index > 0)
                        additionalDateInfo += " on " + Helper.getMonthDay(date);
                   
                    displayName = Helper.getWeekDay(date);
                } catch (Exception ex) {
                }

                AttributeAppender app = new AttributeAppender("title", new Model(additionalDateInfo), " ");
                bar.add(app).add(new AttributeAppender("style", new Model("height:" + (int) (zoomer * entry.count) + "px"), " "));
                final boolean selected = isAlreadyFiltered(entry.key, entry.value);
                Link link = new /*Indicating*/ AjaxFallbackLink("itemLink") {

                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        JSDateFilter.this.onFilterChange(target, entry.getFilter(), !selected);
                    }
                };
                link.add(app);
                Label label = new Label("itemLabel", displayName);
                link.add(bar).add(label);
                if (entry.count == 0) {
                    link.setEnabled(false);
                    link.add(new AttributeAppender("class", new Model("gray"), " "));
                }

                if (selected)
                    link.add(new AttributeAppender("class", new Model("filter-rm"), " "));
                else
                    link.add(new AttributeAppender("class", new Model("filter-add"), " "));
                item.add(link);
            }
        };

        add(items);
View Full Code Here

                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

   */
  public static AttributeAppender append(String attributeName, IModel<?> value)
  {
    Args.notEmpty(attributeName, "attributeName");

    return new AttributeAppender(attributeName, value).setSeparator(" ");
  }
View Full Code Here

   */
  public static AttributeAppender prepend(String attributeName, IModel<?> value)
  {
    Args.notEmpty(attributeName, "attributeName");

    return new AttributeAppender(attributeName, value)
    {
      private static final long serialVersionUID = 1L;

      @Override
      protected String newValue(String currentValue, String replacementValue)
View Full Code Here

    protected abstract void addFormComponentBehavior(Behavior behavior);

    private void addCssForMetaModel() {
        final String cssForMetaModel = getModel().getLongName();
        if (cssForMetaModel != null) {
            add(new AttributeAppender("class", Model.of(cssForMetaModel), " "));
        }

        ScalarModel model = getModel();
        final CssClassFacet facet = model.getFacet(CssClassFacet.class);
        if(facet != null) {
View Full Code Here

class ColoredFeedbackPanel extends FeedbackPanel {

    public ColoredFeedbackPanel(String id) {
        super(id);
        add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
            @Override
            public String getObject() {
                return findClass();
            }
        }));
View Full Code Here

          }

        });
        if (item.getIteration() == getIterations() - 1)
        {
          item.add(new AttributeAppender("class", true, new Model("last"), " "));
        }

      }

    });
View Full Code Here

    setOutputMarkupId(true);
   
    // Dropdown
    BookmarkablePageLink<Void> followArtifactLink = new BookmarkablePageLink<Void>("followArtifactLink", ArtifactSearchPage.class);
    followArtifactLink.add(new ClassAttributeAppender("dropdown-toggle"));
    followArtifactLink.add(new AttributeAppender("data-toggle", "dropdown"));
    followArtifactLink.add(new AttributeModifier("href", "#"));
    followArtifactLink.add(new Label("followArtifactLabel", new ResourceModel("dashboard.artifact.add")));
   
    WebMarkupContainer caret = new WebMarkupContainer("caret");
    followArtifactLink.add(caret);
View Full Code Here

TOP

Related Classes of org.apache.wicket.behavior.AttributeAppender

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.