String from Problem's view

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

String from Problem's view

Postby Maanasa » Thu Jul 08, 2010 12:59 pm

Guys,

Is there a way that I can access or capture the string from Problem's view.
For example when we import a project the problem's tab shows the number of warnings, errors etc(Eg string: 20 Erros, 23 Warnings)
Any thoughts?

Maanasa
Maanasa
 
Posts: 2
Joined: Fri Jul 02, 2010 2:40 pm

Re: String from Problem's view

Postby Phil Quitslund » Thu Jul 08, 2010 2:50 pm

Is the String what you really want or, more likely, do you actually want the problems themselves? If you want the problems themselves, check out this snippet:

http://code.google.com/p/wt-commons/source/browse/trunk/org.wtc.snippets/src/org/wtc/snippets/eclipse/Snippet001CollectProblems.java

Hope this helps!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: String from Problem's view

Postby Maanasa » Fri Aug 06, 2010 11:07 am

Hi Phil,

I am sorry for the late reply.
How ever in expandProblemTree method TreeItem errorItem = (TreeItem) errorNode.getWidget(); is throwing that it is Wrong thread
Maanasa
 
Posts: 2
Joined: Fri Jul 02, 2010 2:40 pm

Re: String from Problem's view

Postby Phil Quitslund » Fri Aug 06, 2010 11:37 am

Aha, right. SWT is particular about ensuring that UI elements are only properly accessed from the UI thread. To ensure this, you can pass a Runnable to the Display for execution. For example you'd want to wrap your call something like this:

Code: Select all
final TreeItem[] item = new TreeItem[1];
Display.getDefault().syncExec(
   new Runnable(){
       public void run(){
            item[0] = (TreeItem) errorNode.getWidget()     
       }
   });

Hope this helps!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest