@Override public boolean isEnabled() { GitHistoryPage page = getPage(); if (page == null) return false; int size = getSelection(page).size(); if (size == 0) return false; return page.getInputInternal().isSingleFile(); }
public Object execute(ExecutionEvent event) throws ExecutionException { IHistoryView view = TeamUI.showHistoryFor(getPartPage(event), getSelectedResources(event)[0], null); if (view == null) return null; IHistoryPage page = view.getHistoryPage(); if (page instanceof GitHistoryPage) { GitHistoryPage gitHistoryPage = (GitHistoryPage) page; gitHistoryPage.setCompareMode(true); } return null; }