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 10:14 Go to next message
Timothy Marc is currently offline Timothy Marc
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 19:57 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
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 19:58 Go to previous messageGo to next message
Remy Suen is currently offline Remy Suen
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 16:24 Go to previous message
Timothy Marc is currently offline Timothy Marc
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: Wed Jul 23 14:14:22 EDT 2014

Powered by FUDForum. Page generated in 0.01695 seconds