Package com.google.gwt.dom.client

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


    private void drawMenu(final Element panel, final MenuItem menuItem) {
        if (!isMenuItemAllowed(menuItem)) {
            return;
        }
        if (menuItem.isLeafMenuItem()) {
            final LIElement li = Document.get().createLIElement();
            final AnchorElement a = Document.get().createAnchorElement();
            a.setTitle(menuItem.getTitle());
            a.setInnerText(menuItem.getTitle());
            a.setHref("#" + application.getPlaceHistoryMapper().getToken(menuItem.getPlace()));
            li.appendChild(a);
            panel.appendChild(li);
            menuItem.setElement(li);
        } else {
            final LIElement dropdown = Document.get().createLIElement();
            dropdown.addClassName("dropdown");
            final AnchorElement toogle = Document.get().createAnchorElement();
            toogle.setTitle(menuItem.getTitle());
            toogle.setInnerText(menuItem.getTitle());
            toogle.addClassName("dropdown-toggle");
            toogle.setAttribute("data-toggle", "dropdown");// XXX
            menuItem.setElement(dropdown);
            final UListElement dropdownMenu = Document.get().createULElement();
            dropdownMenu.addClassName("dropdown-menu");
            dropdown.appendChild(toogle);
            dropdown.appendChild(dropdownMenu);
            panel.appendChild(dropdown);
            for (final MenuItem childItem : menuItem) {
                drawMenu(dropdownMenu, childItem);
            }
        }
View Full Code Here


            sideBar.addClassName("hide");
        }
    }

    private void drawMenu(final MenuItem currentMenuItem) {
        final LIElement navHeader = Document.get().createLIElement();
        navHeader.setInnerText(currentMenuItem.getParent().getTitle());
        navHeader.addClassName("nav-header");
        sideBar.appendChild(navHeader);

        for (final MenuItem menuItem : currentMenuItem.getParent()) {
            final LIElement li = Document.get().createLIElement();
            final AnchorElement anchor = Document.get().createAnchorElement();
            anchor.setTitle(menuItem.getTitle());
            anchor.setInnerText(menuItem.getTitle());
            anchor.setHref("#" + application.getPlaceHistoryMapper().getToken(menuItem.getPlace()));
            li.appendChild(anchor);
            menuItem.setElement(li);
            sideBar.appendChild(li);

            if (menuItem == currentMenuItem) {
                li.addClassName(Constants.ACTIVE);
            }
        }
    }
View Full Code Here

      assertEquals("Center", panel.centerLabel.getText());
      assertEquals(Direction.NORTH, panel.getLayout().getWidgetDirection(panel.northLabel));
      assertEquals("<ul><li id=\"li-west0\">west0</li><li id=\"li-west1\">west1</li></ul>",
               panel.westHTML.getHTML());

      LIElement li0 = panel.westHTML.getElement().getFirstChildElement().getChild(0).cast();
      LIElement li1 = panel.westHTML.getElement().getFirstChildElement().getChild(1).cast();
      assertEquals("west0", li0.getInnerText());
      assertEquals("west1", li1.getInnerText());

      assertEquals(li0, Document.get().getElementById("li-west0"));
      assertEquals(li1, Document.get().getElementById("li-west1"));

      assertEquals(15, panel.getLayout().getSplitterSize());
View Full Code Here

      assertEquals("Center", panel.centerLabel.getText());
      assertEquals(Direction.NORTH, panel.getLayout().getWidgetDirection(panel.northLabel));
      assertEquals("<ul><li id=\"li-west0\">west0</li><li id=\"li-west1\">west1</li></ul>",
               panel.westHTML.getHTML());

      LIElement li0 = panel.westHTML.getElement().getFirstChildElement().getChild(0).cast();
      LIElement li1 = panel.westHTML.getElement().getFirstChildElement().getChild(1).cast();
      assertEquals("west0", li0.getInnerText());
      assertEquals("west1", li1.getInnerText());

      assertEquals(li0, Document.get().getElementById("li-west0"));
      assertEquals(li1, Document.get().getElementById("li-west1"));
   }
View Full Code Here

    public ListWidget() {
        setElement(element);
    }

    public void addItem(String item) {
        LIElement liElem = Document.get().createLIElement();
        liElem.setInnerHTML(item);
        element.appendChild(liElem);
    }
View Full Code Here

    public SelectTimeUnitView(final EventBus eventBus, final Binder binder, final I18n i18n)
    {
        super(eventBus);
        this.popupPanel = binder.createAndBindUi(this);
        this.i18n = i18n;
        LIElement noDataLi = Document.get().createLIElement();
        noDataLi.setInnerText("Loading...");
        this.list.appendChild(noDataLi);
        setAutoHideOnNavigationEventEnabled(true);
    }
View Full Code Here

                }
                if (monthsOrWeeks != null && !monthsOrWeeks.isEmpty())
                {
                    SortedSet<Integer> reversed = new TreeSet<Integer>(Ordering.natural().reverse());
                    reversed.addAll(monthsOrWeeks);
                    LIElement yearLi = Document.get().createLIElement();
                    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

TOP

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

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.