Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339357 - [client] 'More actions' menu stays in the toolbar
Summary: [client] 'More actions' menu stays in the toolbar
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-09 09:31 EST by Szymon Brandys CLA
Modified: 2011-09-01 11:42 EDT (History)
2 users (show)

See Also:


Attachments
Illustration (30.26 KB, image/png)
2011-03-09 09:32 EST, Szymon Brandys CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Szymon Brandys CLA 2011-03-09 09:31:30 EST
Steps:

1) Create couple top-level folders
2) Select them all and use 'More actions > Delete'
3) Projects are deleted but the menu is still visible
Comment 1 Szymon Brandys CLA 2011-03-09 09:32:50 EST
Created attachment 190758 [details]
Illustration
Comment 2 Szymon Brandys CLA 2011-03-09 09:33:52 EST
The menu disappears after a refresh.
Comment 3 Susan McCourt CLA 2011-03-09 11:23:18 EST
several things at play here.

Long term, the selection needs to be retained when refreshing the UI after an operation, and if the operation changes the selection, then the selection service needs to fire a notification.

Short term, for the delete case, there are no selections to be saved, so setting selections to empty would fire the listener and remove the menu.

M6 candidate pending triage.
Comment 4 Malgorzata Janczarska CLA 2011-03-09 11:55:11 EST
The situations I noticed this bug in:
- after deleting resources the selection is cleared but the action still have the previous selection, so you can schedule deletion of same resources twice
- adding a new file/folder to a folder where the selection is made clears the selection but menu stays and has the old selection
- selecting a resource in a folder then collapsing and expanding again the folder

I took a simple shoot to fix it and I added this code:
			this.explorer.registry.getService("ISelectionService").then(dojo.hitch(this, function(service) {
				service._setSelection(this.getSelected());
			}));
			
to function eclipse.FileRenderer.rowsChanged() in explorer-table.js. It works for all the cases I named above.
But  I suppose you've been thinking about it already so I'll leave it to you.
Comment 5 Susan McCourt CLA 2011-03-09 17:24:30 EST
(In reply to comment #4)
> The situations I noticed this bug in:
> - after deleting resources the selection is cleared but the action still have
> the previous selection, so you can schedule deletion of same resources twice
> - adding a new file/folder to a folder where the selection is made clears the
> selection but menu stays and has the old selection
> - selecting a resource in a folder then collapsing and expanding again the
> folder
> 
> I took a simple shoot to fix it and I added this code:
>            
> this.explorer.registry.getService("ISelectionService").then(dojo.hitch(this,
> function(service) {
>                 service._setSelection(this.getSelected());
>             }));
> 
> to function eclipse.FileRenderer.rowsChanged() in explorer-table.js. It works
> for all the cases I named above.

That's the right fix.

> But  I suppose you've been thinking about it already so I'll leave it to you.

Not really, I'm just now getting to this bug.  Thanks for the investigation.
Comment 6 Susan McCourt CLA 2011-03-09 19:47:22 EST
Fixed.
We still need a better long term fix, see bug 339450.