Home » Eclipse Projects » Eclipse 4 » Need help for SWTBot with Menus, and e4 in general
Need help for SWTBot with Menus, and e4 in general [message #899578] |
Wed, 01 August 2012 13:48 |
|
Hi,
We want SWTBot to work with Eclipse 4.2. We started a new development
stream, and have noticed that SWTBot is still compatible with Eclipse
4.2 without any change.
However, the "Eclipse Finder" in SWTBot, which is responsible for
manipulating workbech concepts (such as views & so on), has several
incompatibilites with Eclipse 4.2. One of them is about Views menus:
Before, with 3.x, the MenuManager for a view used to contain all the
contributed stuff in the menu. Now, it seems to be filled in a lazy way,
so that we can't query it to find menus for views.
I think there may be a way to use a SWT.MenuDetect event on the menu
widget, but I did not find a way to retrieve this menu widget.
Do you have any suggestion on how to ensure MenuManager gets populated
before querying it?
The general issue is where should SWTBot place itself for the Eclipse
Finder? Now there is the modeled workbench and the renderers, so should
SWTBot simply trigger the modeled workbench? Would it allow so many
useful operations as SWTBot used to provide with 3.x? Or should SWTBot
used the rendered workbench, and then rely on the renderer (which may
change) ? In such case, do you agree that would mean implement 1 Finder
for each renderer ?
Your help is very welcome, here or on the SWTBot mailing list.
Cheers,
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
| | |
Re: Need help for SWTBot with Menus, and e4 in general [message #899808 is a reply to message #899802] |
Thu, 02 August 2012 12:13 |
|
On 08/02/2012 01:56 PM, Tom Schindl wrote:
> Well normally the rendering is triggered by setting the
> "toBeRendered"-flag to true but I'm not sure about all those menu
> contributions.
The issue here is that SWTBot relies on MenuManager, and not on the Menu
model. Do you have any clue on how to navigate from one to another?
I think I'll need to access the renderer? Can it be retrieved via a
service, would you have a snippet?
> I guess only Paul knows how this is legazy menu system interop is
> working. Did you tried to look at live application model, in fact all
> informations have to be in this model.
Ok, I'll try that.
Can the e4 service be retrieved as simple OSGi services using
BundleContext? Or is there a more efficient way to get them.
I don't think SWTBot gets loaded in a specific IEclipseContext so I
probably can't use Depdenency Inject, can I?
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
| |
Re: Need help for SWTBot with Menus, and e4 in general [message #899844 is a reply to message #899812] |
Thu, 02 August 2012 14:40 |
Eclipse User |
|
|
|
Hi Mickael,
MenuManager is created in the MenuManagerRenderer. If you want to go back and forth SWT element - Model element you have to do:
Model-> Element : modelElement.getWidget()
Element -> Model (in case of SWT): swtelement.getData(AbstractPartRenderer.OWNING_ME)
Due to the fact that I'm not familiar with SWTBot, I am not clear what it needs to get things done. If you could be more specific on that I can hint something else.
|
|
| |
Re: Need help for SWTBot with Menus, and e4 in general [message #904903 is a reply to message #902837] |
Wed, 29 August 2012 10:58 |
|
Paut, Sopot,
Here is a bug to track the kind of issues we met with e4 menu in SWTBot:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=388306
I'd appreciate if you could find some time to give a hint. The general
issue seems to be menus not populated correctly. SWTBot menu handling is
all about sending Show and Hide events, we probably need another way to
do it for e4, and add some more events to ensure menus get populated.
On 08/20/2012 07:51 PM, Paul Webster wrote:
> I'll just add that
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.showMenuButton(MPart,
> CTabFolder, MMenu) is the starting point for how we use the view menu
> MMenu, and do to the strangeness of the 3.x API and which part of the
> framework owns what,
> org.eclipse.ui.internal.e4.compatibility.CompatibilityView.createPartControl(IWorkbenchPart,
> Composite) shows us hooking up a MenuManager to the view menu MMenu.
>
> PW
>
>
>
--
Mickael Istria
JBoss, by Red Hat
My blog: http://mickaelistria.wordpress.com
My Tweets: http://twitter.com/mickaelistria
|
|
|
Goto Forum:
Current Time: Fri Apr 26 03:27:54 GMT 2024
Powered by FUDForum. Page generated in 0.03295 seconds
|