简体   繁体   中英

Eclipse-RCP: How to add a plug-in with an application model into a perspective of a new RCP application?

I am trying integrate several subsystems where each subsystem is developed as an E4 plug-in with its own application model for UI. I would like build a new RCP application with multiple perspectives and each perspective holds a subsystem. Subsystems may exchange some data, but not much.

I am new to Eclipse RCP and just went through Lars Vogel's RCP tutorial. I still cannot totally understand how the framework works. Should I add subsystems as plug-ins or fragments? Do I need to define extension points in the final system and extensions in subsystem plug-ins? It seems that an application can only have one application model. If a plug-in application model cannot be added into another application, what's the right approach for my task?

You add the components as plugins.

The main RCP plugin should have the application model (Application.e4xmi).

The plugins adding to the application can use an application model fragment to contribute to the model ( New > Other > Eclipse 4 > Model > New Model Fragment ). You use the org.eclipse.e4.workbench.model extension point to declare the model fragment:

<extension
     id="fragmentId"
     point="org.eclipse.e4.workbench.model">
  <fragment
        uri="fragment.e4xmi">
  </fragment>
</extension>

Model fragments use Model Fragment entries to add the various parts of the model.

Lars Vogel has another tutorial on fragments here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM