java.lang.Object
org.eclipse.jgit.internal.diffmergetool.UserDefinedDiffTool
- All Implemented Interfaces:
ExternalDiffTool
- Direct Known Subclasses:
PreDefinedDiffTool
,UserDefinedMergeTool
The user-defined diff tool.
-
Constructor Summary
ConstructorsConstructorDescriptionUserDefinedDiffTool
(String name, String path, String cmd) Creates the diff tool -
Method Summary
Modifier and TypeMethodDescriptionThe command of the diff tool.getName()
Get tool namegetPath()
The path of the diff tool.boolean
Whether tool is availablevoid
setAvailable
(boolean available) Set whether tool is availablevoid
Overrides the path for the given tool.
-
Constructor Details
-
UserDefinedDiffTool
Creates the diff tool- Parameters:
name
- the namepath
- the pathcmd
- the command
-
-
Method Details
-
getName
Description copied from interface:ExternalDiffTool
Get tool name- Specified by:
getName
in interfaceExternalDiffTool
- Returns:
- the diff tool name
-
getPath
The path of the diff tool.The path to a pre-defined external diff tool can be overridden by specifying
difftool.<tool>.path
in a configuration file.For a user defined diff tool (that does not override a pre-defined diff tool), the path is ignored when invoking the tool.
- Specified by:
getPath
in interfaceExternalDiffTool
- Returns:
- the diff tool path
- See Also:
-
getCommand
The command of the diff tool.A pre-defined external diff tool can be overridden using the tools name in a configuration file. The overwritten tool is then a user defined tool and the command of the diff tool is specified with
difftool.<tool>.cmd
. This command must work without prepending the value ofgetPath()
and can sometimes include tool parameters.- Specified by:
getCommand
in interfaceExternalDiffTool
- Returns:
- the diff tool command
- See Also:
-
isAvailable
public boolean isAvailable()Description copied from interface:ExternalDiffTool
Whether tool is available- Specified by:
isAvailable
in interfaceExternalDiffTool
- Returns:
- availability of the tool: true if tool can be executed and false if not
-
setAvailable
public void setAvailable(boolean available) Set whether tool is available- Parameters:
available
- true if tool can be found and false if not
-
setPath
Overrides the path for the given tool. Equivalent to settingdifftool.<tool>.path
.- Parameters:
path
- the new diff tool path- See Also:
-