Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Progress Reporting
[Acceleo] Progress Reporting [message #695813] Tue, 12 July 2011 15:17 Go to next message
stuart mackey is currently offline stuart mackeyFriend
Messages: 7
Registered: July 2009
Junior Member
Acceleo doesn't seem to do anything with the Monitor instance passed into it other than check for cancellation while visiting nodes of the template file model.

Is that intentional or a not-yet-implemented feature?

As a workaround currently I add an IAcceleoTextGenerationListener and update my progress monitor for each fileGenerated event.

That's a rather course level of progress reporting though. The template engine could provide more fine-grained progress as it proceeds through the template.
Re: [Acceleo] Progress Reporting [message #696086 is a reply to message #695813] Wed, 13 July 2011 08:38 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi Stuart,

Which version of Acceleo are you using? If you have Acceleo 3.0, do you reproduce this issue with Acceleo 3.1?
You can grab Acceleo 3.1, here: http://download.eclipse.org/modeling/m2t/acceleo/updates/releases/3.1

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo] Progress Reporting [message #758739 is a reply to message #695813] Thu, 24 November 2011 12:51 Go to previous messageGo to next message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
I'm encountering the same problem with IndigoSR1 and Acceleo 3.2.0. I tried to use a ProgressMonitorDialog to pass some feedback about the current progress to the user. However, the code is being generated, but no ProgressMonitorDialog is shown to the user.

ProgressMonitorDialog dlg = new ProgressMonitorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
dlg.create();
dlg.setOpenOnRun(true);			
generator.doGenerate(BasicMonitor.toMonitor(dlg.getProgressMonitor()));
Re: [Acceleo] Progress Reporting [message #760081 is a reply to message #758739] Thu, 01 December 2011 09:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

How exactly are you launching the generation? You don't usually create your own progress monitor, but reuse one that you are fed. For example in this case I'd use something of the sort :

IRunnableWithProgress runnable = new IRunnableWithProgress() {
    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        ...
        generator.doGenerate(BasicMonitor.toMonitor(monitor));
    }
};
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(runnable);


Laurent Goubet
Obeo
Re: [Acceleo] Progress Reporting [message #760268 is a reply to message #695813] Thu, 01 December 2011 17:43 Go to previous messageGo to next message
stuart mackey is currently offline stuart mackeyFriend
Messages: 7
Registered: July 2009
Junior Member
My code does pretty much exactly what your sample code shows Laurent.

SubProgressMonitor codegenMonitor = new SubProgressMonitor(monitor, 70);
final Monitor acceleoMonitor = BasicMonitor.toMonitor(codegenMonitor);
acceleoMonitor.beginTask("Generating code...", countFilesToBeGenerated(...));
			
Generate generator = new Generate(someArgument, targetFolder , Collections.emptyList());
			
generator.addGenerationListener(new AcceleoGenerationAdapter() {
	public void fileGenerated(AcceleoTextGenerationEvent event) {
		acceleoMonitor.worked(1);
	}
});

generator.generate(acceleoMonitor);



Here you see my workaround for progress - since Acceleo doesn't seem to update the progress monitor I added a GenerationListener and update the monitor myself for each file I see generated.
Re: [Acceleo] Progress Reporting [message #761084 is a reply to message #760081] Mon, 05 December 2011 21:38 Go to previous message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
Laurent Goubet wrote on Thu, 01 December 2011 04:00
Hi,

How exactly are you launching the generation? You don't usually create your own progress monitor, but reuse one that you are fed.


Hi Laurent,

thanks for the hint. I tried it the way you suggested and it works fine now!

Thank you!!
Previous Topic:[ACCELEO] Argument cannot be null
Next Topic:index inside for
Goto Forum:
  


Current Time: Sat Apr 20 06:15:04 GMT 2024

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

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

Back to the top