コード例 #1
0
 @NotNull
 private FileHistoryPanelImpl createFileHistoryPanel(@NotNull VcsHistorySession copy) {
   ContentManager contentManager =
       ProjectLevelVcsManagerEx.getInstanceEx(myVcs.getProject()).getContentManager();
   return new FileHistoryPanelImpl(
       myVcs, myPath, copy, myVcsHistoryProvider, contentManager, myRefresherI);
 }
コード例 #2
0
 public void reportException(VcsException exception) {
   VcsBalloonProblemNotifier.showOverVersionControlView(
       myVcs.getProject(),
       VcsBundle.message("message.title.could.not.load.file.history")
           + ": "
           + exception.getMessage(),
       MessageType.ERROR);
 }
コード例 #3
0
 @Nullable
 public static PushSupport getPushSupport(@NotNull final AbstractVcs vcs) {
   return ContainerUtil.find(
       Extensions.getExtensions(PushSupport.PUSH_SUPPORT_EP, vcs.getProject()),
       new Condition<PushSupport>() {
         @Override
         public boolean value(final PushSupport support) {
           return support.getVcs().equals(vcs);
         }
       });
 }
コード例 #4
0
 private void createOrSelectContentIfNeeded() {
   ToolWindow toolWindow = getToolWindow(myVcs.getProject());
   if (myRefresherI.isFirstTime()) {
     ContentManager manager = toolWindow.getContentManager();
     boolean selectedExistingContent =
         ContentUtilEx.selectContent(manager, myFileHistoryPanel, true);
     if (!selectedExistingContent) {
       ContentUtilEx.addTabbedContent(
           manager, myFileHistoryPanel, "History", myPath.getName(), true);
     }
     toolWindow.activate(null);
   }
 }
コード例 #5
0
 public FileHistorySessionPartner(
     final VcsHistoryProvider vcsHistoryProvider,
     @NotNull final FilePath path,
     final AbstractVcs vcs,
     final FileHistoryRefresherI refresherI) {
   myVcsHistoryProvider = vcsHistoryProvider;
   myPath = path;
   myLimitHistoryCheck = new LimitHistoryCheck(vcs.getProject(), path.getPath());
   myVcs = vcs;
   myRefresherI = refresherI;
   Consumer<List<VcsFileRevision>> sessionRefresher =
       new Consumer<List<VcsFileRevision>>() {
         public void consume(List<VcsFileRevision> vcsFileRevisions) {
           // TODO: Logic should be revised to we could just append some revisions to history panel
           // instead of creating and showing new history
           // TODO: session
           mySession.getRevisionList().addAll(vcsFileRevisions);
           final VcsHistorySession copy = mySession.copyWithCachedRevision();
           ApplicationManager.getApplication()
               .invokeLater(
                   new Runnable() {
                     public void run() {
                       ensureHistoryPanelCreated().getHistoryPanelRefresh().consume(copy);
                     }
                   });
         }
       };
   myBuffer =
       new BufferedListConsumer<VcsFileRevision>(5, sessionRefresher, 1000) {
         @Override
         protected void invokeConsumer(@NotNull Runnable consumerRunnable) {
           // Do not invoke in arbitrary background thread as due to parallel execution this could
           // lead to cases when invokeLater() (from
           // sessionRefresher) is scheduled at first for history session with (as an example) 10
           // revisions (new buffered list) and then with
           // 5 revisions (previous buffered list). And so incorrect UI is shown to the user.
           consumerRunnable.run();
         }
       };
 }