Hi Miklos,

you are on the right track!

Cheers,

Sascha


On 05/31/2017 06:24 PM, Miklos Espak wrote:
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 <mailto: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:

    voidMultiViewerEditor::OnSelectionChanged()

    {

    
berry::IWorkbenchWindow::PointerworkbenchWindow=this->GetSite()->GetWorkbenchWindow();

    
berry::ISelectionService*workbenchWindowSelectionService=workbenchWindow->GetSelectionService();

    
berry::ISelection::ConstPointerselection=workbenchWindowSelectionService->GetSelection("org.mitk.views.datamanager");

    
berry::IViewPart::PointerdataManagerView=workbenchWindow->GetActivePage()->FindView("org.mitk.views.datamanager");

    QmitkDataNodeSelectionProvider::PointerdataManagerSelectionProvider=

    
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

------------------------------------------------------------------------------
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

Reply via email to