Archi Forum

Archi => Archi Development => Topic started by: Whinard on June 29, 2017, 13:19:33 PM

Title: EditorModelManager Error
Post by: Whinard on June 29, 2017, 13:19:33 PM
Hello,

For a plug-in I am writing, I am using an EditorModelManager to save and close models. It works perfectly in debug mode in eclipse, but when I export the plug-in and run it in Archi, I recieve a NoClassDefFoundError.

The line causing the error is simply

EditorModelManager emm = new EditorModelManager();

Any help on why I am getting this error?
Title: Re: EditorModelManager Error
Post by: Whinard on June 29, 2017, 13:37:52 PM
I have solved my own problem, but here is what I did incase someone else stumbles upon this problem.

In order to use any of the EditorModelManager methods, you must use

IEditorModelManager.INSTANCE.methodname();

You cannot use:

EditorModelManager emm = new EditorModelManager();
or
EditorModelManager.INSTANCE.methodname();
Title: Re: EditorModelManager Error
Post by: Hervé on June 29, 2017, 14:05:43 PM
Hi Whinard,

You did not leave us a lot of time to give you an answer :)

In my database plugin (https://github.com/archi-contribs/database-plugin (https://github.com/archi-contribs/database-plugin)), I'm personaly using the factory because I do not wish the default forlders and view to be created:

IArchimateModel model = IArchimateFactory.eINSTANCE.createArchimateModel();


Bu if you wish to create a model that contains those default folders and view, then the following is for you:

IArchimateModel model = IEditorModelManager.INSTANCE.createModel()


Best regards
Hervé