[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Widget disposed error in Progress monitor

Hi 
I am using a progress monitor for download process. Got error attached with the error.txt file. I m very less know to what might have happened to the code. 
Here is the place where that is thrown:


        final File targetRootLocation =
            getTargetRootLocation(wizardData).toFile();

        final ProgressMonitorDialog dialogExpand =
            new ProgressMonitorDialog(
                Workbench.getInstance().getActiveWorkbenchWindow().getShell());

        dialogExpand.setCancelable(true);
        dialogExpand.setOpenOnRun(true);

        IRunnableWithProgress runnableWithProgressExpand =
            new IRunnableWithProgress() {
                public void run(final IProgressMonitor monitor)
                    throws InvocationTargetException, InterruptedException {
                    monitor.beginTask(
                        "Unpacking artifacts...",
                        rows.size());

                    for (RowData data : rows) {
                        String artifactDescriptor =
                            data.getValue("artifactDescriptor");

                        DefaultArtifactInfo info =
                            new DefaultArtifactInfo(artifactDescriptor);
                        File fileToExtract = getArtifactFileToUnpack(info);

                        try {
                            if (monitor.isCanceled()) {
                                monitor.done();

                                return;
                            }

                            monitor.setTaskName("Unpacking "
                                + artifactDescriptor);
                            downloader.unpack(targetRootLocation, fileToExtract);
                            monitor.worked(1);
                        } catch (MavenCGException exception) {
                            MessageDialog dialog =
                                new MessageDialog(
                                    workbench.getActiveWorkbenchWindow()
                                                 .getShell(),
                                    "Error importing project(s)",
                                    null,
                                    exception.getCause().getMessage(),
                                    MessageDialog.ERROR,
                                    new String[] {IDialogConstants.OK_LABEL},
                                    IDialogConstants.CLOSE_ID);

                            dialog.create();
                            dialog.open();
                        }
                    }

                    monitor.done();
                }
            };

        try {
            dialogExpand.run(true, true, runnableWithProgressExpand);
        } catch (InvocationTargetException e1) {
            Logger.log(e1);
            displayError(
                workbench,
                e1.getMessage(),
                Phase.UNPACK);
        } catch (InterruptedException e1) {
            Logger.log(e1);
            displayError(
                workbench,
                e1.getMessage(),
                Phase.UNPACK);
        } finally {
            if (dialogExpand != null) {
                dialogExpand.close();
            }
        }


Please let me know if somebody can give any clue on how to fix such a problem.