Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » How to access toolbar buttons of an Eclipse editor?
How to access toolbar buttons of an Eclipse editor? [message #656595] Sun, 27 February 2011 10:10 Go to next message
Ovidio Mallo is currently offline Ovidio MalloFriend
Messages: 35
Registered: July 2009
Member
Hi all,

I'm trying to access a button in the global toolbar which was
contributed for an Eclipse editor using the usual
EditorActionBarContributor#contributeToToolBar() method. I've tried
accessing the button in SWTBot using the following methods but neither
of them is able to find the button:

SWTBotEditor#toolbarButton(String tooltip);
SWTWorkbenchBot#SWTWorkbenchBot(String tooltip);

Is there another way of accessing the buttons in the global toolbar
which belong to an Eclipse editor?

Thanks in advance for any help!

Ovidio
Re: How to access toolbar buttons of an Eclipse editor? [message #656943 is a reply to message #656595] Tue, 01 March 2011 05:57 Go to previous messageGo to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
On 2/27/11 2:10 AM, Ovidio Mallo wrote:
> Hi all,
>
> I'm trying to access a button in the global toolbar which was
> contributed for an Eclipse editor using the usual
> EditorActionBarContributor#contributeToToolBar() method. I've tried
> accessing the button in SWTBot using the following methods but neither
> of them is able to find the button:
>
> SWTBotEditor#toolbarButton(String tooltip);
> SWTWorkbenchBot#SWTWorkbenchBot(String tooltip);
>
> Is there another way of accessing the buttons in the global toolbar
> which belong to an Eclipse editor?
>
> Thanks in advance for any help!
>
> Ovidio

You need to use #toolbarButtonWithTooltip() as documented here:
http://goo.gl/nLgDm

--
Ketan
http://ketan.padegaonkar.name | http://eclipse.org/swtbot | @ketanpkr
Re: How to access toolbar buttons of an Eclipse editor? [message #657476 is a reply to message #656943] Wed, 02 March 2011 22:15 Go to previous message
Ovidio Mallo is currently offline Ovidio MalloFriend
Messages: 35
Registered: July 2009
Member
Hi Ketan,

thanks for your feedback! I've tried to use
SWTWorkbenchBot#toolbarButtonWithTooltip() as you've suggested but this
seems not to find the button. The same method is working fine for
finding buttons in the normal global toolbar of the workbench but it
seems not to work for the buttons belonging to an editor. Is this method
also supposed to work for the toolbar associated to an Eclipse editor?

Thanks again & kind regards,
Ovidio


On 01.03.2011 06:57, Ketan Padegaonkar wrote:
> On 2/27/11 2:10 AM, Ovidio Mallo wrote:
>> Hi all,
>>
>> I'm trying to access a button in the global toolbar which was
>> contributed for an Eclipse editor using the usual
>> EditorActionBarContributor#contributeToToolBar() method. I've tried
>> accessing the button in SWTBot using the following methods but neither
>> of them is able to find the button:
>>
>> SWTBotEditor#toolbarButton(String tooltip);
>> SWTWorkbenchBot#SWTWorkbenchBot(String tooltip);
>>
>> Is there another way of accessing the buttons in the global toolbar
>> which belong to an Eclipse editor?
>>
>> Thanks in advance for any help!
>>
>> Ovidio
>
> You need to use #toolbarButtonWithTooltip() as documented here:
> http://goo.gl/nLgDm
>
Previous Topic:a question about view menu
Next Topic:How to get hover help in text editor?
Goto Forum:
  


Current Time: Sat Dec 20 08:12:22 GMT 2014

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

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