-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menu contributions to PlantUML view no longer possible #87
Comments
I didn't consider that possibility, I'm sorry! It may be possible to add such contributions programmatically, below the diagram items, e.g. using techniques exemplified here: https://wiki.eclipse.org/Menu_Contributions/Problems_View_Example. Alternatively, I could move the diagram items to a toolbar dropdown. |
Perhaps the IMenuService can be used: https://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fmenus%2FIMenuService.html |
I experimented with this a bit and in particular with the solution provided at: https://www.vogella.com/tutorials/EclipseCommandsAdvanced/article.html#defining-commands-at-runtime Unfortunately, this did not work. It seems like the menu ID I am using is incorrect. I used to be able to add contributions for By the way, while I see the little triangle that indicates that there should be an action bar menu, clicking on this does not show a menu, even in the vanilla PlantUML view. |
The menu is (supposed to be) cleared and (re)populated with the diagrams found in the current editor when you click it (given that the editor supports iterating over alle diagrams). If no diagrams are provided, the menu is empty. |
Right, I figured that out now after stepping through the execution. The problem remains that adding new menu contributions, regardless of how is being undone due to |
Starting with PlantUml 1.1.22, the PlantUmlView removed all menu items after the menu was shown. This commit changes this behaviour: only those menu items added programmatically are removed. This allows other plugins to make menu contributions to the PlantUmlView.
Avoid clearing menu items (fixes issue #87)
text consoles. Preference page for diagram text provider enablement.
Close, should be fixed in release 1.1.23 |
In previous versions of PlantUML, it was possible to extend the menu in the action bar like this:
The changes introduced in 94a1291 prevent this since
menu.setRemoveAllWhenShown(true);
is set in PlantUmlView.java, line 265. This means that the menu contributions disappear.Suggested solution:
An alternative solution is to define the action bar menu contributions of the PlantUmlView in the plugin.xml. This way, additions by others are maintained.
The text was updated successfully, but these errors were encountered: