Skip to main content



      Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Test BehaviorSection and workbench copy paste actions
Test BehaviorSection and workbench copy paste actions [message #98951] Tue, 22 May 2007 09:18 Go to next message
Eclipse UserFriend
Hi,



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?



Thanks in advance,

Holger
Re: Test BehaviorSection and workbench copy paste actions [message #99163 is a reply to message #98951] Thu, 24 May 2007 08:41 Go to previous messageGo to next message
Eclipse UserFriend
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 08:43 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:AGR with TPTP4.4?
Next Topic:AGR 4.4 Hangs in Standard Mode
Goto Forum:
  


Current Time: Sat May 10 06:31:31 EDT 2025

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

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

Back to the top