use of org.eclipse.egit.gitflow.ui.internal.actions.ReleaseStartFromCommitHandler in project egit by eclipse.
the class DynamicHistoryMenu method fill.
@Override
public void fill(Menu menu, int index) {
GitFlowRepository gfRepo = getRepository();
if (gfRepo == null) {
return;
}
RevCommit selectedCommit = getSelectedCommit();
if (selectedCommit == null) {
return;
}
String startCommitSha1 = selectedCommit.getName();
Shell activeShell = getActiveShell();
ReleaseStartFromCommitHandler listener = new ReleaseStartFromCommitHandler(gfRepo, startCommitSha1, activeShell);
MenuItem menuItem = new MenuItem(menu, SWT.PUSH, index);
menuItem.setText(NLS.bind(UIText.DynamicHistoryMenu_startGitflowReleaseFrom, abbreviate(selectedCommit)));
menuItem.addSelectionListener(listener);
boolean isEnabled = false;
try {
isEnabled = gfRepo.isOnDevelop(selectedCommit);
} catch (IOException e) {
Activator.getDefault().getLog().log(error(e.getMessage(), e));
}
menuItem.setEnabled(isEnabled);
}
Aggregations