public Builder(String text) { item = new AnchorListItem(text); }
private AnchorListItem makeListItem( final String text ) { final AnchorListItem item = new AnchorListItem( text ); item.addClickHandler( new ClickHandler() { @Override public void onClick( final ClickEvent event ) { textBox.setText( text ); ComboBox.this.fireEvent( new ValueChangeEvent( text ) ); } } ); return item; }
public Pager() { setStyleName(Styles.PAGER); previous = new AnchorListItem(DEFAULT_PREVIOUS); next = new AnchorListItem(DEFAULT_NEXT); add(previous); add(next); }
public Pager() { setStyleName(Styles.PAGER); previous = new AnchorListItem(DEFAULT_PREVIOUS); next = new AnchorListItem(DEFAULT_NEXT); add(previous); add(next); }
public AnchorListItem addNextLink() { final AnchorListItem listItem = new AnchorListItem(); listItem.setIcon(IconType.ANGLE_DOUBLE_RIGHT); add(listItem); return listItem; }
public AnchorListItem addNextLink() { final AnchorListItem listItem = new AnchorListItem(); listItem.setIcon(IconType.ANGLE_DOUBLE_RIGHT); add(listItem); return listItem; }
public AnchorListItem addPreviousLink() { final AnchorListItem listItem = new AnchorListItem(); listItem.setIcon(IconType.ANGLE_DOUBLE_LEFT); insert(listItem, 0); return listItem; }
public AnchorListItem addPreviousLink() { final AnchorListItem listItem = new AnchorListItem(); listItem.setIcon(IconType.ANGLE_DOUBLE_LEFT); insert(listItem, 0); return listItem; }
@Override public void addTag( final String text ) { AnchorListItem widget = new AnchorListItem( text ); widget.addClickHandler( new ClickHandler() { @Override public void onClick( ClickEvent event ) { presenter.selectTag( text ); } } ); tagListDropdown.add( widget ); }
NavPills pills = new NavPills(); AnchorListItem item1 = new AnchorListItem("Item 1"); item1.setActive(true); pills.add(item1); pills.add(new AnchorListItem("Item 2"); pills.add(new AnchorListItem("Item 3"); ...
private void addNewAnchorLink(DropDownMenu dropDownMenu, String text, PluginType pluginType, boolean available) { if (available) { AnchorListItem anchor = new AnchorListItem(text); anchor.addClickHandler(event -> newPluginPopUp.show(pluginType)); dropDownMenu.add(anchor); } }
private void addNewAnchorLink(DropDownMenu dropDownMenu, String text, PluginType pluginType, boolean available) { if (available) { AnchorListItem anchor = new AnchorListItem(text); anchor.addClickHandler(event -> newPluginPopUp.show(pluginType)); dropDownMenu.add(anchor); } }
@Inject public PhaseConfigFormViewImpl(final DropDownMenu dropdownMenuList, final TranslationService translationService) { this.dropdownMenuList = dropdownMenuList; AnchorListItem constructionHeuristicListItem = new AnchorListItem(translationService.getTranslation(SolverEditorConstants.PhaseConfigFormViewImplConstructionHeuristic)); constructionHeuristicListItem.addClickHandler(h -> presenter.addConstructionHeuristic()); this.dropdownMenuList.add(constructionHeuristicListItem); AnchorListItem localSearchListItem = new AnchorListItem(translationService.getTranslation(SolverEditorConstants.PhaseConfigFormViewImplLocalSearch)); localSearchListItem.addClickHandler(h -> presenter.addLocalSearch()); this.dropdownMenuList.add(localSearchListItem); // TODO add Exhaustive search, ... }
@Override public void setupBreadcrumbs(List<DirectoryBreadcrumb> breadcrumbs, final ParameterizedCommand<String> breadcrumbAction) { dirs.clear(); for (final DirectoryBreadcrumb breadCrumb : breadcrumbs) { final AnchorListItem bread = new AnchorListItem(breadCrumb.getName()); bread.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { breadcrumbAction.execute(breadCrumb.getUri()); } }); dirs.add(bread); } }
@Override public void setupBreadcrumbs(List<DirectoryBreadcrumb> breadcrumbs, final ParameterizedCommand<String> breadcrumbAction) { dirs.clear(); for (final DirectoryBreadcrumb breadCrumb : breadcrumbs) { final AnchorListItem bread = new AnchorListItem(breadCrumb.getName()); bread.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { breadcrumbAction.execute(breadCrumb.getUri()); } }); dirs.add(bread); } }
/** * Adds a new tab to this panel that doesn't have any contents itself, but can contain multiple items that appear in * a dropdown menu when the tab is clicked. This dropdown menu is initially empty. Items can be added and removed * using the {@link DropDownTab#addItem(String, Widget)} and * {@link DropDownTab#removeItem(String, Widget)} methods. * @param label The text that should appear on the dropdown tab. * @return the container for the items that appear when the tab is clicked. */ public DropDownTab addDropdownTab(String label) { AnchorListItem tab = new AnchorListItem(label); // FIXME should actually subclass AnchorListItem and add a <b class=caret/> to the anchor elem tab.setIcon(IconType.ANGLE_DOWN); tab.setIconPosition(IconPosition.RIGHT); tab.addStyleName(Styles.DROPDOWN_TOGGLE); tab.setDataToggle(Toggle.DROPDOWN); DropDownTab dropDownTab = new DropDownTab(tab); tab.add(dropDownTab); addDropdownTab(dropDownTab); return dropDownTab; }
@Override public void setSplashScreenList(final List<SplashScreenListEntry> splashScreens) { dropdown.clear(); for (final SplashScreenListEntry entry : splashScreens) { final AnchorListItem item = new AnchorListItem(entry.getScreenName()); item.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { entry.getShowCommand().execute(); } }); dropdown.add(item); } if (dropdown.getWidgetCount() == 0) { dropdown.add(new DropDownHeader(WorkbenchConstants.INSTANCE.splashScreenNoneAvailable())); } } }
@Override public void setSplashScreenList(final List<SplashScreenListEntry> splashScreens) { dropdown.clear(); for (final SplashScreenListEntry entry : splashScreens) { final AnchorListItem item = new AnchorListItem(entry.getScreenName()); item.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { entry.getShowCommand().execute(); } }); dropdown.add(item); } if (dropdown.getWidgetCount() == 0) { dropdown.add(new DropDownHeader(WorkbenchConstants.INSTANCE.splashScreenNoneAvailable())); } } }
@Override public void buildCrumbs(String modelTitle, String modelHref) { // Clear the existing path. container.clear(); breadCrumbs = new Breadcrumbs(); container.add(breadCrumbs); // Add primary menu label. String primaryLabel = menuDetailsProvider.getLabelFromHref(modelHref); if (primaryLabel != null) { breadCrumbs.add(new ListItem(primaryLabel)); } menuDetailsProvider.setMenuActive(modelHref); // Add main model name. AnchorListItem mainModelAnchor = new AnchorListItem(modelTitle); mainModelAnchor.setHref("#" + modelHref); //$NON-NLS-1$ breadCrumbs.add(mainModelAnchor); if (currentSelectedItemWidget != null && !hideSelectedWidget) { breadCrumbs.add(currentSelectedItemWidget); } }
private void createDropdownMenu() { dropdownMenu = new DropDownMenu(); dropdownMenu.setPull(Pull.LEFT); Set<Integer> refreshRates = AbstractRefreshManager.getRefreshRates(); for (Integer refreshRate : refreshRates) { AnchorListItem refreshRateItem = new AnchorListItem(); refreshRateItem.setText(MillisecondRenderer.getInstance().render(refreshRate)); refreshRateItem.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { refreshManager.setCurrentRefreshRate(refreshRate); removeActiveStyles(); refreshRateItem.addStyleName(Styles.ACTIVE); } }); if (refreshManager.getCurrentRefreshRate() == refreshRate) { refreshRateItem.addStyleName(Styles.ACTIVE); } dropdownMenu.add(refreshRateItem); } }