use of org.eclipse.egit.ui.internal.commit.CommitUI in project egit by eclipse.
the class CleanupUncomittedChangesDialog method buttonPressed.
@Override
protected void buttonPressed(int buttonId) {
switch(buttonId) {
case IDialogConstants.PROCEED_ID:
CommitUI commitUI = new CommitUI(getShell(), repository, new IResource[0], true);
shouldContinue = commitUI.commit();
break;
case IDialogConstants.ABORT_ID:
final ResetOperation operation = new ResetOperation(repository, Constants.HEAD, ResetType.HARD);
String jobname = NLS.bind(UIText.ResetAction_reset, Constants.HEAD);
JobUtil.scheduleUserWorkspaceJob(operation, jobname, JobFamilies.RESET);
shouldContinue = true;
break;
case IDialogConstants.SKIP_ID:
StashCreateUI stashCreateUI = new StashCreateUI(repository);
shouldContinue = stashCreateUI.createStash(getShell());
break;
case IDialogConstants.CANCEL_ID:
default:
break;
}
super.buttonPressed(buttonId);
}
use of org.eclipse.egit.ui.internal.commit.CommitUI in project egit by eclipse.
the class CommitActionHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(true, event);
if (repository == null) {
return null;
}
IPreferenceStore uiPreferences = Activator.getDefault().getPreferenceStore();
boolean useStagingView = uiPreferences.getBoolean(UIPreferences.ALWAYS_USE_STAGING_VIEW);
if (useStagingView) {
if (uiPreferences.getBoolean(UIPreferences.AUTO_STAGE_ON_COMMIT)) {
boolean includeUntracked = uiPreferences.getBoolean(UIPreferences.COMMIT_DIALOG_INCLUDE_UNTRACKED);
autoStage(repository, includeUntracked, getResourcesInScope(event));
}
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
try {
StagingView view = (StagingView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(StagingView.VIEW_ID);
if (view.getCurrentRepository() != repository) {
view.reload(repository);
}
view.setFocus();
} catch (PartInitException e) {
Activator.logError(e.getMessage(), e);
}
}
});
} else {
final Shell shell = getShell(event);
IResource[] resourcesInScope = getResourcesInScope(event);
if (resourcesInScope != null) {
CommitUI commitUi = new CommitUI(shell, repository, resourcesInScope, false);
commitUi.commit();
}
}
return null;
}
Aggregations