Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » Selection in TableViewer(I can't set a selection in a table viewer)
Selection in TableViewer [message #533011] Tue, 11 May 2010 20:06 Go to next message
budili Missing name is currently offline budili Missing nameFriend
Messages: 64
Registered: May 2010
Member
Hello,

i have add a deselection function to my table viewer.
Here's the code:
viewer.getTable().addMouseListener(new MouseAdapter()
        {
            @Override
            public void mouseDown(final MouseEvent e)
            {
                if (viewer.getTable().getItem(new Point(e.x, e.y)) == null)
                {
                    viewer.getTable().deselectAll();
                }
            }
        });

Since i have add this MouseListener to my application code,
all my testcode doesn't work. Everywhere in my testcode
who i use the method
bot.table().select(index)

the selection will not execute through the bot.
I have change bot.table().selection(index) in the bot.table().doubleclick method. That's works, but i think it's not fine.

What could be the problem?
Re: Selection in TableViewer [message #533193 is a reply to message #533011] Wed, 12 May 2010 13:57 Go to previous messageGo to next message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
budili wrote:
> Hello,
>
> i have add a deselection function to my table viewer.
> Here's the code:
>
> viewer.getTable().addMouseListener(new MouseAdapter()
> {
> @Override
> public void mouseDown(final MouseEvent e)
> {
> if (viewer.getTable().getItem(new Point(e.x, e.y)) == null)
> {
> viewer.getTable().deselectAll();
> }
> }
> });
>
> Since i have add this MouseListener to my application code,
> all my testcode doesn't work. Everywhere in my testcode
> who i use the method
> bot.table().select(index)
>
> the selection will not execute through the bot. I have change
> bot.table().selection(index) in the bot.table().doubleclick method.
> That's works, but i think it's not fine.
>
> What could be the problem?

Just a wild guess, but the select method does not do a mouse click. It
sets the selection on the table; your listener is never called because
there is no mouse click done. Maybe you should do
bot.table().click(index, 0) instead.

Hope this helps.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Re: Selection in TableViewer [message #533465 is a reply to message #533193] Fri, 14 May 2010 06:47 Go to previous messageGo to next message
budili Missing name is currently offline budili Missing nameFriend
Messages: 64
Registered: May 2010
Member
ähm noo, i don't want a click ... ok, a little bit more background.

I have a rich table viewer in my application (with a master detail etc.)
The tests for the application code are large too.

I have many tests who i select with the bot a row and test
than die detail to the selected row. For this stuff i use the
bot.table().select(index)

method without problems.

But newly i have add the special listener (see above) who
set a deselection on my tableviewer. And now all about who
i use the bot.table().select() method, the bot does not set
a selection on my table viewer ....

Thats the problem ...
Re: Selection in TableViewer [message #533533 is a reply to message #533465] Fri, 14 May 2010 13:08 Go to previous message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
budili wrote:
> ähm noo, i don't want a click ... ok, a little bit more background.
>
> I have a rich table viewer in my application (with a master detail etc.)
> The tests for the application code are large too.
> I have many tests who i select with the bot a row and test
> than die detail to the selected row. For this stuff i use the
> bot.table().select(index)
> method without problems.
> But newly i have add the special listener (see above) who
> set a deselection on my tableviewer. And now all about who i use the
> bot.table().select() method, the bot does not set
> a selection on my table viewer ....
> Thats the problem ...

Hummm, that's weird... because the #select() method doesn't send a mouse
down event... I'll try to check this when I get the time. Or maybe
someone else has a better answer then mine?

--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Previous Topic:How to access UI item from running application
Next Topic:Can't get SWTBot working with Helios 3.6M7
Goto Forum:
  


Current Time: Mon Dec 22 03:02:41 GMT 2014

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

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