| widget with parent [message #18555] | 
Sun, 01 February 2009 15:43   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Can we consider having api in SWTBot to search/find widget with given  
parent?  There is a method in SWTBotFactory, but you have to copy the  
matcher.  The api would really help when having to work with editor/views  
trying to find widgets inside it...for example a StyledText in an editor.   
Right now you have to copy the matcher for StyledText and use it with base  
control in editor.
 |  
 |  
  | 
 | 
| Re: widget with parent [message #19274 is a reply to message #18576] | 
Mon, 02 February 2009 18:57    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
For example,  
To find a button, there are lots of APIs, bot.button("test"), in SWTBot,  
which will search the active shell.   
 
But with now if you want to search for a button in eclipse view or editor,  
you can use bot.button("test"), but it would be more reliable to says  
bot.button("test", viewOrEditorControl) so it will search for the button  
under viewOrEditorControl.   
 
I mean using bot.button("test") will work but don't know what is going to  
happen if there is one or more other views open with "test" button.  This  
would apply to all the APIs for finding widgets.   
 
Right now what you have to do is, copy or create the matcher for button or  
widget you are looking for and use the  
org.eclipse.swtbot.swt.finder.SWTBotFactory.widget(Matcher<? >, Widget)  
method.  But thought might be easy to add code to automatically generate  
these extra APIs to help reduce having to copy/recreating matchers for  
common widgets. 
 
Ketan Padegaonkar wrote: 
 
> Hi Ketan, 
 
> I did not quite understand that, could you elaborate with an example of  
> the API you're looking for ? 
 
> -- Ketan
 |  
 |  
  | 
 | 
 | 
| Re: widget with parent [message #19411 is a reply to message #19274] | 
Mon, 02 February 2009 23:05    | 
 
Eclipse User  | 
 | 
 | 
   | 
 
On 3/2/09 05:27, Ketan Patel wrote: 
> For example, To find a button, there are lots of APIs, 
> bot.button("test"), in SWTBot, which will search the active shell. 
> But with now if you want to search for a button in eclipse view or 
> editor, you can use bot.button("test"), but it would be more reliable to 
> says bot.button("test", viewOrEditorControl) so it will search for the 
 
This could mean that the API exactly doubles, and this particular use  
case includes a lot of people, using this api not so frequently. 
 
Could this be the case of another class (call it SWTBotParent or  
something) and provides a the same api as SWTBot with additional parameter ? 
 
While this API would be useful, I'm just thinking about the sheer number  
of proposals the user would see when he types in a bot.button (it is  
currently pegged at 20 per widget) 
 
-- Ketan
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.08437 seconds