|
|
Re: Click on SWTBotToolbarButton - nothing happens [message #483330 is a reply to message #483327] |
Tue, 01 September 2009 07:39 |
Eclipse User |
|
|
|
Hi Benni,
here is the code :
SWTBotView view =
workbenchbot.viewById(IPageLayout.ID_OUTLINE);
SWTBotToolbarButton toolBarButton =
view.toolbarButton(toolTipText);
toolBarButton.click();
Benjamin Glaser schrieb:
> Hi Aleksey,
>
> could you show some code?
> I tried it some days ago and it worked for me.
>
> Benni
>
>
|
|
|
|
Re: Click on SWTBotToolbarButton - nothing happens [message #483655 is a reply to message #483367] |
Wed, 02 September 2009 13:38 |
Eclipse User |
|
|
|
Benjamin Glaser schrieb:
> Sorry, but I can't replicate the issue.
>
> SWTBotView view = bot.viewByTitle("title");
> SWTBotToolbarButton toolBarButton = view.toolbarButton("tooltip");
> toolBarButton.click();
>
> works fine for me.
> The Tree collaps as expected.
>
> I used viewbytitle because my testview didn't have an ID so far.
> But I don't think this will change a lot.
>
> You don't get any exceptions?
> It just don't happens anything?
>
> Pretty weird...
>
>
>
>
The run-Method of the action is called, but isChecked() returns always
false ...
As a consequence the implementation assumes that the action is not
enabled and can not add a filter(ViewerFilter) to the tree => no change
in the tree...
|
|
|
Re: Click on SWTBotToolbarButton - nothing happens [message #483687 is a reply to message #483655] |
Wed, 02 September 2009 15:04 |
Eclipse User |
|
|
|
Aleksey Shumilin schrieb:
> Benjamin Glaser schrieb:
>> Sorry, but I can't replicate the issue.
>>
>> SWTBotView view = bot.viewByTitle("title");
>> SWTBotToolbarButton toolBarButton = view.toolbarButton("tooltip");
>> toolBarButton.click();
>>
>> works fine for me.
>> The Tree collaps as expected.
>>
>> I used viewbytitle because my testview didn't have an ID so far.
>> But I don't think this will change a lot.
>>
>> You don't get any exceptions?
>> It just don't happens anything?
>>
>> Pretty weird...
>>
>>
>>
>>
>
> The run-Method of the action is called, but isChecked() returns always
> false ...
>
> As a consequence the implementation assumes that the action is not
> enabled and can not add a filter(ViewerFilter) to the tree => no change
> in the tree...
.... could be an OS-problem ? (i have ubuntu)
|
|
|
|
Re: Click on SWTBotToolbarButton - nothing happens [message #483712 is a reply to message #483711] |
Wed, 02 September 2009 16:06 |
Eclipse User |
|
|
|
Pascal Gelinas schrieb:
> Aleksey Shumilin wrote:
>> Aleksey Shumilin schrieb:
>>> Benjamin Glaser schrieb:
>>>> Sorry, but I can't replicate the issue.
>>>>
>>>> SWTBotView view = bot.viewByTitle("title");
>>>> SWTBotToolbarButton toolBarButton =
>>>> view.toolbarButton("tooltip");
>>>> toolBarButton.click();
>>>>
>>>> works fine for me.
>>>> The Tree collaps as expected.
>>>>
>>>> I used viewbytitle because my testview didn't have an ID so far.
>>>> But I don't think this will change a lot.
>>>>
>>>> You don't get any exceptions?
>>>> It just don't happens anything?
>>>>
>>>> Pretty weird...
>>>>
>>>>
>>>>
>>>>
>>>
>>> The run-Method of the action is called, but isChecked() returns always
>>> false ...
>>>
>>> As a consequence the implementation assumes that the action is not
>>> enabled and can not add a filter(ViewerFilter) to the tree => no
>>> change in the tree...
>>
>> ... could be an OS-problem ? (i have ubuntu)
> I don't think it's an OS problem. The SWTBotToolbarButton doesn't set
> the checked status of the button, you should instead use a
> SWTBotToolbarCheckboxButton, like this:
>
> SWTBotView view = bot.viewByTitle("title");
> SWTBotToolbarButton toolBarButton =
> view.bot().toolbarToggleButton("tooltip");
> toolBarButton.click();
>
> I think this should work now. Or maybe not, I don't know if the bot will
> search in the global toolbar or the views toolbar. Give it a try and
> we'll know.
>
> Another way would be:
>
> SWTBotView view = bot.viewByTitle("title");
> SWTBotToolbarButton toolBarButton = view.toolbarButton("tooltip");
> new SWTBotToolbarCheckboxButton(toolBarButton.widget).click();
>
> I'm pretty sure this one will work, althought it looks clumsy to me...
>
thank you Pascal, the second way works fine!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03212 seconds