ProgressMonitor monitor = new ProgressMonitor(ClientFrame.this, "Remove Progress", "", 1, rows.length); monitor.setMillisToDecideToPopup(500); monitor.setMillisToPopup(500); for (int i = 0; i < rows.length; i++) { Object resource = res[i]; if (resource instanceof InteractiveClient.CollectionName) { try { CollectionManagementService mgtService = (CollectionManagementService) client.current .getService( "CollectionManagementService", "1.0"); mgtService .removeCollection(resource.toString()); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } } else { try { Resource res = client.current .getResource(resource.toString()); client.current.removeResource(res); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } } monitor.setProgress(i + 1); if (monitor.isCanceled()) return; } try { client.getResources(); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } }
ProgressMonitor monitor = new ProgressMonitor(ClientFrame.this, "Remove Progress", "", 1, res.length); monitor.setMillisToDecideToPopup(500); monitor.setMillisToPopup(500); for (int i = 0; i < res.length; i++) { ResourceDescriptor resource = res[i]; if (resource.isCollection()) { try { CollectionManagementService mgtService = (CollectionManagementService) client.current .getService( "CollectionManagementService", "1.0"); mgtService .removeCollection(resource.getName()); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } } else { try { Resource res = client.current .getResource(resource.getName()); client.current.removeResource(res); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } } monitor.setProgress(i + 1); if (monitor.isCanceled()) return; } try { client.getResources(); } catch (XMLDBException e) { showErrorMessage(e.getMessage(), e); } }
				public void run() {					ProgressMonitor monitor = new ProgressMonitor(ClientFrame.this,							"Remove Progress", "", 1, rows.length);					monitor.setMillisToDecideToPopup(500);					monitor.setMillisToPopup(500);					for (int i = 0; i < rows.length; i++) {						Object resource = res[i];						if (resource instanceof InteractiveClient.CollectionName) {							try {								CollectionManagementService mgtService = (CollectionManagementService) client.current										.getService(												"CollectionManagementService",												"1.0");								mgtService										.removeCollection(resource.toString());							} catch (XMLDBException e) {								showErrorMessage(e.getMessage(), e);							}						} else {							try {								Resource res = client.current										.getResource(resource.toString());								client.current.removeResource(res);							} catch (XMLDBException e) {								showErrorMessage(e.getMessage(), e);							}						}						monitor.setProgress(i + 1);						if (monitor.isCanceled())							return;					}					try {						client.getResources();					} catch (XMLDBException e) {						showErrorMessage(e.getMessage(), e);					}				}