org.netbeans.libs.git/1 1.1

org.netbeans.libs.git.progress
Class ProgressMonitor

java.lang.Object
  extended by org.netbeans.libs.git.progress.ProgressMonitor
Direct Known Subclasses:
ProgressMonitor.DefaultProgressMonitor

public abstract class ProgressMonitor
extends Object

Used to follow progress and control flow of git commands. An instance of GitClient provides methods to start proper git commands and such a method accepts an instance if ProgressMonitor as its argument. Clients of the git API may extend this class and through its methods catch error and warning messages produced by a git command, changes in the state of a command (when the command is started and when it's finished) and they may cancel a running command by implementing the isCanceled method.


Nested Class Summary
static class ProgressMonitor.DefaultProgressMonitor
          Basic implementation of the ProgressMonitor abstract class.
 
Constructor Summary
ProgressMonitor()
           
 
Method Summary
abstract  void finished()
          Called by a git command when it finishes its progress.
abstract  boolean isCanceled()
          Returns true if the progress should be canceled.
abstract  void notifyError(String message)
          Called when an error occurs during a git command's execution that however does not prevent it from further actions.
abstract  void notifyWarning(String message)
          Called when a non-fatal warning should be delivered to a git command's caller.
abstract  void preparationsFailed(String message)
          Called when a git command fails to start.
abstract  void started(String command)
          Called when a git command is started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProgressMonitor

public ProgressMonitor()
Method Detail

isCanceled

public abstract boolean isCanceled()
Returns true if the progress should be canceled. Git commands periodically check the result of the method and end their progress immediately when the method returns true


started

public abstract void started(String command)
Called when a git command is started. Implement this method to catch the event.

Parameters:
command - a string representing a commandline version of the started command

finished

public abstract void finished()
Called by a git command when it finishes its progress.


preparationsFailed

public abstract void preparationsFailed(String message)
Called when a git command fails to start. Implement this method to catch a description of an error occurred during a git command initialization that prevents it from start running.

Parameters:
message - error description

notifyError

public abstract void notifyError(String message)
Called when an error occurs during a git command's execution that however does not prevent it from further actions. Some commands for example operate with many files and if an error occurs while working (e.g. checkout) with one of them, this method is called and the command continues with other files.

Parameters:
message - description of the error

notifyWarning

public abstract void notifyWarning(String message)
Called when a non-fatal warning should be delivered to a git command's caller.

Parameters:
message - description of the warning

org.netbeans.libs.git/1 1.1

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.