@Nullable private List<GithubFullPath> getAvailableForks(@NotNull ProgressIndicator indicator) { try { List<GithubFullPath> forks = ContainerUtil.map( GithubUtil.runTask( myProject, myAuthHolder, indicator, new ThrowableConvertor<GithubConnection, List<GithubRepo>, IOException>() { @NotNull @Override public List<GithubRepo> convert(@NotNull GithubConnection connection) throws IOException { return GithubApiUtil.getForks( connection, mySource.getUser(), mySource.getRepository()); } }), new Function<GithubRepo, GithubFullPath>() { @Override public GithubFullPath fun(GithubRepo repo) { return repo.getFullPath(); } }); if (!forks.contains(mySource)) return ContainerUtil.append(forks, mySource); return forks; } catch (IOException e) { GithubNotifications.showWarning(myProject, "Can't load available forks", e); return null; } }
private VcsLogHighlighter.VcsCommitStyle getStyle( int row, int column, String text, boolean hasFocus, final boolean selected) { Component dummyRendererComponent = myDummyRenderer.getTableCellRendererComponent(this, text, selected, hasFocus, row, column); VisibleGraph<Integer> visibleGraph = getVisibleGraph(); if (row < 0 || row >= visibleGraph.getVisibleCommitCount()) { LOG.error( "Visible graph has " + visibleGraph.getVisibleCommitCount() + " commits, yet we want row " + row); return VcsCommitStyleFactory.createStyle( dummyRendererComponent.getForeground(), dummyRendererComponent.getBackground(), VcsLogHighlighter.TextStyle.NORMAL); } final RowInfo<Integer> rowInfo = visibleGraph.getRowInfo(row); VcsLogHighlighter.VcsCommitStyle defaultStyle = VcsCommitStyleFactory.createStyle( rowInfo.getRowType() == RowType.UNMATCHED ? JBColor.GRAY : dummyRendererComponent.getForeground(), dummyRendererComponent.getBackground(), VcsLogHighlighter.TextStyle.NORMAL); List<VcsLogHighlighter.VcsCommitStyle> styles = ContainerUtil.map( myHighlighters, new Function<VcsLogHighlighter, VcsLogHighlighter.VcsCommitStyle>() { @Override public VcsLogHighlighter.VcsCommitStyle fun(VcsLogHighlighter highlighter) { return highlighter.getStyle(rowInfo.getCommit(), selected); } }); return VcsCommitStyleFactory.combine(ContainerUtil.append(styles, defaultStyle)); }