org.netbeans.libs.git/1 1.1

org.netbeans.libs.git.progress
Class ProgressMonitor.DefaultProgressMonitor

java.lang.Object
  extended by org.netbeans.libs.git.progress.ProgressMonitor
      extended by org.netbeans.libs.git.progress.ProgressMonitor.DefaultProgressMonitor
Enclosing class:
ProgressMonitor

public static class ProgressMonitor.DefaultProgressMonitor
extends ProgressMonitor

Basic implementation of the ProgressMonitor abstract class. Provides no functionality except for canceling a running command. To cancel a running command invoke the cancel method.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.netbeans.libs.git.progress.ProgressMonitor
ProgressMonitor.DefaultProgressMonitor
 
Constructor Summary
ProgressMonitor.DefaultProgressMonitor()
           
 
Method Summary
 boolean cancel()
          Cancels a currently running command.
 void finished()
          Called by a git command when it finishes its progress.
 boolean isCanceled()
          Returns true if the progress should be canceled.
 void notifyError(String message)
          Called when an error occurs during a git command's execution that however does not prevent it from further actions.
 void notifyWarning(String message)
          Called when a non-fatal warning should be delivered to a git command's caller.
 void preparationsFailed(String message)
          Called when a git command fails to start.
 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.DefaultProgressMonitor

public ProgressMonitor.DefaultProgressMonitor()
Method Detail

cancel

public final boolean cancel()
Cancels a currently running command.

Returns:
false if the command has already been canceled before. Otherwise returns true

isCanceled

public final boolean isCanceled()
Description copied from class: ProgressMonitor
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

Specified by:
isCanceled in class ProgressMonitor

started

public void started(String command)
Description copied from class: ProgressMonitor
Called when a git command is started. Implement this method to catch the event.

Specified by:
started in class ProgressMonitor
Parameters:
command - a string representing a commandline version of the started command

finished

public void finished()
Description copied from class: ProgressMonitor
Called by a git command when it finishes its progress.

Specified by:
finished in class ProgressMonitor

preparationsFailed

public void preparationsFailed(String message)
Description copied from class: ProgressMonitor
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.

Specified by:
preparationsFailed in class ProgressMonitor
Parameters:
message - error description

notifyError

public void notifyError(String message)
Description copied from class: ProgressMonitor
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.

Specified by:
notifyError in class ProgressMonitor
Parameters:
message - description of the error

notifyWarning

public void notifyWarning(String message)
Description copied from class: ProgressMonitor
Called when a non-fatal warning should be delivered to a git command's caller.

Specified by:
notifyWarning in class ProgressMonitor
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.