Skip to content

Commit 91f9a51

Browse files
committed
remove ProgressDialog
In previous versions performance was an issue so a ProgressMonitor was implemented for opening zip files. Now it is useless and is thus be removed.
1 parent 18bcfd8 commit 91f9a51

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/fileSystem/zip/OpenZipFileHandler.java

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,14 @@
1212

1313
package org.eclipse.ui.ide.fileSystem.zip;
1414

15-
import java.lang.reflect.InvocationTargetException;
1615
import java.net.URISyntaxException;
1716

1817
import org.eclipse.core.commands.AbstractHandler;
1918
import org.eclipse.core.commands.ExecutionEvent;
2019
import org.eclipse.core.resources.IFile;
2120
import org.eclipse.core.resources.ZipFileTransformer;
2221
import org.eclipse.core.runtime.CoreException;
23-
import org.eclipse.core.runtime.IProgressMonitor;
2422
import org.eclipse.jface.dialogs.MessageDialog;
25-
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
26-
import org.eclipse.jface.operation.IRunnableWithProgress;
2723
import org.eclipse.jface.viewers.ISelection;
2824
import org.eclipse.jface.viewers.IStructuredSelection;
2925
import org.eclipse.swt.widgets.Shell;
@@ -45,33 +41,21 @@ public class OpenZipFileHandler extends AbstractHandler {
4541
@Override
4642
public Object execute(ExecutionEvent event) {
4743
Shell shell = HandlerUtil.getActiveShell(event);
48-
ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
4944
ISelection selection = HandlerUtil.getCurrentSelection(event);
5045
if (!(selection instanceof IStructuredSelection)) {
5146
return null;
5247
}
5348

5449
Object element = ((IStructuredSelection) selection).getFirstElement();
55-
5650
if (!(element instanceof IFile)) {
5751
return null;
5852
}
59-
try {
60-
dialog.run(true, false, new IRunnableWithProgress() {
61-
@Override
62-
public void run(IProgressMonitor monitor) throws InterruptedException {
63-
monitor.beginTask("Opening Zip File", 5); //$NON-NLS-1$
64-
try {
65-
ZipFileTransformer.openZipFile((IFile) element, monitor, true);
66-
} catch (URISyntaxException | CoreException e) {
67-
throw new InterruptedException(e.getMessage());
68-
}
69-
monitor.worked(1);
70-
}
71-
});
72-
} catch (InterruptedException | InvocationTargetException e) {
73-
MessageDialog.openError(shell, "Error opening zip file", e.getMessage()); //$NON-NLS-1$
74-
}
53+
54+
try {
55+
ZipFileTransformer.openZipFile((IFile) element, true);
56+
} catch (CoreException | URISyntaxException e) {
57+
MessageDialog.openError(shell, "Error opening zip file", e.getMessage()); //$NON-NLS-1$
58+
}
7559
return null;
7660
}
7761
}

0 commit comments

Comments
 (0)