/** * Removes the item at the specified index. * * @param index the index of the item to be removed * @throws IndexOutOfBoundsException if the index is out of range */ public void removeItem(int index) throws IndexOutOfBoundsException { listBox.removeItem(index); itemValues.remove(index); }
public void removeItem( T item ) { if( item == null ) return; int index = getItemIndex( item ); if( index >= 0 ) list.removeItem( index ); int hashCode = item.hashCode(); items.remove( hashCode ); }
public void removeItem( T item ) { if( item == null ) return; int index = getItemIndex( item ); if( index >= 0 ) list.removeItem( index ); int hashCode = item.hashCode(); items.remove( hashCode ); }
protected void removeItemInternal(int index, boolean reload) { values.remove(index); listBox.removeItem(index); if (reload) { reload(); } }
protected void removeItemInternal(int index, boolean reload) { values.remove(index); listBox.removeItem(index); if (reload) { reload(); } }
@Override public void removeImport( String selected ) { for ( int i = 0; i < importsList.getItemCount(); i++ ) { if ( importsList.getValue( i ).equals( selected ) ) { importsList.removeItem( i ); break; } } }
protected void removeEmptyPlaceHolder() { // indeed the first item/value is emptyPlaceHolder listBox.removeItem(0); values.remove(0); OptionElement currentPlaceholder = getOptionElement(0); if (currentPlaceholder != null) { currentPlaceholder.setDisabled(false); } }
@Override public void removeImport( String selected ) { for ( int i = 0; i < importsList.getItemCount(); i++ ) { if ( importsList.getValue( i ).equals( selected ) ) { importsList.removeItem( i ); break; } } }
protected void removeEmptyPlaceHolder() { // indeed the first item/value is emptyPlaceHolder listBox.removeItem(0); values.remove(0); OptionElement currentPlaceholder = getOptionElement(0); if (currentPlaceholder != null) { currentPlaceholder.setDisabled(false); } }
@UiHandler("Up") void UpClick(ClickEvent e) { ListBox item; int i=item.getSelectedIndex(); if(i>0){ // add duplicated item in the list item.insertItem(item.getItemText(i),i-1); // delete the old occurence of this item item.removeItem(i+1); } } @UiHandler("Down") void DownClick(ClickEvent e) { int i=item.getSelectedIndex(); if((i!=-1) && (i<item.getItemCount()-1)) { item.insertItem(item.getItemText(i),i+2); item.removeItem(i); } }
public void onClick(ClickEvent event) { if (box.getSelectedIndex() == -1) { Window.alert(TestScenarioConstants.INSTANCE.PleaseChooseARuleToRemove()); } else { String r = box.getItemText(box.getSelectedIndex()); sc.getRules().remove(r); box.removeItem(box.getSelectedIndex()); } } });
protected static Set<String> moveSelectedItems(ListBox source, ListBox target) { final boolean[] sel = getSelectionBitmap(source); final Set<String> movedItems = new HashSet<>(); for (int i = 0; i < sel.length; i++) { if (sel[i]) { final int optionIndex = i - (sel.length - source.getItemCount()); movedItems.add(source.getValue(optionIndex)); // Move selection to another column final String text = source.getItemText(optionIndex); final String value = source.getValue(optionIndex); target.addItem(text, value); target.setItemSelected(target.getItemCount() - 1, true); source.removeItem(optionIndex); } } target.setFocus(true); return movedItems; }
public void update() { SearchRequest request = context.getCurrentRequest(); if (!context.isInstitution()) { List<EIURI> institutionUriList = request.getProviderInstitutionList(); if ( institutionUriList != null && institutionUriList.size() > 0) { // Selected institutions should be the third item in the list (only add if smaller) if (institutionListBox.getItemCount() < 3) { institutionListBox.addItem("Selected Collections"); } institutionListBox.setSelectedIndex(institutionListBox.getItemCount() - 1); } else { // Selected Institutions item should be last (if present) if (institutionListBox.getValue(institutionListBox.getItemCount() - 1).equals("Selected Collections")) { institutionListBox.removeItem(institutionListBox.getItemCount() - 1); // All Institutions item should be first institutionListBox.setSelectedIndex(0); } } } } }
@Override public void onClick(final ClickEvent arg0) { if ( providerFilter.getItemCount() == 1 ) { // Populate the list only // if it is not already // populated providerFilter.removeItem( providerFilter.getItemCount() - 1 ); providerFilter.addItem( "List is loading...." ); final AuthSearchRequest request = new AuthSearchRequest(); request.setType( ResourceProvider.BASE_RESOURCE_CONTAINER_URI ); // FIXME enable request.setPaginated( false ); ClientSweetProxy.getInstance().listResources( request, SortByProperties.LABEL, true, false, false, false, new RootAsyncCallback<List<EIInstanceMinimal>>() { @Override public void onSuccess(final List<EIInstanceMinimal> eiInstanceList) { providerFilter.removeItem( providerFilter.getItemCount() - 1 ); providerFilter.addItem( genericOption ); for (final EIInstanceMinimal instance : eiInstanceList) { providerFilter.addItem( instance.getInstanceLabel(), instance.getInstanceURI().toString() ); if ( instance.getEntity().equals( filterProviderEntity ) ) { providerFilter.setSelectedIndex( providerFilter.getItemCount() - 1 ); } } } } ); } } } );