Bug 200757 - [Manifest Editor] Filter out non-java resources when exporting packages
Summary: [Manifest Editor] Filter out non-java resources when exporting packages
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Joern Dinkla CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2007-08-22 00:40 EDT by Chris Aniszczyk CLA
Modified: 2007-08-28 18:22 EDT (History)
3 users (show)

See Also:


Attachments
mylyn/context/zip (921 bytes, application/octet-stream)
2007-08-27 10:40 EDT, Chris Aniszczyk CLA
no flags Details
Patch for defect 200757 (6.15 KB, patch)
2007-08-28 16:19 EDT, Joern Dinkla CLA
no flags Details | Diff
mylyn/context/zip (10.27 KB, application/octet-stream)
2007-08-28 16:19 EDT, Joern Dinkla CLA
no flags Details
mylyn/context/zip (918 bytes, application/octet-stream)
2007-08-28 17:34 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2007-08-22 00:40:05 EDT
If you export packages via the Runtime tab on the Manifest editor, the popup dialog should have a filter similar to the Import Packages popup dialog but slightly different. 

It should be "Show non-java packages" and it shouldn't be check by default.
Comment 1 Joern Dinkla CLA 2007-08-26 17:16:07 EDT
This is a nice one for the bugday in August for me. 


The popup dialog should initially show only Java packages and after the checkbox has been checked the non java packages too. 
Comment 2 Brian Bauman CLA 2007-08-26 23:56:08 EDT
Thanks for taking this!  Your algorithm is spot on, only java packages at first then allow the user to add non-java packages if they select the filter.
Comment 3 Chris Aniszczyk CLA 2007-08-27 10:40:37 EDT
If you need inspiration, take a look at ImportPackageSection and how it does the filtering.

I'm attaching a Mylyn context to help you out if you use Mylyn which will bring up these two files automatically for you.
Comment 4 Chris Aniszczyk CLA 2007-08-27 10:40:41 EDT
Created attachment 77031 [details]
mylyn/context/zip
Comment 5 bartosz michalik CLA 2007-08-28 03:07:24 EDT
I can take it :) 
maybe i won't have time at friday but in such case i will take care about it during the weekend :)
Comment 6 bartosz michalik CLA 2007-08-28 03:09:37 EDT
Ok it's to early in the morning to notice that it's already taken ;)

sorry Joern :)
Comment 7 Joern Dinkla CLA 2007-08-28 16:18:33 EDT
Thanks for the Mylyn context. That was very helpful.

I compared the handleAdd() methods in ImportPackageSection and ExportPackageSection.

ExportPackageSection uses the PDEJavaHelper.getPackageFragments() method and the PackageSelectionDialog to obtain and show the packages.

I replaced this dialog with the ConditionalListSelectionDialog that is used in the ImportPackageSection. I use the same pattern including the Runnable and the BusyIndicator.

At the moment i am not sure what a "non-Java package" is. I assume, when IPackageFragment.containsJavaResources() is false. If this is wrong, please correct me.

I looked at the filtering code in ImportPackageSection.setElements() method, but i think it is easier to reuse the PDEJavaHelper.getPackageFragments() and to filter the packages returned with containsJavaResources().

Patch will follow ...
Comment 8 Joern Dinkla CLA 2007-08-28 16:19:22 EDT
Created attachment 77171 [details]
Patch for defect 200757
Comment 9 Joern Dinkla CLA 2007-08-28 16:19:25 EDT
Created attachment 77172 [details]
mylyn/context/zip
Comment 10 Chris Aniszczyk CLA 2007-08-28 17:34:35 EDT
Works beautifully.

By the way, if you want to help out another project that hasn't received that much love this week for bugday, Platform Debug has a simple one open: https://bugs.eclipse.org/bugs/show_bug.cgi?id=51710
Comment 11 Chris Aniszczyk CLA 2007-08-28 17:34:41 EDT
Created attachment 77187 [details]
mylyn/context/zip
Comment 12 Chris Aniszczyk CLA 2007-08-28 17:57:14 EDT
updated milestone
Comment 13 Chris Aniszczyk CLA 2007-08-28 18:22:35 EDT
setting to M2