private void updateUI() { Utils.setConfigList("queue", (Enumeration<Object>) queueListModel.elements()); if (queueListModel.size() == 0) { MainWindow.optionQueue.setText("Queue"); } else { MainWindow.optionQueue.setText("Queue (" + queueListModel.size() + ")"); } } @Override
final Enumeration<?> elements = keywordListModel.elements(); while (elements.hasMoreElements()) { keywordsBuilder.append(elements.nextElement());
@SuppressWarnings("unchecked") private void ripNextAlbum() { isRipping = true; // Save current state of queue to configuration. Utils.setConfigList("queue", (Enumeration<Object>) queueListModel.elements()); if (queueListModel.isEmpty()) { // End of queue isRipping = false; return; } String nextAlbum = (String) queueListModel.remove(0); updateQueueLabel(); Thread t = ripAlbum(nextAlbum); if (t == null) { try { Thread.sleep(500); } catch (InterruptedException ie) { LOGGER.error(rb.getString("interrupted.while.waiting.to.rip.next.album"), ie); } ripNextAlbum(); } else { t.start(); } }
/** * @return the items in the list */ public Collection getItems() { return java.util.Collections.list(m_model.elements()); }
private static List<Item> getList(final DefaultListModel model) { @SuppressWarnings("unchecked") List<Item> items = (List<Item>) Collections.list(model.elements()); return items; }
@NotNull public java.util.List<String> getMyList() { return Collections.list(myListModel.elements()); } }
public List<T> getElements() { List<T> elementList = new ArrayList<T>(); Enumeration en = model.elements(); if (en != null) { while (en.hasMoreElements()) { elementList.add((T) en.nextElement()); } } return elementList; }
/** * Gets the current data. * * @return */ public List<String> getData() { List<String> list = new ArrayList<>(); Enumeration<String> e = data.elements(); while (e.hasMoreElements()) { list.add(e.nextElement()); } return list; }
@Override public File[] getValue() { DefaultListModel<File> listModel = // (DefaultListModel<File>) paths.getModel(); List<File> fileList = Collections.list(listModel.elements()); return fileList.toArray(new File[fileList.size()]); }
private List<E> extractElements(DefaultListModel<E> listModel) { Enumeration<E> iterator = listModel.elements(); List<E> toret = new LinkedList<>(); while(iterator.hasMoreElements()) { toret.add(iterator.nextElement()); } return toret; } }
public ModelNode getValue() { ModelNode value = new ModelNode(); for (Enumeration elements = listModel.elements(); elements.hasMoreElements(); ) { value.add(elements.nextElement().toString()); } return value; }
/** * Returns the media list as a string separated by space. */ public String getMediaAsString() { StringBuffer buffer = new StringBuffer(); Enumeration e = listModel.elements(); while (e.hasMoreElements()) { buffer.append((String)e.nextElement()); buffer.append( ' ' ); } return buffer.toString(); }
public ModelNode getValue() { ModelNode value = new ModelNode(); for (Enumeration elements = listModel.elements(); elements.hasMoreElements(); ) { value.add(elements.nextElement().toString()); } return value; }
/** * Returns the media list as a string separated by space. */ public String getMediaAsString() { StringBuffer buffer = new StringBuffer(); Enumeration e = listModel.elements(); while (e.hasMoreElements()) { buffer.append((String)e.nextElement()); buffer.append( ' ' ); } return buffer.toString(); }
/** * Returns the list of media. */ public List getMedia() { List media = new ArrayList(listModel.size()); Enumeration e = listModel.elements(); while (e.hasMoreElements()) { media.add(e.nextElement()); } return media; }
/** * Returns the list of media. */ public List getMedia() { List media = new ArrayList(listModel.size()); Enumeration e = listModel.elements(); while (e.hasMoreElements()) { media.add(e.nextElement()); } return media; }
public static List<BasePathSupport.Item> getList(DefaultListModel<BasePathSupport.Item> model) { return Collections.list(NbCollections.checkedEnumerationByFilter(model.elements(), BasePathSupport.Item.class, true)); }
private Set<String> getRegistries() { Set<String> ret = new HashSet<>(model.size()); for (Enumeration<CredentialsItem> e = model.elements(); e.hasMoreElements(); ) { CredentialsItem i = e.nextElement(); ret.add(i.getCredentials().getRegistry()); } return ret; }
public final void dump() { Enumeration e=getModel().elements(); int n=0; while(e.hasMoreElements()) { Object o=e.nextElement(); String k="BRG: "+(n++)+") "+o.getClass().getName(); if(o instanceof Frame) k+=" "+((Frame)o).getTitle(); if(k.length()>75) k=k.substring(0,75); //while(k.length()<36) k=k+" "; FuLog.debug(k); } }
public void sortPlayer() { List<Player> players = Collections.list(getUserModel().elements()); Collections.sort(players); getUserModel().removeAllElements(); for (Player p : players) { getUserModel().addElement(p); } }