service.reindexCollection(next.toString());
service.reindexCollection(next.getName());
	private void reindexAction(ActionEvent ev) {	    final int[] rows = fileman.getSelectedRows();	    Object[] res;	    if(rows.length == 0) {	        res = new Object[1];	        res[0] = new InteractiveClient.CollectionName(client.path);	    } else {			res = new Object[rows.length];			for (int i = 0; i < rows.length; i++) {				res[i] = resources.getValueAt(rows[i], 3);				if(!(res[i] instanceof InteractiveClient.CollectionName)) {				    JOptionPane.showMessageDialog(this, "Only collections can be reindexed.", "Error", JOptionPane.ERROR_MESSAGE);				    return;				}			}	    }	    	    if (JOptionPane.showConfirmDialog(this,				"Are you sure you want to reindex the selected collections \nand all resources below them?",				"Confirm reindex", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {	        final Object collections[] = res;	        Runnable reindexThread = new Runnable() {                public void run() {                    ClientFrame.this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));                    IndexQueryService service;                    try {                        service = (IndexQueryService)                         	client.current.getService("IndexQueryService", "1.0");                        for(int i = 0; i < collections.length; i++) {                            InteractiveClient.CollectionName next = (InteractiveClient.CollectionName)collections[i];                            setStatus("Reindexing collection " + next + "...");                            service.reindexCollection(next.toString());                        }                        setStatus("Reindex completed.");                    } catch (XMLDBException e) {                        showErrorMessage(e.getMessage(), e);                    }                    ClientFrame.this.setCursor(Cursor.getDefaultCursor());                }	        };	        new Thread(reindexThread).start();	    }	}