Author: snjeza
Date: 2010-06-02 15:48:50 -0400 (Wed, 02 Jun 2010)
New Revision: 22495
Modified:
branches/3.2.helios/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
Log:
https://jira.jboss.org/browse/JBIDE-6395 [Helios] Project Examples not loading once
selected?
Modified:
branches/3.2.helios/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
---
branches/3.2.helios/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2010-06-02
18:52:36 UTC (rev 22494)
+++
branches/3.2.helios/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2010-06-02
19:48:50 UTC (rev 22495)
@@ -67,6 +67,7 @@
import org.eclipse.ui.internal.cheatsheets.state.DefaultStateManager;
import org.eclipse.ui.internal.cheatsheets.views.CheatSheetView;
import org.eclipse.ui.internal.cheatsheets.views.ViewUtilities;
+import org.eclipse.ui.internal.wizards.datatransfer.ZipLeveledStructureProvider;
import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
import org.eclipse.ui.wizards.datatransfer.ImportOperation;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
@@ -350,7 +351,7 @@
project.create(monitor);
project.open(monitor);
ZipFile sourceFile = new ZipFile(file);
- ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(
+ ZipLeveledStructureProvider structureProvider = new ZipLeveledStructureProvider(
sourceFile);
Enumeration<? extends ZipEntry> entries = sourceFile.entries();
@@ -363,12 +364,9 @@
filesToImport.add(entry);
}
}
- //ZipEntry entry = sourceFile.getEntry(projectName);
- //List filesToImport = prepareFileList(structureProvider, entry, null);
-
- ImportOperation operation = new ImportOperation(workspace
- .getRoot().getFullPath(), structureProvider.getRoot(),
+ structureProvider.setStrip(1);
+ ImportOperation operation = new ImportOperation(project.getFullPath(),
structureProvider.getRoot(),
structureProvider, OVERWRITE_ALL_QUERY, filesToImport);
operation.setContext(getActiveShell());
operation.run(monitor);
@@ -413,10 +411,11 @@
project.create(monitor);
project.open(monitor);
ZipFile sourceFile = new ZipFile(file);
- ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(
+ ZipLeveledStructureProvider structureProvider = new ZipLeveledStructureProvider(
sourceFile);
-
- ImportOperation operation = new ImportOperation(workspace.getRoot()
+
+ structureProvider.setStrip(1);
+ ImportOperation operation = new ImportOperation(project
.getFullPath(), structureProvider.getRoot(), structureProvider,
OVERWRITE_ALL_QUERY);
operation.setContext(getActiveShell());