Community
Participate
Working Groups
I'm trying to do a dynamic menu for Zoom in Papyrus using ToolItem and a Combo.(See my small example in the attachment file). I want to set an Image to the ToolItem in order to see it in the Customize Perspective Dialog, in the tab Tool Bar Visibility, but it's not possible using the style is SWT.SEPARATOR and if I use another style, by drop down zoom menu doesn't work. Do you have any solution?
Created attachment 192713 [details] Example to reproduce the bug To see the problem, Go to the Customization Perspective Dialog, look for my toolbar named : Bug Toolbar Example. Expand it -> As you can see, the item "Bug Example" doesn't have the image that I set in the code! This example do nothing (It can't manage a zoom), it is only here to illustrate my problem with SWT.SEPARATOR and ToolItem.setImage. Best Regards, -- Vincent Lorenzo
are you trying to set an image to separator tool item ?
Yes! I think it is not the correct way, but, I don't know how to get a functional dynamic drop-down menu without using SWT.SEPARATOR.
setControl(*) says: "Sets the control that is used to fill the bounds of the item when the item is a SEPARATOR" ... that implies to me that it will not show an image when a control is set. Arguably if you wanted an image next to the combo, you could (in your example) add a separate tool item or (similar to ControlContribution) create a composite as the ToolItem control and add both the image and the combo to that. I'll also point out that org.eclipse.ui.menus has a <control/> element that can be used, and supports the second case. PW
I'm sorry, I don't want display the image next the combo, I would like to see it in the Customization Perspective Dialog...
The customize perspective dialog is not extracting images from ToolItems. PW
Not SWT Vincent, can I close this bug as NOT_ECLIPSE ?
No, because, I don't agree with the Comment 6. In the class CustomizePerspectiveDialog line 3078 :Image image = toolitems[i].getImage(); To my mind, we extract the image from ToolItem, no? If not, do you know how I can set my Image? Best Regards, -- Vincent Lorenzo
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.