Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Problem with Thread Understanding
Problem with Thread Understanding [message #790029] Fri, 03 February 2012 18:21
fan Missing name is currently offline fan Missing nameFriend
Messages: 7
Registered: June 2011
Junior Member

I got a problem with the understanding why some of my code doesnt work. I wrote some code to search a label in a shell :

private void init(){
labels=new ArrayList<Label>();
PlatformUI.createDisplay().syncExec(new Runnable() {
public void run(){
Control[] children = parentShell.getChildren();
for(Control control : children){
if (control instanceof Composite)
else if (control instanceof Label)
boolean found = false;
for (Label label : labels){
if (label.getToolTipText()!= null && label.getToolTipText().equals(buttonTooltip)){
transButton = label;
found =true;
if ( !found )
throw new WidgetNotFoundException("Widget with Tooltip\" "+buttonTooltip+" \" not found! ");

My problem is, that I need the Shell, in which the label is to be searched. So that I can do:
Control[] children = parentShell.getChildren(); ( line 6 in the method)

So how do I get this Shell? I tried parentShell = botShell.widget() ( botShell is a SWTBotShell), but that doenst work. If I debug it and look what I get, the parenShell has the text "Wrong Thread". I must admit that I don´t know much about the Thread concept, so can someone plz explain to me why it doens´t work, and how it should be done.

[Updated on: Fri, 03 February 2012 18:22]

Report message to a moderator

Previous Topic:Using DropDownButton
Next Topic:SWTBot handling of "obscure" keyboard layouts
Goto Forum:

Current Time: Sat May 26 08:21:18 GMT 2018

Powered by FUDForum. Page generated in 0.01233 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top