By extracting them the ecore Editor will lose the information unfortunately, which means some extra work...
I had the same issue with sirius and sub e-packages leading to sirius crashing the diagram constantly.
Here is how i solved extracting a sub-epackage:
- First Create a new .ecore file for your desired sub-package.
- Open both .ecore files (your main and the new one) with the Sample
ecore model editor (treeview).
- Copy the Package properties to your new epackage node(ns, praefix,
uri) you need to do this manually.
- Then drag and drop your whole contents(excluding the purple package
node) from your subpackage into the new Epackage
- Save and make sure no errors in your new file occur.
- load your new .ecore file into your main file by clicking "Load
resource" Now your main file knows 2 kinds of the EClasses you have in your sub-package, their names are identical but their uri is
different.
you could now simply replace all occurrences of sub-epackage-eclasses with the newer ones or smarter and safer
- Replace an etype one time (where actually use the etype in your root package)
- open your main .ecore file as text, you will see that the etype values all
have a path like
eType="ecore:EClass
../../org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"
Then You need to know how your etype paths (from your sub-epackage and your new one) differ so you can simply replace them all and your good.
- finally delete the sub-epackage
Hope this helps