コード例 #1
0
  @Override
  protected void setInitialSelection(
      List<? extends ChangeList> changeLists,
      List<Change> changes,
      ChangeList initialListSelection) {
    myAllChanges = new ArrayList<Change>();
    mySelectedChangeList = initialListSelection;

    for (ChangeList list : changeLists) {
      if (list instanceof LocalChangeList) {
        myAllChanges.addAll(list.getChanges());
        if (initialListSelection == null) {
          for (Change c : list.getChanges()) {
            if (changes.contains(c)) {
              mySelectedChangeList = list;
              break;
            }
          }
        }
      }
    }

    if (mySelectedChangeList == null) {
      for (ChangeList list : changeLists) {
        if (list instanceof LocalChangeList && ((LocalChangeList) list).isDefault()) {
          mySelectedChangeList = list;
          break;
        }
      }
      if (mySelectedChangeList == null && !changeLists.isEmpty()) {
        mySelectedChangeList = changeLists.get(0);
      }
    }
  }
コード例 #2
0
 @NotNull
 public List<Change> getCurrentDisplayedChanges() {
   return mySelectedChangeList != null
       ? ContainerUtil.newArrayList(mySelectedChangeList.getChanges())
       : Collections.emptyList();
 }