use of com.oxygenxml.git.service.entities.FileStatusOverDiffEntry in project oxygen-git-client-addon by oxygenxml.
the class HistoryViewContextualMenuPresenter method createCompareActionsForCommit.
/**
* Creates the DIFF actions for an actual commit from history.
*
* @param actions List where to put the actions.
* @param commitCharacteristics Commit data.
* @param addFileName <code>true</code> to append the name of the file to the actions' name.
* @param fileStatus File to diff.
*/
private void createCompareActionsForCommit(List<Action> actions, CommitCharacteristics commitCharacteristics, boolean addFileName, FileStatus fileStatus) {
String filePath = fileStatus.getFileLocation();
if (fileStatus instanceof FileStatusOverDiffEntry && fileStatus.getChangeType() == GitChangeType.RENAME) {
actions.add(new AbstractAction(getCompareWithPreviousVersionActionName(filePath, addFileName)) {
@Override
public void actionPerformed(ActionEvent e) {
try {
DiffPresenter.showTwoWayDiff(((FileStatusOverDiffEntry) fileStatus));
} catch (MalformedURLException e1) {
PluginWorkspaceProvider.getPluginWorkspace().showErrorMessage(UNABLE_TO_COMPARE + e1.getMessage());
LOGGER.error(e1.getMessage(), e1);
}
}
});
} else if (fileStatus.getChangeType() != GitChangeType.ADD) {
addCompareWithParentsAction(actions, commitCharacteristics, addFileName, filePath);
}
addCompareWithWorkingTreeAction(actions, commitCharacteristics, addFileName, filePath);
}
Aggregations