Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Pass the selection of the Package Explorer into a New Wizard
Pass the selection of the Package Explorer into a New Wizard [message #494402] Fri, 30 October 2009 14:14 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi all,

how can i pass the selection of an IResource, which is selected in the
Package Explorer, into a Wizard? I thought, this will be covered by the
ISelection and init(IWorkbench,ISelection), which is generated by
default, but that is not true.

Can someone give me a hint?

Thanks a lot
Timothy
Re: Pass the selection of the Package Explorer into a New Wizard [message #494602 is a reply to message #494402] Sat, 31 October 2009 23:57 Go to previous messageGo to next message
Wim Jongman is currently offline Wim JongmanFriend
Messages: 423
Registered: July 2009
Senior Member
Hi Timothy,

Can't you get the current selection in your wizard?


PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSele ctionService().getSelection()

Best regards,

Wim


> Hi all,
>
> how can i pass the selection of an IResource, which is selected in the
> Package Explorer, into a Wizard? I thought, this will be covered by the
> ISelection and init(IWorkbench,ISelection), which is generated by
> default, but that is not true.
>
> Can someone give me a hint?
>
> Thanks a lot
> Timothy
Re: Pass the selection of the Package Explorer into a New Wizard [message #494603 is a reply to message #494402] Sat, 31 October 2009 23:58 Go to previous messageGo to next message
Remy Suen is currently offline Remy SuenFriend
Messages: 462
Registered: July 2009
Senior Member
On Fri, 30 Oct 2009 15:14:19 +0100, Timothy Marc wrote:
> I thought, this will be covered by the
> ISelection and init(IWorkbench,ISelection), which is generated by
> default, but that is not true.

So does the init method even get called? If yes, what is in the selection
then?

Regards,
Remy
Re: Pass the selection of the Package Explorer into a New Wizard [message #494654 is a reply to message #494402] Sun, 01 November 2009 21:24 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi,

@Wim: Well, with
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSele ctionService().getSelection()

the currently selected resource is accessible. Thanks for this advice.

@Remy:
However, the ISelection object in the init-Method, which is called, is
empty. I think, this ISelection object should not be null, should it?

Thanks
Timothy

Timothy Marc schrieb:
> Hi all,
>
> how can i pass the selection of an IResource, which is selected in the
> Package Explorer, into a Wizard? I thought, this will be covered by the
> ISelection and init(IWorkbench,ISelection), which is generated by
> default, but that is not true.
>
> Can someone give me a hint?
>
> Thanks a lot
> Timothy
Previous Topic:ControlContribution from toolbar:org.eclipse.ui.main.toolbar#dynamic
Next Topic:Restoring empty shell for detached non-restorable views
Goto Forum:
  


Current Time: Thu Apr 18 15:52:23 GMT 2024

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

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

Back to the top