use of org.eclipse.egit.ui.internal.dialogs.BranchRenameDialog in project egit by eclipse.
the class RenameBranchOnCommitHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final Repository repository = getRepository(event);
if (repository == null)
return null;
List<Ref> branchesOfCommit = getBranchesOfCommit(getSelection(event));
// this should have been checked by isEnabled()
if (branchesOfCommit.isEmpty())
return null;
final Shell shell = getPart(event).getSite().getShell();
final Ref branchToRename;
if (branchesOfCommit.size() > 1) {
BranchSelectionDialog<Ref> dlg = new BranchSelectionDialog<>(shell, branchesOfCommit, UIText.RenameBranchOnCommitHandler_SelectBranchDialogTitle, UIText.RenameBranchOnCommitHandler_SelectBranchDialogMessage, SWT.SINGLE);
if (dlg.open() != Window.OK)
return null;
branchToRename = dlg.getSelectedNode();
} else
branchToRename = branchesOfCommit.get(0);
new BranchRenameDialog(shell, repository, branchToRename).open();
return null;
}
use of org.eclipse.egit.ui.internal.dialogs.BranchRenameDialog in project egit by eclipse.
the class RenameBranchCommand method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
final List<RefNode> nodes = getSelectedNodes(event);
RefNode refNode = nodes.get(0);
Shell shell = getShell(event);
new BranchRenameDialog(shell, refNode.getRepository(), refNode.getObject()).open();
return null;
}
Aggregations