public void build( final List<FolderItem> segments, final FolderItem file, final ParameterizedCommand<FolderItem> onPathClick, final Dropdown... headers) { build(headers); if (segments != null) { for (final FolderItem activeItem : segments) { breadcrumbs.add( new NavLink(activeItem.getFileName()) { { setStyleName(NavigatorResources.INSTANCE.css().directory()); addClickHandler( new ClickHandler() { @Override public void onClick(ClickEvent event) { onPathClick.execute(activeItem); } }); } }); } if (file != null) { breadcrumbs.add( new ListItem(new InlineLabel(file.getFileName())) { { setStyleName(NavigatorResources.INSTANCE.css().directory()); } }); } } }
public void build(final Dropdown... headers) { breadcrumbs.clear(); for (int i = 0; i < headers.length; i++) { final Dropdown header = headers[i]; header.addStyleName(NavigatorResources.INSTANCE.css().breadcrumbHeader()); if (i + 1 == headers.length) { header.setRightDropdown(true); } breadcrumbs.add(header); } }
public NavigatorBreadcrumbs(final Mode mode) { initWidget(breadcrumbs); if (mode != null) { switch (mode) { case HEADER: breadcrumbs.removeStyleName(Constants.BREADCRUMB); breadcrumbs.setStyleName(NavigatorResources.INSTANCE.css().breadcrumb()); break; case SECOND_LEVEL: breadcrumbs.addStyleName(NavigatorResources.INSTANCE.css().breadcrumb2ndLevel()); break; } } }