How to access to menu items? - eclipse-rcp

I created a menu of RCP application only in plugin.xml. How to access to items of this menu programicaly to change their texts and images at runtime?

If you are using command framework to contribute those menu items, you can use org.eclipse.ui.commands.IElementUpdater to change the text and image.

Related

Different menu item types in Eclipse 4

When I right click on a menu and select Add child, I am presented with several options:
Handled Menu Item
Menu
Direct Menu Item
Dynamic Menu Contribution
VisibleWhen Core Expression
What is the difference between each of these choices?
Handled Menu Item
This is a menu item that uses a command id (and therefore one or more handlers).
Direct Menu Item
This is a menu item where you specify the class to handle the item directly without using a command id.
Menu
This adds a new sub-menu.
Dynamic Menu Contribution
This lets you specify a class that can add multiple menu items dynamically. See here
VisibleWhen Core Expression
This lets you add a 'core expression' to the current menu item to control when it is visible. See the Eclipse help for details of core expressions. Eclipse Oxygen also now supports Imperative Expressions where you can specify a Java class to control the menu visibility.

Removing "Show In" menu items in Eclipse RCP application

I am developing an Eclipse RCP application, and would like to remove some of the items displayed in the "Show In" context menu. The items are placed in this menu by various plug-ins, and I would prefer to not have them there.
Adding a new entry to this menu is well documented: https://wiki.eclipse.org/FAQ_How_do_I_make_my_view_appear_in_the_Show_In_menu%3F
However, removing an existing entry seems problematic, since Views are listed in the "Show In" menu by virtue of them implementing the IShowInTarget interface. The resulting menu items do not have unique IDs that could be used to disable them via an Activity.
It seems to me like the only way to avoid listing a View defined by an existing plug-in in the "Show In" menu is to extend the plug-in class implementing this View.
The source code for the 'Show In' menu is org.eclipse.ui.internal.ShowInMenu.
This gets contributions from a number of places but I don't see anything that could be used to filter them.
'Extending the plug-in class implementing the view' is not really possible.

Eclipse e4: add commands to context menu

I defined several commands in my Application Model, say like openCommand, saveCommand. And I can add them to the menu bar or tool bar easily. Now I want them to also appear in the context menu of the edit part, how can this be done?
To be short, I want a menu item in main menu, a tool bar item in tool bar and another menu item in context menu. All these three items have the same function and thus should be mapped to the same command. I can do the first two but have no idea about the third.
Any help would be appreciated! Thanks a lot!
You define the context menu for a Part in the Menu section of the Part Descriptor in the application model. Add a 'Popup Menu' and give it a unique id. Add menu items to the popup menu in the normal way.
Tell Eclipse the menu is the context menu for a control using the EMenuService:
#Inject
private EMenuService menuService;
...
menuService.registerContextMenu(control, "menu id");

Why some widgets do not get included in WindowBuilder?

Im using WindowBuilder tool to build a GUI for my application and I see that some widgets or tools don't get included in the Design view. In my case, I have created a new SWT Application window and I try to add DropDown Menu in the Application window and I always get a red icon when I take the DropDown menu from the palette to the design area. Can anyone tell me what is the problem in this case?
I found the mistake I was doing...It is not possible to directly add a DropDown Menu in the design editor. You first have to add a Menu and then add a DropDown Menu. And the widgets do work in all forms of applications you want to develop.

Joomla!: What do to add links in footer?

I wanted to add some (internal) links to the footer in a custom template,
how should I do this?
I'm very new to Joomla! and I don't know how to do this best.
I couldn't/don't want install plugins, it should simple work with built-in possibilities.
If I understand the question correctly, all you need to so is add a new menu.
Log in to Joomla and select Menu Manager from the Menu menu
Create a new menu
Select the new menu in the Menu menu
Add menu items - internal links or what ever you want
Select Module Manager from Extensions meni
Create new Menu module, select the new menu and the footer position
You should be able to then style the menu accordingly with CSS.