use of org.eclipse.egit.ui.internal.merge.GitMergeEditorInput in project egit by eclipse.
the class RebaseResultDialog method buttonPressed.
@Override
protected void buttonPressed(int buttonId) {
// store the preference to hide these dialogs
if (toggleButton != null)
Activator.getDefault().getPreferenceStore().setValue(UIPreferences.SHOW_REBASE_CONFIRM, !toggleButton.getSelection());
if (buttonId == IDialogConstants.OK_ID) {
if (result.getStatus() != Status.STOPPED) {
super.buttonPressed(buttonId);
return;
}
if (startMergeButton.getSelection()) {
super.buttonPressed(buttonId);
// open the merge tool
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject project : projects) {
RepositoryMapping mapping = RepositoryMapping.getMapping(project);
if (mapping != null && mapping.getRepository().equals(repo)) {
try {
// make sure to refresh before opening the merge
// tool
project.refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (CoreException e) {
Activator.handleError(e.getMessage(), e, false);
}
}
}
List<IPath> locationList = new ArrayList<>();
IPath repoWorkdirPath = new Path(repo.getWorkTree().getPath());
for (String repoPath : conflictPaths) {
IPath location = repoWorkdirPath.append(repoPath);
locationList.add(location);
}
IPath[] locations = locationList.toArray(new IPath[locationList.size()]);
int mergeMode = Activator.getDefault().getPreferenceStore().getInt(UIPreferences.MERGE_MODE);
CompareEditorInput input;
if (mergeMode == 0) {
MergeModeDialog dlg = new MergeModeDialog(getParentShell());
if (dlg.open() != Window.OK)
return;
input = new GitMergeEditorInput(dlg.useWorkspace(), locations);
} else {
boolean useWorkspace = mergeMode == 1;
input = new GitMergeEditorInput(useWorkspace, locations);
}
CompareUI.openCompareEditor(input);
return;
} else if (skipCommitButton.getSelection()) {
// skip the rebase
SkipRebaseCommand skipCommand = new SkipRebaseCommand();
execute(skipCommand);
} else if (abortRebaseButton.getSelection()) {
// abort the rebase
AbortRebaseCommand abortCommand = new AbortRebaseCommand();
execute(abortCommand);
} else if (doNothingButton.getSelection()) {
// nothing
}
}
super.buttonPressed(buttonId);
}
use of org.eclipse.egit.ui.internal.merge.GitMergeEditorInput in project egit by eclipse.
the class MergeToolActionHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
int mergeMode = Activator.getDefault().getPreferenceStore().getInt(UIPreferences.MERGE_MODE);
IPath[] locations = getSelectedLocations(event);
CompareEditorInput input;
if (mergeMode == 0) {
MergeModeDialog dlg = new MergeModeDialog(getShell(event));
if (dlg.open() != Window.OK)
return null;
input = new GitMergeEditorInput(dlg.useWorkspace(), locations);
} else {
boolean useWorkspace = mergeMode == 1;
input = new GitMergeEditorInput(useWorkspace, locations);
}
CompareUI.openCompareEditor(input);
return null;
}
Aggregations