| Summary: | Alternative code for "widget is disposed" with sub-menus on tree item click | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Technology] SWTBot | Reporter: | Mariot Chauvin <mariot.chauvin> | ||||||||||||
| Component: | SWTBot | Assignee: | Patrick Tasse <patrick.tasse> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | enhancement | ||||||||||||||
| Priority: | P3 | CC: | itac, patrick.tasse, shabs.shetty, steffen.felbinger | ||||||||||||
| Version: | 2.0.2 | ||||||||||||||
| Target Milestone: | 2.4.0 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Linux | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Bug Depends on: | 479091 | ||||||||||||||
| Bug Blocks: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Mariot Chauvin
Created attachment 190054 [details]
Util class main entry
Created attachment 190055 [details]
a ContextMenu kind of widget
Created attachment 190056 [details]
a ContextMenu finder which find the first entry
Here are some code I want to share. The code allows one to click on a Tree item context menu, and avoid the common "widget is disposed" error. Code license is EPL. Created attachment 191593 [details]
a ContextMenu kind of widget
Created attachment 204081 [details]
improved context menu class
I ran into a problem with the previous SWTBotContextMenu. The context menu was not always found when invoked on TreeItems. I added a "showContextMenu" that invokes treeItme.contextMenu(String) if this context menu belongs to a treeItem. This executes the private methods within TreeItem that help to ensure the menu's availability. The SWTException thrown by this invocation is ignored (because the whole point of this code is to get around it).
(In reply to comment #6) > Created attachment 204081 [details] > improved context menu class > > I ran into a problem with the previous SWTBotContextMenu. The context menu was > not always found when invoked on TreeItems. I added a "showContextMenu" that > invokes treeItme.contextMenu(String) if this context menu belongs to a > treeItem. This executes the private methods within TreeItem that help to > ensure the menu's availability. The SWTException thrown by this invocation is > ignored (because the whole point of this code is to get around it). Thanks Justin ! Can someone please tell me how to use these classes to cick on th subMeu of the context menu. For ex : I right click on a Java Class and say Run As->Then select Run on Server. Here Java class is a treeI item and Run As is a context menu on this. Run As has two sub menus Run on Server and Run COnfigurations. I want to click Run on Server. Can someone please help me with it asap Can someone please tell me how to use these classes to cick on th subMeu of the context menu. For ex : I right click on a Java Class and say Run As->Then select Run on Server. Here Java class is a treeI item and Run As is a context menu on this. Run As has two sub menus Run on Server and Run COnfigurations. I want to click Run on Server. Can someone please help me with it asap Fixed by bug 479091. |