Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » activate cell editor in tree column
activate cell editor in tree column [message #483792] Thu, 03 September 2009 04:04 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
The eclipse property sheet is a table-tree that has an underlying SWT Tree.
I noticed there is support for clicking a cell in a table to activate the
editor
( http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/ SWTBotTableClickTest.java).
Can this be done in a tree such as the properties tree?

Thanks,
Will
Re: activate cell editor in tree column [message #558850 is a reply to message #483792] Tue, 14 September 2010 15:33 Go to previous messageGo to next message
Maksym Bykovskyy is currently offline Maksym BykovskyyFriend
Messages: 3
Registered: July 2010
Junior Member
any solutions? I have the same problem.

[Updated on: Tue, 14 September 2010 15:33]

Report message to a moderator

Re: activate cell editor in tree column [message #558860 is a reply to message #483792] Tue, 14 September 2010 15:57 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
I think it should be possible to do it. Try whacking the code out of
table.click() and put it somewhere. Make sure that the clickOnCell()
test works exactly the same way :)

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot

On 9/2/09 9:04 PM, Will Horn wrote:
> The eclipse property sheet is a table-tree that has an underlying SWT
> Tree. I noticed there is support for clicking a cell in a table to
> activate the editor
> ( http://github.com/ketan/swtbot/blob/master/org.eclipse.swtbo t.swt.finder.test/src/org/eclipse/swtbot/swt/finder/widgets/ SWTBotTableClickTest.java).
> Can this be done in a tree such as the properties tree?
>
> Thanks,
> Will
Re: activate cell editor in tree column [message #558875 is a reply to message #558860] Tue, 14 September 2010 16:59 Go to previous message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
On 10-09-14 11:57 AM, Ketan Padegaonkar wrote:
>
> I think it should be possible to do it. Try whacking the code out of
> table.click() and put it somewhere. Make sure that the clickOnCell()
> test works exactly the same way :)
>

I had to do the same thing (I thought I added a bug report for that but
I can't seem to find it :P). What I did is extend SWTBotTreeItem and use
this handy-dandy bit of code:

public SwtBotTreeItemExtension click(final int columnIndex)
{
int columnCount = new SWTBotTree(parentTree).columnCount();
if (columnIndex < 0 || columnIndex > columnCount)
{
throw new IndexOutOfBoundsException("Index should be
between 0 and "
+ columnCount
+ ". Passed value is: "
+ columnIndex);
}

// Get the center point of the cell at the specified column
Point point = syncExec(new Result<Point>()
{
public Point run()
{
Rectangle bounds = widget.getBounds(columnIndex);
int x = bounds.x + (bounds.width / 2);
int y = bounds.y + (bounds.height / 2);
return new Point(x, y);
}
});

clickXY(point.x, point.y);
return this;
}

this, of course, could be integrated as part of SWTBotTreeItem API.

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

*Because performance matters.*
Previous Topic:When will SWTBot come out of the incubation phase?
Next Topic:GEF GraphicalViewer within a dialog
Goto Forum:
  


Current Time: Thu Apr 18 07:02:29 GMT 2024

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

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

Back to the top