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
Hello

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() {
@Override
public void run(){
Control[] children = parentShell.getChildren();
for(Control control : children){
if (control instanceof Composite)
findLabels((Composite)control);
else if (control instanceof Label)
labels.add((Label)control);
}
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: Fri Apr 19 06:57:59 GMT 2024

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

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

Back to the top