Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338555 - Alternative code for "widget is disposed" with sub-menus on tree item click
Summary: Alternative code for "widget is disposed" with sub-menus on tree item click
Status: RESOLVED FIXED
Alias: None
Product: SWTBot
Classification: Technology
Component: SWTBot (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Linux
: P3 enhancement with 1 vote (vote)
Target Milestone: 2.4.0   Edit
Assignee: Patrick Tasse CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 479091
Blocks:
  Show dependency tree
 
Reported: 2011-03-01 11:23 EST by Mariot Chauvin CLA
Modified: 2015-10-22 12:48 EDT (History)
4 users (show)

See Also:


Attachments
Util class main entry (1.72 KB, text/x-java)
2011-03-01 11:23 EST, Mariot Chauvin CLA
no flags Details
a ContextMenu kind of widget (2.41 KB, text/x-java)
2011-03-01 11:24 EST, Mariot Chauvin CLA
no flags Details
a ContextMenu finder which find the first entry (3.05 KB, text/x-java)
2011-03-01 11:25 EST, Mariot Chauvin CLA
no flags Details
a ContextMenu kind of widget (2.08 KB, text/x-java)
2011-03-21 01:42 EDT, Mariot Chauvin CLA
no flags Details
improved context menu class (3.28 KB, text/x-java)
2011-09-27 10:05 EDT, Justin Bangerter CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mariot Chauvin CLA 2011-03-01 11:23:14 EST

    
Comment 1 Mariot Chauvin CLA 2011-03-01 11:23:42 EST
Created attachment 190054 [details]
Util class main entry
Comment 2 Mariot Chauvin CLA 2011-03-01 11:24:57 EST
Created attachment 190055 [details]
a ContextMenu kind of widget
Comment 3 Mariot Chauvin CLA 2011-03-01 11:25:34 EST
Created attachment 190056 [details]
a ContextMenu finder which find the first entry
Comment 4 Mariot Chauvin CLA 2011-03-01 11:28:30 EST
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.
Comment 5 Mariot Chauvin CLA 2011-03-21 01:42:56 EDT
Created attachment 191593 [details]
a ContextMenu kind of widget
Comment 6 Justin Bangerter CLA 2011-09-27 10:05:04 EDT
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).
Comment 7 Mariot Chauvin CLA 2011-09-28 08:45:22 EDT
(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 !
Comment 8 Shabari shetty CLA 2012-12-26 18:35:52 EST
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
Comment 9 Shabari shetty CLA 2012-12-26 18:49:18 EST
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
Comment 10 Patrick Tasse CLA 2015-10-22 12:48:35 EDT
Fixed by bug 479091.