OK, I got it work. The editor had to register its own selection provider. I
copied the implementation from QmitkAbstractView.
Cheers,
Miklos
On 31 May 2017 at 16:19, Miklos Espak <m.es...@ucl.ac.uk> wrote:
> Hi,
>
> we have a custom editor (aka. DnD Display) that can contain multiple image
> viewers for viewing images side by side.
>
> I would like to maintain the data node selection for each internal viewer,
> so that when the user changes the selected (focused) viewer, the earlier
> data manager selection for that viewer is restored, and (!) all the views
> are notified about the selection change and update their status.
>
> I cannot figure out, how to do that. :-(
>
> The editor derives from QmitkAbstractRenderEditor and
> mitk::ILinkedRenderWindowPart, and it receives a signal when the selection
> has to be changed.
>
> I tried this but the views are not notified:
>
> void MultiViewerEditor::OnSelectionChanged()
>
> {
>
> berry::IWorkbenchWindow::Pointer workbenchWindow =
> this->GetSite()->GetWorkbenchWindow();
>
> berry::ISelectionService* workbenchWindowSelectionService =
> workbenchWindow->GetSelectionService();
>
> berry::ISelection::ConstPointer selection =
> workbenchWindowSelectionService->GetSelection("org.mitk.views.datamanager");
>
>
> berry::IViewPart::Pointer dataManagerView =
> workbenchWindow->GetActivePage()->FindView("org.mitk.views.datamanager");
>
>
> QmitkDataNodeSelectionProvider::Pointer dataManagerSelectionProvider =
>
>
> dataManagerView->GetSite()->GetSelectionProvider().Cast<QmitkDataNodeSelectionProvider>();
>
> dataManagerSelectionProvider->SetSelection(selection);
>
> }
>
>
> Any idea?
>
> Cheers,
> Miklos
>
>
>
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users