Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » using monitors and submonitors
using monitors and submonitors [message #756942] Tue, 15 November 2011 15:56
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1612
Registered: July 2009
Senior Member

I started to use monitor (with submonitors), and by reading here

I understand that the correct use case is as follows (for instance,
reusing the code in the FAQ):

if this is the main method (copied from the FAQ)

public void move(File a, File b, IProgressMonitor pm) {
try {
pm.beginTask("Moving", 10);
copy(a, b, new SubProgressMonitor(pm, 8));
delete(a, new SubProgressMonitor(pm, 2));
} finally {

then, in copy and deleted (not shown in the FAQ) I should do as follows:

public void copy(File a, File b, IProgressMonitor pm) {
pm.beginTask("Copying", 1);

public void delete(File a, IProgressMonitor pm) {
pm.beginTask("Deleting", 1);

However, if I do like this, the message on the monitor is not changed...
it is changed only if I do




so what is the correct way of using monitors and submonitors?

thanks in advance

Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
Previous Topic:Re: Custom LaunchShortcut, debugger does not link source
Next Topic:Understanding the Evolution Eclipse non-APIs
Goto Forum:

Current Time: Sun Nov 29 17:47:39 GMT 2015

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

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