Package com.google.gwt.dom.client

Examples of com.google.gwt.dom.client.AnchorElement


                    yearLi.setInnerText(String.valueOf(year.getYear()));
                    UListElement nestedUl = Document.get().createULElement();
                    for (Integer monthOrWeek : reversed)
                    {
                        LIElement li = Document.get().createLIElement();
                        AnchorElement link = newLink(linkListener, year, monthOrWeek);
                        li.appendChild(link);
                        nestedUl.appendChild(li);
                    }
                    yearLi.appendChild(nestedUl);
                    list.appendChild(yearLi);
View Full Code Here


    }


    private AnchorElement newLink(LinkListener linkListener, Year year, Integer monthOrWeek)
    {
        AnchorElement link = Document.get().createAnchorElement();
        String text;
        if (unit == MONTH)
        {
            text = i18n.enums().getString("month_" + monthOrWeek);
        }
        else
        {
            text = String.valueOf(monthOrWeek);
        }
        String rel = String.valueOf(year.getYear()) + "|" + monthOrWeek;
        link.setAttribute("rel", rel);
        link.setAttribute("href", "#");
        link.setInnerText(text);

        Element linkElement = (Element) Element.as(link);
        DOM.sinkEvents(linkElement, Event.ONCLICK);
        DOM.setEventListener(linkElement, linkListener);
View Full Code Here

    {
        @Override
        public void onBrowserEvent(Event event)
        {
            EventTarget target = event.getEventTarget();
            AnchorElement link = (AnchorElement) Element.as(target);
            String yearAndMonthOrWeek = link.getAttribute("rel");
            String[] parts = yearAndMonthOrWeek.split("\\|");
            if (parts != null && parts.length == 2)
            {
                try
                {
View Full Code Here

TOP

Related Classes of com.google.gwt.dom.client.AnchorElement

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.