90 import org.eclipse.ui.internal.wizards.datatransfer.TarLeveledStructureProvider; |
90 import org.eclipse.ui.internal.wizards.datatransfer.TarLeveledStructureProvider; |
91 import org.eclipse.ui.internal.wizards.datatransfer.ZipLeveledStructureProvider; |
91 import org.eclipse.ui.internal.wizards.datatransfer.ZipLeveledStructureProvider; |
92 import org.eclipse.ui.statushandlers.StatusManager; |
92 import org.eclipse.ui.statushandlers.StatusManager; |
93 import org.eclipse.ui.wizards.datatransfer.ImportOperation; |
93 import org.eclipse.ui.wizards.datatransfer.ImportOperation; |
94 import org.symbian.tools.wrttools.Activator; |
94 import org.symbian.tools.wrttools.Activator; |
|
95 import org.symbian.tools.wrttools.util.CoreUtil; |
95 import org.symbian.tools.wrttools.util.ProjectUtils; |
96 import org.symbian.tools.wrttools.util.ProjectUtils; |
96 |
97 |
97 @SuppressWarnings({"restriction", "unchecked"}) |
98 @SuppressWarnings({"restriction", "unchecked"}) |
98 public class WrtProjectLocationWizardPage extends WizardPage implements |
99 public class WrtProjectLocationWizardPage extends WizardPage implements |
99 IOverwriteQuery { |
100 IOverwriteQuery { |
306 List children = structureProvider.getChildren(entry); |
307 List children = structureProvider.getChildren(entry); |
307 if (children == null) { |
308 if (children == null) { |
308 children = new ArrayList(1); |
309 children = new ArrayList(1); |
309 } |
310 } |
310 Iterator childrenEnum = children.iterator(); |
311 Iterator childrenEnum = children.iterator(); |
311 boolean hasPreviewFolder = false; |
|
312 boolean hasFrameHtml = false; |
|
313 ProjectRecord projectRecord = null; |
312 ProjectRecord projectRecord = null; |
|
313 Object infoPlist = null; |
|
314 Object dotProject = null; |
314 while (childrenEnum.hasNext()) { |
315 while (childrenEnum.hasNext()) { |
315 Object child = childrenEnum.next(); |
316 Object child = childrenEnum.next(); |
316 String elementLabel = structureProvider.getLabel(child); |
317 String elementLabel = structureProvider.getLabel(child); |
317 if (structureProvider.isFolder(child)) { |
318 if (structureProvider.isFolder(child)) { |
318 if (ProjectUtils.PREVIEW_FOLDER.equalsIgnoreCase(elementLabel)) { |
319 collectProjectFilesFromProvider(files, child, level + 1, monitor); |
319 hasPreviewFolder = true; |
320 } else if (elementLabel.equalsIgnoreCase(IProjectDescription.DESCRIPTION_FILE_NAME)) { |
320 } |
321 dotProject = child; |
321 collectProjectFilesFromProvider(files, child, level + 1, |
322 } else if (elementLabel.equalsIgnoreCase(CoreUtil.METADATA_FILE)) { |
322 monitor); |
323 infoPlist = child; |
323 } |
324 } |
324 if (elementLabel.equals(IProjectDescription.DESCRIPTION_FILE_NAME)) { |
325 } |
325 projectRecord = new ArchivedProject(child, entry, level, structureProvider); |
326 if (infoPlist != null) { |
326 } |
327 projectRecord = new ArchivedProject(infoPlist, dotProject, entry, level, structureProvider); |
327 if (ProjectUtils.PREVIEW_FRAME_FILE.equalsIgnoreCase(elementLabel)) { |
328 files.add(projectRecord); |
328 hasFrameHtml = true; |
329 } |
329 } |
|
330 } |
|
331 if (projectRecord != null && hasPreviewFolder && hasFrameHtml) { |
|
332 files.add(projectRecord); |
|
333 } |
|
334 return true; |
330 return true; |
335 } |
331 } |
336 |
332 |
337 /* |
333 /* |
338 * (non-Javadoc) |
334 * (non-Javadoc) |