Bug 477670 - Allow configuration of Toolbar elements by a contextual menu on right click
Summary: Allow configuration of Toolbar elements by a contextual menu on right click
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.5.1   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted, usability
Depends on:
Blocks: 543572
  Show dependency tree
 
Reported: 2015-09-17 05:07 EDT by Emmanuel Hugonnet CLA
Modified: 2019-07-27 05:17 EDT (History)
8 users (show)

See Also:
mistria: review?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emmanuel Hugonnet CLA 2015-09-17 05:07:03 EDT
The toolbar should be easily reconfigurable through a right click on it instead of going all the way Windows -> Customize Perspective which is all but intuitive.
Comment 1 Mickael Istria CLA 2015-09-17 05:08:21 EDT
+1
I believe allowing Right-Click > Customize (same as on perspective switcher button) would be enough.
Comment 2 Mickael Istria CLA 2015-09-18 06:48:39 EDT
Technically, it seems like the MToolControl and MToolbarManager are missing fields to define menus; and the ToolBarManagerRenderer and the ToolControlRenderer have nothing to process in order to add contextual menu.
Comment 3 Lars Vogel CLA 2015-09-18 07:21:11 EDT
Have a look how we do the menu for ToolControl in ToolControlRenderer (send from mobile without laptop so classes might be slightly different)
Comment 4 Mickael Istria CLA 2015-09-18 12:20:47 EDT
(In reply to Lars Vogel from comment #3)
> Have a look how we do the menu for ToolControl in ToolControlRenderer (send
> from mobile without laptop so classes might be slightly different)

The only part related to menu in these classes in an hardcoded Menu entry (Restore Hidden Elements...). The suggested operation (open customize perspecitve dialog) cannot be hardcoded, and I couldn't find a field somewhere on the ToolControl model that can be used to add menus from .e4xmi.
Comment 5 Mickael Istria CLA 2015-11-11 06:16:19 EST
Would it be do-able to have the renderer also look for a org.eclipse.ui.menus/menuControbution extension with a specific URL, such as popup:toolbar ?
Comment 6 Lars Vogel CLA 2015-11-11 06:18:40 EST
(In reply to Mickael Istria from comment #5)
> Would it be do-able to have the renderer also look for a
> org.eclipse.ui.menus/menuControbution extension with a specific URL, such as
> popup:toolbar ?

No the renderers are not allowed to have a dependency to e3 API. But you could make it for model fragment contributions which define popups.
Comment 7 Eclipse Genie CLA 2015-11-12 07:13:36 EST
New Gerrit change created: https://git.eclipse.org/r/60199
Comment 8 Mickael Istria CLA 2015-12-02 08:11:32 EST
Is there any guarantee that the provided patch will be considered for merging in M5?
Comment 9 Lars Vogel CLA 2015-12-02 08:18:14 EST
(In reply to Mickael Istria from comment #8)
> Is there any guarantee that the provided patch will be considered for
> merging in M5?

This is OS development, if someone finds the time, he considers it. I like the idea, so I plan to review it, but as I do this in my unpaid time I personally cannot guarantee this.
Comment 10 Mickael Istria CLA 2015-12-02 08:34:07 EST
(In reply to Lars Vogel from comment #9)
> I like the idea, so I plan to review it

Ok thanks. Feel free to tell me if there is anything I can do to ease it.
Comment 11 Lars Vogel CLA 2016-01-25 04:55:09 EST
Mass move to M6
Comment 12 Eclipse Genie CLA 2016-03-04 02:31:20 EST
New Gerrit change created: https://git.eclipse.org/r/67786
Comment 13 Mickael Istria CLA 2016-03-04 02:52:17 EST
@Lars: I would like to merge it soon. Can you please have a look?
Comment 14 Mickael Istria CLA 2016-03-09 12:37:22 EST
@Brian: Do you think you could have a look to the couple of submitted review for that feature?
Comment 16 Brian de Alwis CLA 2016-03-13 00:17:33 EST
I don't like the identifier 'popup:toolbar' as it's not sufficiently descriptive.  This seems to potentially introduce a menu on all ToolControls regardless of whether they are in the org.eclipse.ui.main.toolbar.  It would make more sense if this was targeted to the Spacer Glue elements?

Rather than modify the LegacyIDE.e4xmi files, I think it could be better to use a model processor to introduce the required changes to the model.

I think this will cause requests for others to be able to add to a main-toolbar menu

I'm +1 for this change to go in to M6 and figuring out a better way to get it to work for M7.
Comment 17 Lars Vogel CLA 2016-04-25 15:10:12 EDT
Mass move to 4.6 RC1. We might push out more to 4.7.
Comment 18 Mickael Istria CLA 2016-05-03 06:22:09 EDT
M7 feature freeze is done. Let's slip it to next version then.
Comment 19 Andrey Loskutov CLA 2019-05-21 10:24:05 EDT
(In reply to Eclipse Genie from comment #15)
> Gerrit change https://git.eclipse.org/r/67786 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.git/commit/
> ?id=029449cf3e07e78bd576fe6cbe0769d2c8dafe22

I do not see *any* popup menu on toolbar.
Was it ever working? If yes, by which magic?
If not - what was missing to complete this task?

I've stumbled over this change while trying to understand differences between 
/org.eclipse.platform/LegacyIDE.e4xmi
/org.eclipse.ui.workbench/LegacyIDE.e4xmi
via bug 528890.

This is the only difference I've found so far (except the initial window size and the changes added by bug 528890 itself).
Comment 20 Mickael Istria CLA 2019-05-21 10:30:22 EDT
(In reply to Andrey Loskutov from comment #19)
> Was it ever working?

No.

> If not - what was missing to complete this task?

I don't remember, but I'd say it's just missing a good patch.

> This is the only difference I've found so far (except the initial window
> size and the changes added by bug 528890 itself).

If this is an issue, I guess you can revert this change since it's not working anyway.
Comment 21 Eclipse Genie CLA 2019-05-21 11:20:33 EDT
New Gerrit change created: https://git.eclipse.org/r/142530
Comment 23 Andrey Loskutov CLA 2019-05-22 08:29:54 EDT
(In reply to Mickael Istria from comment #20)
> If this is an issue, I guess you can revert this change since it's not
> working anyway.

It is at least surprising and inconsistent. I've removed this.