Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342125

Summary: Bug with style SWT.SEPARATOR and toolItem.setImage
Product: [Eclipse Project] Platform Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, prakash, pwebster
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Attachments:
Description Flags
Example to reproduce the bug none

Description Vincent Lorenzo CLA 2011-04-07 05:32:13 EDT
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?
Comment 1 Vincent Lorenzo CLA 2011-04-07 05:37:23 EDT
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
Comment 2 Felipe Heidrich CLA 2011-04-07 10:39:47 EDT
are you trying to set an image to separator tool item ?
Comment 3 Vincent Lorenzo CLA 2011-04-08 03:10:54 EDT
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.
Comment 4 Paul Webster CLA 2011-04-08 07:20:40 EDT
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
Comment 5 Vincent Lorenzo CLA 2011-04-08 09:47:07 EDT
I'm sorry, I don't want display the image next the combo, I would like to see it in the Customization Perspective Dialog...
Comment 6 Paul Webster CLA 2011-04-08 09:50:31 EDT
The customize perspective dialog is not extracting images from ToolItems.

PW
Comment 7 Felipe Heidrich CLA 2011-04-08 10:26:39 EDT
Not SWT
Vincent, can I close this bug as NOT_ECLIPSE ?
Comment 8 Vincent Lorenzo CLA 2011-04-08 10:36:57 EDT
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
Comment 9 Eclipse Genie CLA 2020-06-12 03:03:29 EDT
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.