Bug 181878

Summary: [Site Editor] Multi-select love is needed
Product: [Eclipse Project] PDE Reporter: Chris Aniszczyk <caniszczyk>
Component: UIAssignee: bartosz michalik <bartosz.michalik>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bartosz.michalik
Version: 3.3Keywords: bugday, contributed
Target Milestone: 3.4 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch proposal almost all specified function covered
none
updateButtons changed
none
mylyn/context/zip
none
sync action updated
none
mylyn/context/zip none

Description Chris Aniszczyk CLA 2007-04-10 23:47:06 EDT
It would be nice if we could multi-select things in the site editor to be consistent with our other editors.
Comment 1 Wassim Melhem CLA 2007-04-11 00:17:46 EDT
you're supposed to be closing bugs, not opening new ones ;)
Comment 2 bartosz michalik CLA 2007-08-28 12:28:28 EDT
I believe this is something that I want to take care during bug day. Could you explain me in more details what do U mean by site editor (update site editor or sth else) ?
Comment 3 Chris Aniszczyk CLA 2007-08-28 12:43:28 EDT
Hi Bartosz, it's yours.

This basically means that you can't multiselect things on the Site Map page. For example, say you add a ton of features... and you want to delete some... you have to do it one at a time.

Pretty much of all of our editors allow multi-select so you can delete multiple entries. See IncludedFeaturesSection for an example.
Comment 4 bartosz michalik CLA 2007-08-28 12:53:06 EDT
there is couple things to consider (and there will be more when i know the code).
first of all what should be displayed in features properties environment tabs ?
i believe that information about the first element from selection.
should the remove button should be added ?
I assume that if we want to be consistent with other parts of pde we should do that.
If I'm wrong please correct me.

Will this change (adding multiselect affect of revert save etc. behaviour) ?
Comment 5 Chris Aniszczyk CLA 2007-08-28 13:10:02 EDT
I think enabling multi-select similar to how the Included Features page on the Feature Editor (org.eclipse.pde.internal.ui.editor.feature.IncludedFeaturesSection.java).

1) Allow for ctrl+a and shift multi select on the tree (SWT.MULTI)
2) handle deletes properly
3) The SynchronizeAction needs to be update to handle multiple selections

That's all, don't worry about other issues.
Comment 6 bartosz michalik CLA 2007-09-03 03:44:13 EDT
I have some question about handling 2)

what should happen if one of handleRemove... fails ? next object from selection should be processed then?
what result should be returned if one of removals fails ?
Comment 7 bartosz michalik CLA 2007-09-03 04:39:32 EDT
Created attachment 77571 [details]
patch proposal almost all specified function covered

The only thing left to discus is how to treat categories in selection during build.
There are two options: 
 - add all features from selected category to build set
 - filter categories from selection

I've also left updateButtons unchanged for now. And another question appears:
if any category is selected should Build button be enabled or not ?
Comment 8 Chris Aniszczyk CLA 2007-09-03 13:17:38 EDT
Lets keep it simple now and like it was before, if a category is selected, we will disable the build button.

The most common use case is for people to usually build the whole update site. Sometimes people also desire just to build a feature versus everything. This should be sufficient.

Attach a new patch and I will review and commit it. Thanks Bartosz!
Comment 9 bartosz michalik CLA 2007-09-04 04:56:37 EDT
Created attachment 77627 [details]
updateButtons  changed

No problem :) . there is also place to optimize. due to Build button enablement 
we can remove all safe checks from handleBulid and add all elements from selection to build elements list. but in my opinion this can make code less readable.
Comment 10 Chris Aniszczyk CLA 2007-09-04 10:11:31 EDT
Almost there :)

I forgot about one thing... the Synchronize button (aka handleImportEnvironment). 

The message should be changed to "Synchronize selected features only" and the code needs to be modified to support the case of a multiple selection. Currently the code only works for the first selection, not multiple selections.

Thanks Bartosz! I attached a context to help you navigate the various classes related to the Synchornize action.
Comment 11 Chris Aniszczyk CLA 2007-09-04 10:11:35 EDT
Created attachment 77647 [details]
mylyn/context/zip
Comment 12 bartosz michalik CLA 2007-09-04 11:38:34 EDT
Created attachment 77654 [details]
sync action updated

I've refactored code a bit and updated synchronize action. I've also added some cache optimization which can be removed if you don't like it.
Comment 13 Chris Aniszczyk CLA 2007-09-04 12:05:36 EDT
Good stuff Bartosz. I just updated the NLS messages to be more accurate on what is actually going on now. I also updated the copyright headers with the proper information.
Comment 14 Chris Aniszczyk CLA 2007-09-04 12:05:39 EDT
Created attachment 77656 [details]
mylyn/context/zip