|
Re: Test BehaviorSection and workbench copy paste actions [message #99163 is a reply to message #98951] |
Thu, 24 May 2007 12:41 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Jerome Gout![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=jerome.gout%40fr.ibm.com) Messages: 8 Registered: July 2009 |
Junior Member |
|
|
Hi Holger,
Holger Machens wrote:
> I would like to add copy paste actions for test elements in the behavior
> section of the test suite editor to the workbench menu.
> Is it right, to register the actions via the ViewSite interface?
> If yes, how do I get access to the ViewSite interface from
> BehaviorSection classes?
Yes, I think you are right, the right way would be to set a global handler
using the IActionBars instance returned by the IEditorSite (we are not in
a view but in an editor).
Well, to get the editor site you need to use the following methods chain:
BehaviorSection.getHyadesEditorPart() (method defined in its ancestor
EditorSection) which returns a IHyadesEditorPart, then call
getEditorPart() to retrieve the Eclipse IEditorPart instance, then you can
get the IEditorSite by getEditorSite() and finally getActionBars().
BehaviorSection section = .....
IActionBars bars =
section.getHyadesEditorPart().getEditorPart().getEditorSite( ).getActionBars();
bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ....);
Note for copying elements in the behavior section:
You need to keep in mind that invocations have IDs that should be unique.
So when copying such elements you need to produce unique new IDs for
copies.
Do not hesitate to suggest your work as a TPTP contribution.
Jerome
|
|
|
Re: Test BehaviorSection and workbench copy paste actions [message #103149 is a reply to message #99163] |
Thu, 05 July 2007 12:43 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Holger Machens![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=machens%40informatik.fh-wiesbaden.de) Messages: 57 Registered: July 2009 |
Member |
|
|
Hi Jerome,
Thank you, for your help!
We will think about contribution, but I think this work is too special.
Greetings
Holger
Jerome Gout schrieb:
> Hi Holger,
>
> Holger Machens wrote:
>
>> I would like to add copy paste actions for test elements in the behavior
>> section of the test suite editor to the workbench menu.
>> Is it right, to register the actions via the ViewSite interface?
>> If yes, how do I get access to the ViewSite interface from
>> BehaviorSection classes?
>
> Yes, I think you are right, the right way would be to set a global
> handler using the IActionBars instance returned by the IEditorSite (we
> are not in a view but in an editor).
>
> Well, to get the editor site you need to use the following methods chain:
>
> BehaviorSection.getHyadesEditorPart() (method defined in its ancestor
> EditorSection) which returns a IHyadesEditorPart, then call
> getEditorPart() to retrieve the Eclipse IEditorPart instance, then you
> can get the IEditorSite by getEditorSite() and finally getActionBars().
>
> BehaviorSection section = .....
> IActionBars bars =
> section.getHyadesEditorPart().getEditorPart().getEditorSite( ).getActionBars();
>
> bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ....);
>
> Note for copying elements in the behavior section:
> You need to keep in mind that invocations have IDs that should be
> unique. So when copying such elements you need to produce unique new IDs
> for copies.
>
> Do not hesitate to suggest your work as a TPTP contribution.
>
> Jerome
>
|
|
|
Powered by
FUDForum. Page generated in 0.04819 seconds