@Override public void actionPerformed(ActionEvent ae) { Object o = queueList.getSelectedValue(); while (o != null) { queueListModel.removeElement(o); o = queueList.getSelectedValue(); } updateUI(); } };
private void removeSelectedListItems() { Object[] selectedValues = list.getSelectedValues(); boolean itemsSelected = selectedValues.length > 0; if (itemsSelected && confirmRemove()) { for (Object selectedValue : selectedValues) { listModel.removeElement(selectedValue); } } }
private void aggiungiTitolareButtonActionPerformed(java.awt.event.ActionEvent evt) { DefaultListModel lm2 = (DefaultListModel) listaTitolari.getModel(); DefaultListModel lm1 = (DefaultListModel) listaRosa.getModel(); if(lm2 == null) { lm2 = new DefaultListModel(); listaTitolari.setModel(lm2); } lm2.addElement(listaTitolari.getSelectedValue()); lm1.removeElement(listaTitolari.getSelectedValue()); }
/** * Removes the first (lowest-indexed) occurrence of the argument from this * list. * * @param obj the component to be removed * @return true if the argument was a component of this list; false * otherwise */ @Override public boolean removeElement(Object obj) { if (!(obj instanceof CheckBoxListItem)) { return super.removeElement(new CheckBoxListItem(obj)); } else { return super.removeElement(obj); } }
dropIndex--; model.removeElement(draggedImage); model.add(dropIndex, draggedImage); return true;
for (ItemList itemSelected: selectedValues) { int l = this.listModel.indexOf(itemSelected); this.listModel.removeElement(itemSelected); if (l == this.listModel.getSize()) { this.setSelectedIndex(l - 1);
public boolean removeElement(Object obj) { modified = true; return super.removeElement(obj); } //}}}
private void bJavaDocRemoveActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bJavaDocRemoveActionPerformed final Object selected = lJavaDocPaths.getSelectedValue(); if (selected == null) return; int i = lJavaDocPaths.getSelectedIndex(); mJavaDocs.removeElement(selected); if (i >= lJavaDocPaths.getModel().getSize()) i--; if (i >= 0)lJavaDocPaths.setSelectedIndex(i); refreshButtons(); }//GEN-LAST:event_bJavaDocRemoveActionPerformed
private void moveElementsFromListToOtherList(JList sourceList, JList targetList) { DefaultListModel sourceModel, targetModel; sourceModel = (DefaultListModel) sourceList.getModel(); targetModel = (DefaultListModel) targetList.getModel(); Object[] selection = sourceList.getSelectedValues(); for (Object element : selection) { sourceModel.removeElement(element); targetModel.addElement(element); } }
public void removeHandle(InternalHandle handle) { if (explicit == handle) { explicit = null; } synchronized (model) { model.removeElement(handle); } updateSelection(); }
public void setLoading(boolean loading) { this.loading = loading; if(loading){ completionListModel.removeAllElements(); completionListModel.addElement(LOADING); }else{ completionListModel.removeElement(LOADING); } }
/** * Removes a component from the menu * @param component The component to remove */ public void remove(Component component) { carousel.remove(component); MenuItem menuItem = menuMap.remove(component); if (menuItem != null) { menuItems.remove(menuItem); menuModel.removeElement(menuItem); } }
private void removeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeActionPerformed for (Object value : selection.getSelectedValuesList()) { Requirement req = (Requirement) value; ((DefaultListModel) selection.getModel()).removeElement(req); } }//GEN-LAST:event_removeActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables
public void actionPerformed(ActionEvent event) { Object[] selectedValues = fromList_.getSelectedValues(); for(int i = 0; i < selectedValues.length; ++i) { fromModel_.removeElement(selectedValues[i]); toModel_.addElement(selectedValues[i]); } ((JButton)event.getSource()).setEnabled(false); } }
public void actionPerformed(ActionEvent e) { Object[] cs = colors.getSelectedValues(); for(int i=0; i<cs.length; i++) { lm.removeElement(cs[i]); } setColorScheme(panel, lm, cycle.isSelected()); } });
private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed Object[] selection = this.roots.getSelectedValues (); for (int i=0; i<selection.length; i++) { ((DefaultListModel)this.roots.getModel()).removeElement (selection[i]); } this.firePropertyChange(PROP_FILES, null, null); }//GEN-LAST:event_removeButtonActionPerformed
@Override public boolean removeElement(Object obj) { if (super.removeElement(obj)) { int idx = historyIdToIndex.remove(((HistoryReference) obj).getHistoryId()); updateIndexes(idx); return true; } return false; }
public void dragDropEnd(DragSourceDropEvent dsde) { if (!dsde.getDropSuccess()) { return; } if (this.movedList != null) { for (Object aMovedList : this.movedList) { ((DefaultListModel) getModel()).removeElement(aMovedList); } this.movedList = null; } }
public void dragDropEnd(DragSourceDropEvent dsde) { if (!dsde.getDropSuccess()) { return; } if (this.movedList != null) { for (Object e : this.movedList) { ((DefaultListModel) getModel()).removeElement(e); } this.movedList = null; } }
void removeFileButton_actionPerformed(ActionEvent e) { try { for (Iterator i = getSelectedTestFiles().iterator(); i.hasNext(); ) { fileListModel.removeElement(i.next()); } saveProperties(); updateEnabled(); } catch (Exception x) { reportException(x); } }