public void setSideBar(String sideBar) { this.sideBar = sideBar; mobileNav.addStyleName(sideBar); if (sideBar.equals("hidden")) { mobileNav.getElement().getStyle().setPaddingLeft(0, Unit.PX); navMenu.getElement().getStyle().setDisplay(Display.BLOCK); } }
public void setSideBarWidth(String sideBarWidth) { this.sideBarWidth = sideBarWidth; mobileNav.setWidth(sideBarWidth + "px"); if (getSideBar().equals("fixed")) { navBar.getElement().getStyle().setPaddingLeft(Double.parseDouble(sideBarWidth), Unit.PX); } }
@UiChild(tagname = "sidebaritem") public void addWidgetSideNav(final Widget item) { ListItem listItem = new ListItem(item); if (item instanceof MaterialCollapsible) { listItem.getElement().getStyle().setBackgroundColor("transparent"); } mobileNav.add(listItem); }
@Override protected void onAttach() { super.onAttach(); String name = String.valueOf(hashCode()); navMenu.addStyleName(sideNav); navMenu.getElement().setAttribute("data-activates", name); mobileNav.getElement().setId(name); initNavBar(Integer.parseInt(getSideBarWidth()), sideNav); }
public void setAlign(String align) { this.align = align; switch (align) { case "right": anchor.addStyleName("left"); navigation.addStyleName("right"); break; case "left": anchor.addStyleName("right"); navigation.addStyleName("left"); break; default: navBar.addStyleName("navbar-fixed"); anchor.addStyleName("left"); navigation.addStyleName("right"); break; } }
public void setType(String type) { this.type = type; switch (type) { case "fixed": navBar.addStyleName("navbar-" + type); break; default: navBar.addStyleName("navbar-fixed"); anchor.addStyleName("left"); navigation.addStyleName("right"); break; } if (type.contains("no-padding")) { wrapper.removeStyleName("container"); } }
@UiChild(tagname = "nav") public void addWidget(final Widget item) { navigation.add(new ListItem(item)); }