setStatus("Move completed.");
setStatus("Copy completed.");
    private void copyAction(ActionEvent ev) {        final ResourceDescriptor[] res = getSelectedResources();                String[] collections = null;        try {            Collection root = client.getCollection(DBBroker.ROOT_COLLECTION);            Vector collectionsVec = getCollections(root, new Vector());            collections = new String[collectionsVec.size()];            collectionsVec.toArray(collections);        } catch (XMLDBException e) {            showErrorMessage(e.getMessage(), e);            return;        }        Object val = JOptionPane.showInputDialog(this, "Select target collection", "Move", JOptionPane.QUESTION_MESSAGE,                null, collections, collections[0]);        if(val == null)            return;        final String destinationPath = (String)val;        Runnable moveTask = new Runnable() {            public void run() {                try {                    CollectionManagementServiceImpl service = (CollectionManagementServiceImpl)                    client.current.getService("CollectionManagementService", "1.0");                    for(int i = 0; i < res.length; i++) {                        setStatus("Copying " + res[i].getName() + " to " + destinationPath + "...");                        if(res[i].isCollection())                            service.copy(res[i].getName(), destinationPath, null);                        else                            service.copyResource(res[i].getName(), destinationPath, null);                    }                    client.reloadCollection();                } catch (XMLDBException e) {                    showErrorMessage(e.getMessage(), e);                }                setStatus("Move completed.");            }        };        new Thread(moveTask).start();    }