|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.clients.versioncontrol.conflicts.resolutions.ConflictResolution
public abstract class ConflictResolution
Base class for conflict resolution. These objects are generally produced by
ConflictDescription
objects. This is an abstract base class.
Example: ConflictResolution[] resolutionOptions =
conflictDescription.getResolutions(); ConflictResolutionStatus status =
resolutionOptions[0].resolveConflict();
if(status == ConflictResolutionStatus.Success) Console.out.println("Conflict
resolved"); ...
or use a callback mechanism, as some conflict resolutions may be
long-running: resolutionOptions[0].addListener(new
ConflictResolutionStatusListener() { public void
StatusChanged(ConflictResolution r, ConflictResolutionStatus status) {
if(status == ConflictResolutionStatus.Success) Console.out.println("Conflict
resolved"); } }); resolutionOptions[0].resolveConflict();
Field Summary | |
---|---|
static java.lang.String |
DefaultErrorMessage
|
Constructor Summary | |
---|---|
protected |
ConflictResolution(ConflictDescription conflictDescription,
java.lang.String description,
java.lang.String helpText,
ConflictResolutionOptions options)
Base class constructor, should only be called by subclasses. |
Method Summary | |
---|---|
void |
addStatusListener(ConflictResolutionStatusListener listener)
Add a status listener for this conflict resolution. |
void |
cancel()
Cancel the conflict resolution. |
ConflictDescription |
getConflictDescription()
Gets the ConflictDescription which will be resolved by this resolver. |
Conflict[] |
getConflicts()
Queries the conflict resolver for any new conflicts which arised during the resolution of this conflict. |
java.lang.String |
getDescription()
Gets the description of this type of resolution (eg "check out and auto merge") |
java.lang.String |
getErrorMessage()
Gets all error messages that occured while resolving this conflict. |
java.lang.String |
getHelpText()
Gets the help text for this type of resolution (extended information suitable for displaying in a tooltip.) |
ConflictResolutionStatus |
getStatus()
Gets the current resolution status |
boolean |
needsEncodingSelection()
Determines whether conflict resolution requires an explicit encoding selection. |
boolean |
needsNewPath()
Determines whether conflict resolution requires a name selection. |
abstract ConflictResolution |
newForConflictDescription(ConflictDescription description)
|
void |
removeStatusListener(ConflictResolutionStatusListener listener)
Removes a status listener for this conflict resolution. |
ConflictResolutionStatus |
resolveConflict()
Resolve the conflict. |
abstract void |
setEncoding(FileEncoding encoding)
Sets the file encoding of the resultant merged file. |
protected void |
setErrorMessage(java.lang.String message)
Adds an error message that occurred while resolving. |
abstract void |
setNewPath(java.lang.String newPath)
Sets the server name of the resultant merged file. |
protected void |
setStatus(ConflictResolutionStatus status)
Subclasses may set the status of the resolution. |
protected abstract ConflictResolutionStatus |
work()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DefaultErrorMessage
Constructor Detail |
---|
protected ConflictResolution(ConflictDescription conflictDescription, java.lang.String description, java.lang.String helpText, ConflictResolutionOptions options)
conflictDescription
- the ConflictDescription which contains the conflict which this
class will resolve.description
- a description of this resolutionhelpText
- informative help text for this resolution. may be
null
Method Detail |
---|
public final ConflictResolutionStatus resolveConflict()
protected abstract ConflictResolutionStatus work() throws java.lang.Exception
java.lang.Exception
public abstract ConflictResolution newForConflictDescription(ConflictDescription description)
public void cancel()
protected final void setStatus(ConflictResolutionStatus status)
status
- ConflictResolutionStatus describing current resolution statepublic Conflict[] getConflicts()
public ConflictDescription getConflictDescription()
public java.lang.String getDescription()
public java.lang.String getHelpText()
String
containing a very detailed message to assist the
user. May be null
public boolean needsNewPath()
true
if the user must choose a name,
false
otherwisepublic abstract void setNewPath(java.lang.String newPath)
needsNewPath()
returns true.
newPath
- The new (server) file pathpublic boolean needsEncodingSelection()
true
if the user must choose an encoding,
false
otherwise.public abstract void setEncoding(FileEncoding encoding)
needsEncodingSelection()
returns true.
encoding
- The new FileEncodingpublic final ConflictResolutionStatus getStatus()
protected void setErrorMessage(java.lang.String message)
message
- A String representing a resolution errorpublic java.lang.String getErrorMessage()
public void addStatusListener(ConflictResolutionStatusListener listener)
listener
- A ConflictResolutionStatusListener which will be notified of
status changespublic void removeStatusListener(ConflictResolutionStatusListener listener)
listener
- A ConflictResolutionStatusListener which should no longer be
notified of status changes
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |