Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » multiple selections from tree + context menu
multiple selections from tree + context menu [message #42176] Tue, 07 July 2009 18:59 Go to next message
Jack Markarian is currently offline Jack MarkarianFriend
Messages: 3
Registered: July 2009
Junior Member
Quick functionality question.. is it possible to select several items from
a tree (similar to using ctrl+click on a keyboard) and then bring up the
context menu while the items are still selected:

eg:
item.select("ACT", "CL_SCHED", "DEPARTMENT", "EMP_PHOTO", "EMP_RESUME",
"EMPLOYEE");

item.contextMenu("Copy").click()

(When I do the above code, I got an error "menu not enabled".. seems like
I am bringing up the context menu in the wrong area? Thoughts?
Re: multiple selections from tree + context menu [message #42210 is a reply to message #42176] Tue, 07 July 2009 19:54 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 8/7/09 00:29, Jack Markarian wrote:
> Quick functionality question.. is it possible to select several items
> from a tree (similar to using ctrl+click on a keyboard) and then bring
> up the context menu while the items are still selected:
>
> eg:
> item.select("ACT", "CL_SCHED", "DEPARTMENT", "EMP_PHOTO", "EMP_RESUME",
> "EMPLOYEE");
>
> item.contextMenu("Copy").click()
>
> (When I do the above code, I got an error "menu not enabled".. seems
> like I am bringing up the context menu in the wrong area? Thoughts?
>

Things just keep getting better :) File a bug report and I'll try taking
a look at it.

For a workaround, you may try writing a wrapper that does something
similar to what item.contextMenu().click() does.

--
Ketan
http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr
Re: multiple selections from tree + context menu [message #747963 is a reply to message #42176] Mon, 24 October 2011 11:46 Go to previous message
Gligor Mihai is currently offline Gligor MihaiFriend
Messages: 1
Registered: October 2011
Junior Member
A simple workaround is to call the contextmenu over the entire tree, like this:

SWTBotTree tree = myView.bot().tree();
SWTBotTreeItem item= tree.expandNode("MyItem");
item.select("ACT", "CL_SCHED", "DEPARTMENT", "EMP_PHOTO", "EMP_RESUME", "EMPLOYEE");
tree.contextMenu("Copy").click();

This works for me.
Previous Topic:Test Fails for consecutive test cases-SWTBot
Next Topic:SWTBot Jenkins Integration for SWT Standalone App
Goto Forum:
  


Current Time: Fri Dec 27 02:45:10 GMT 2024

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

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

Back to the top