Hi Kalali,

Thank you a lot for your message.  I did manage to have a custom DataManager 
show on the left by using custom perspectives.

Basically, I created a new class and made it inherit from QObject and 
berry::IPerspectiveFactory. In its CreateInitialLayout I added the custom 
DataManager as with the method berry::IPageLayout::Pointer::AddView. Then, I 
added the new perspective in the plugin.xml of the main application plugin:

<extension point="org.blueberry.ui.perspectives">
  <perspective
    id="org.sv.application.defaultperspective"
    name="SimVascular"
    class="sv4guiDefaultPerspective"
    icon="resources/icon.png">
  </perspective>
</extension>

Thank you again for the support.

Best,
Luca

> On Mar 2, 2023, at 1:43 AM, Kalali, Amir <a.kal...@dkfz-heidelberg.de> wrote:
> 
> Hi Luca,
>  
> I’m not exactly sure how to do this but when you first start your Workbench, 
> the following function is called:
> QmitkExtDefaultPerspective::CreateInitialLayout
> You can find this class inside the 
> “Plugins\org.mitk.gui.qt.extapplication\src\internal\perspectives”.
> I did not test it but maybe it helps to remove adding the 
> “org.mitk.views.datamanager” view to the layout there (and maybe add your 
> view there).
> Apart from that my tip is to search the source code for the 
> datamanager-string above and look out for “perspective”.
>  
> However, this function above is not called when the Workbench was opened 
> before. In that case, the default initial layout is not created but a custom 
> one that was saved in your user-app-directory (I’m not sure where to find 
> this on Ubuntu (some .dkfz or .mitk directory)).
> To start with default values / perspectives, you can start MITK with 
> “./MITKWorkbench --BlueBerry.clean”.
>  
> Additionally, you could create your own perspective, that will remove the 
> unwanted views and add your custom views in any customized layout. For an 
> example, see the other classes in the mentioned 
> “Plugins\org.mitk.gui.qt.extapplication\src\internal\perspectives” directory 
> (and the plugin.xml of that plugin).
> You can select them using “Window -> Open Perspective”.
>  
> Best regards,
>  
> Amir
>  
>  
> Von: Luca Pegolotti <pegolotti.l...@gmail.com> 
> Gesendet: Thursday, 2 March, 2023 01:52
> An: mitk-users@lists.sourceforge.net
> Betreff: [mitk-users] MITK using default DataManager instead of custom one
>  
> Hi MITK community,
>  
> The MITK-based application I am working 
> <https://github.com/lucapegolotti/SimVascular> on implements a custom 
> DataManager.  Although the custom DataManager plugin is found and launched at 
> program startup, the application framework still chooses to display the 
> default MITK DataManager on the left.  If you look at the attached 
> screenshot, you can see that two data managers are open and that on the left 
> is the default MITK one (hence, it doesn’t uses features that we implemented 
> such as custom context menu items).
>  
> My question is: is there a way to force MITK to use the custom DataManager 
> instead of the default one on the left? Any help or links to the relevant 
> documentation would be greatly appreciated.
>  
> Best regards,
> Luca Pegolotti

_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to