53663dec174d52a8dfcee4e522ac66f1aec51e76
[idea/community.git] / platform / diff-api / src / com / intellij / diff / chains / DiffRequestChain.java
1 // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.diff.chains;
3
4 import com.intellij.diff.DiffDialogHints;
5 import com.intellij.openapi.project.Project;
6 import com.intellij.openapi.util.UserDataHolder;
7 import com.intellij.util.concurrency.annotations.RequiresEdt;
8 import org.jetbrains.annotations.NotNull;
9
10 import java.util.List;
11
12 /**
13  * Represents list of changed files (ex: singular commit).
14  * The list is not supposed to be changed and can be shown multiple times.
15  * <p>
16  * Use {@link AsyncDiffRequestChain} to load requests asynchronously after showing UI
17  * Use {@link com.intellij.openapi.vcs.changes.ui.ChangeDiffRequestChain} for chains with common "Go to change" navigation popup.
18  *
19  * @see DiffRequestSelectionChain
20  * @see com.intellij.diff.DiffManager#showDiff(Project, DiffRequestChain, DiffDialogHints)
21  * @see com.intellij.diff.impl.CacheDiffRequestChainProcessor
22  */
23 public interface DiffRequestChain extends UserDataHolder {
24   @NotNull
25   @RequiresEdt
26   List<? extends DiffRequestProducer> getRequests();
27
28   @RequiresEdt
29   int getIndex();
30
31   /**
32    * @see com.intellij.diff.impl.CacheDiffRequestChainProcessor#setCurrentRequest
33    * @deprecated This method will not change selected position if chain was already shown.
34    */
35   @Deprecated(forRemoval = true)
36   @RequiresEdt
37   default void setIndex(int index) {
38   }
39 }