Author Topic: EditorModelManager Error  (Read 1076 times)

Whinard

  • Member
  • **
  • Posts: 19
EditorModelManager Error
« 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?
« Last Edit: June 29, 2017, 13:29:40 PM by Whinard »

Whinard

  • Member
  • **
  • Posts: 19
Re: EditorModelManager Error
« Reply #1 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();

Hervé

  • Hero Member
  • *****
  • Posts: 487
Re: EditorModelManager Error
« Reply #2 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), I'm personaly using the factory because I do not wish the default forlders and view to be created:
Code: [Select]
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:
Code: [Select]
IArchimateModel model = IEditorModelManager.INSTANCE.createModel()

Best regards
Hervé