use of org.eclipse.egit.ui.internal.stash.StashCreateUI in project egit by eclipse.
the class StashesMenu method createStashChangesItem.
private static IContributionItem createStashChangesItem(final Repository repository) {
Action action = new Action(UIText.StashesMenu_StashChangesActionText) {
@Override
public void run() {
StashCreateUI stashCreateUI = new StashCreateUI(repository);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
stashCreateUI.createStash(shell);
}
@Override
public boolean isEnabled() {
return StashCreateHandler.isEnabled(repository);
}
};
return new ActionContributionItem(action);
}
use of org.eclipse.egit.ui.internal.stash.StashCreateUI 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.stash.StashCreateUI in project egit by eclipse.
the class StashCreateHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Repository repository = getRepository();
if (repository == null)
return null;
StashCreateUI stashCreateUI = new StashCreateUI(repository);
stashCreateUI.createStash(getShell(event));
return null;
}
Aggregations