Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 227240 Details for
Bug 401104
Plug-in Image Browser view: workspace scanner broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch implementing visitor pattern for projects
eclipse.pde.ui.visitor.patch (text/plain), 2.75 KB, created by
Christian Pontesegger
on 2013-02-19 04:47:24 EST
(
hide
)
Description:
Patch implementing visitor pattern for projects
Filename:
MIME Type:
Creator:
Christian Pontesegger
Created:
2013-02-19 04:47:24 EST
Size:
2.75 KB
patch
obsolete
>diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java >index 199fe67..cc68a8b 100644 >--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java >+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/views/imagebrowser/repositories/WorkspaceRepository.java >@@ -34,39 +34,43 @@ > initialize(monitor); > > if (!fProjects.isEmpty()) { >- IProject project = fProjects.get(fProjects.size() - 1); >+ >+ final IProject project = fProjects.remove(0); > > // look for a manifest > IFile manifest = project.getFile("META-INF/MANIFEST.MF"); //$NON-NLS-1$ >+ > if (manifest.exists()) { > try { > // extract plugin name >- String pluginName = getPluginName(manifest.getContents()); >+ final String pluginName = getPluginName(manifest.getContents()); > > // parse all folders >- Collection<IContainer> locations = new HashSet<IContainer>(); >- locations.add(project); >- do { >- IContainer next = locations.iterator().next(); >- locations.remove(next); >+ project.accept(new IResourceProxyVisitor() { > >- for (IResource resource : next.members()) { >- if (monitor.isCanceled()) >- return true; >+ public boolean visit(IResourceProxy proxy) throws CoreException { >+ switch (proxy.getType()) { >+ case IResource.PROJECT : >+ // fall through >+ case IResource.FOLDER : >+ // parse subfolders >+ return true; > >- if (resource instanceof IFile) { >- try { >- if (isImageName(resource.getName().toLowerCase())) >- addImageElement(new ImageElement(createImageData((IFile) resource), pluginName, resource.getProjectRelativePath().toPortableString())); >+ case IResource.FILE : >+ // look for image files >+ try { >+ if (isImageName(proxy.getName().toLowerCase())) >+ addImageElement(new ImageElement(createImageData((IFile) proxy.requestResource()), pluginName, project.getProjectRelativePath().toPortableString())); > >- } catch (Exception e) { >- // could not create image for location >- } >- } else if (resource instanceof IContainer) >- locations.add((IContainer) resource); >+ } catch (Exception e) { >+ // could not create image for location >+ } >+ break; >+ } >+ >+ return false; > } >- >- } while ((!locations.isEmpty()) && (!monitor.isCanceled())); >+ }, IResource.DEPTH_INFINITE, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS | IContainer.INCLUDE_HIDDEN); > } catch (CoreException e) { > PDEPlugin.log(e); > } catch (IOException e) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 401104
:
227225
|
227240
|
227250
|
227291