Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Running modisco discover on save action
Running modisco discover on save action [message #1417404] Fri, 05 September 2014 10:43 Go to next message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

I am running the discoverer programmatically like it is mentioned in the forum:

	try {
			DiscoverJavaModelFromJavaProject javaDiscoverer = new DiscoverJavaModelFromJavaProject();
			if (javaDiscoverer.isApplicableTo(this.javaProject)) {

				javaDiscoverer.discoverElement(this.javaProject, new NullProgressMonitor());

				Resource javaResource = javaDiscoverer.getTargetModel();
				javaResource.setURI(uri);
				javaResource.save(null);

			}
		} catch (DiscoveryException | FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


This works quit well for me. I trigger it now by using an Eclipse-Action (IEditorActionDelegate) on the
Java editor. Now I would like to do this serialization every time my java resources
are changed/saved. But I dont know how to trigger the save-events for a specific project.
Maybe someone can give me a hint where to start?

~Alex
Re: Running modisco discover on save action [message #1417430 is a reply to message #1417404] Fri, 05 September 2014 12:07 Go to previous message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 667
Registered: July 2009
Senior Member
Hello,

Thanks for using the MoDisco project and some of its components.
It seems more like an Eclipse IDE problem than a MoDisco one, so you should get more hints putting this particular post on the dedicated forum.
Anyway, maybe this page from the documentation could help you to start with.


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:Developer Setup
Next Topic:Creating a new discoverer
Goto Forum:
  


Current Time: Sat Jun 23 23:57:31 GMT 2018

Powered by FUDForum. Page generated in 0.02050 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top