/******************************************************************************
 * This program and the accompanying materials are made available under
 * the terms of the Common Public License v1.0 which accompanies this
 * distribution, and is available at the following URL:
 * http://www.eclipse.org/legal/cpl-v10.html
 * Copyright(c) 2003-2005 by the authors indicated in the @author tags.
 *
 * All Rights are Reserved by the various authors.
 *******************************************************************************/
package org.tigris.subversion.subclipse.core.client;

import org.eclipse.core.runtime.IProgressMonitor;

/**
 * ISVNNotifyListener implementation which intercepts the logMessage() method
 * and used it to display the operation progress within the supplied progress monitor.
 * 
 * @author Martin Letenay (letenay at tigris.org)
 */
public class OperationProgressNotifyListener extends ISVNNotifyAdapter {

	private IProgressMonitor monitor = null;
	
	public OperationProgressNotifyListener(final IProgressMonitor monitor)
	{
		super();
		this.monitor = monitor;
	}
	
	/**
	 * Display the log the message in the progress monitor and increase the progress by 1
	 */
	public void logMessage(String message) {
		if (monitor != null)
		{
		    monitor.worked(1);
		    monitor.subTask(message);
		}
	}
	
	/**
	 * The operation was completed, clear the progress' subTask.
	 */
	public void logCompleted(String message) {
		if (monitor != null)
		{
		    monitor.subTask(" ");
		}		
	}

}

@@ -72,17 +72,16 @@
 ********
-%0D
 %0A * This
@@ -144,17 +144,16 @@
 le under
-%0D
 %0A * the 
@@ -214,17 +214,16 @@
 ies this
-%0D
 %0A * dist
@@ -270,17 +270,16 @@
 ing URL:
-%0D
 %0A * http
@@ -315,17 +315,16 @@
 v10.html
-%0D
 %0A * Copy
@@ -391,13 +391,11 @@
 ags.
-%0D
 %0A *
-%0D
 %0A * 
@@ -441,17 +441,16 @@
 authors.
-%0D
 %0A ******
@@ -523,17 +523,16 @@
 *******/
-%0D
 %0Apackage
@@ -576,19 +576,17 @@
 .client;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -631,16 +631,13 @@
 tor;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -710,17 +710,16 @@
 ) method
-%0D
 %0A * and 
@@ -801,14 +801,12 @@
 tor.
-%0D
 %0A * 
-%0D
 %0A * 
@@ -855,14 +855,12 @@
 org)
-%0D
 %0A */
-%0D
 %0Apub
@@ -928,19 +928,17 @@
 dapter %7B
-%0D%0A%0D
+%0A
 %0A%09privat
@@ -971,20 +971,18 @@
  = null;
-%0D
 %0A%09
-%0D
 %0A%09public
@@ -1049,13 +1049,11 @@
 tor)
-%0D
 %0A%09%7B
-%0D
 %0A%09%09s
@@ -1059,17 +1059,16 @@
 super();
-%0D
 %0A%09%09this.
@@ -1085,30 +1085,26 @@
 monitor;
-%0D
 %0A%09%7D
-%0D
 %0A%09
-%0D
 %0A%09/**
-%0D
 %0A%09 * Dis
@@ -1182,23 +1182,21 @@
 ess by 1
-%0D
 %0A%09 */
-%0D
 %0A%09public
@@ -1221,33 +1221,32 @@
 tring message) %7B
-%0D
 %0A%09%09if (monitor !
@@ -1244,38 +1244,36 @@
 monitor != null)
-%0D
 %0A%09%09%7B
-%0D
 %0A%09%09    monitor.w
@@ -1281,17 +1281,16 @@
 rked(1);
-%0D
 %0A%09%09    m
@@ -1317,27 +1317,22 @@
 ge);
-%0D
 %0A%09%09%7D
-%0D
 %0A%09%7D
-%0D
 %0A%09
-%0D
 %0A%09/**
-%0D
 %0A%09 *
@@ -1393,15 +1393,13 @@
 ask.
-%0D
 %0A%09 */
-%0D
 %0A%09pu
@@ -1438,17 +1438,16 @@
 ssage) %7B
-%0D
 %0A%09%09if (m
@@ -1465,14 +1465,12 @@
 ull)
-%0D
 %0A%09%09%7B
-%0D
 %0A%09%09 
@@ -1497,22 +1497,17 @@
  %22);
-%0D
 %0A%09%09%7D%09%09
-%0D
 %0A%09%7D
-%0D%0A%0D
+%0A
 %0A%7D
-%0D
 %0A

Set svn:eol-style on new files