Java 类com.intellij.util.FilePathByPathComparator 实例源码

项目:intellij-ce-playground    文件:LocalChangesPromptTask.java   
private void processIntersection(@NotNull ContinuationContext context, @NotNull Intersection intersection) {
  //noinspection EnumSwitchStatementWhichMissesCases
  switch (myInteraction.selectLocalChangesAction(myMergeAll)) {
    case shelve:
      context.next(new ShelveLocalChangesTask(myMergeContext, myInteraction, intersection));
      break;
    case cancel:
      context.cancelEverything();
      break;
    case inspect:
      // here's cast is due to generic's bug
      @SuppressWarnings("unchecked") Collection<Change> changes = (Collection<Change>)intersection.getChangesSubset().values();
      myInteraction
        .showIntersectedLocalPaths(ContainerUtil.sorted(ChangesUtil.getPaths(changes), FilePathByPathComparator.getInstance()));
      context.cancelEverything();
      break;
  }
}
项目:intellij-ce-playground    文件:AbstractSvnUpdatePanel.java   
protected void init(final Collection<FilePath> roots) {
  final JPanel configureRootsPanel = getRootsPanel();
  configureRootsPanel.setLayout(new BorderLayout());

  final ArrayList<FilePath> rootsCopy = new ArrayList<FilePath>(roots);
  Collections.sort(rootsCopy, FilePathByPathComparator.getInstance());
  for (FilePath root : rootsCopy) {
    SVNURL url = getUrlFor(root);
    if (url != null) {
      myRootToPanel.put(root, createRootPanel(root, myVCS, roots));
    }

    Container parent = configureRootsPanel.getParent();
    parent.remove(configureRootsPanel);
    parent.setLayout(new BorderLayout());
    JPanel additionalPanel = getAdditionalPanel();
    if (additionalPanel != null) {
      parent.remove(additionalPanel);
    }
    if (myRootToPanel.size() == 1) {
      configureRootsPanel.add(myRootToPanel.values().iterator().next().getPanel(), BorderLayout.CENTER);
      parent.add(configureRootsPanel, BorderLayout.NORTH);
      if (additionalPanel != null) {
        parent.add(additionalPanel, BorderLayout.CENTER);
      }
    }
    else {
      final MultipleRootEditorWithSplitter multipleRootsEditor = new MultipleRootEditorWithSplitter(myRootToPanel, myVCS.getProject());
      configureRootsPanel.add(multipleRootsEditor, BorderLayout.CENTER);
      parent.add(configureRootsPanel, BorderLayout.CENTER);
      if (additionalPanel != null) {
        parent.add(additionalPanel, BorderLayout.SOUTH);
      }
    }
  }
}
项目:tools-idea    文件:AbstractSvnUpdatePanel.java   
protected void init(final Collection<FilePath> roots) {
  final JPanel configureRootsPanel = getRootsPanel();
  configureRootsPanel.setLayout(new BorderLayout());

  final ArrayList<FilePath> rootsCopy = new ArrayList<FilePath>(roots);
  Collections.sort(rootsCopy, FilePathByPathComparator.getInstance());
  for (FilePath root : rootsCopy) {
    SVNURL url = getUrlFor(root);
    if (url != null) {
      myRootToPanel.put(root, createRootPanel(root, myVCS, roots));
    }

    Container parent = configureRootsPanel.getParent();
    parent.remove(configureRootsPanel);
    parent.setLayout(new BorderLayout());
    JPanel additionalPanel = getAdditionalPanel();
    if (additionalPanel != null) {
      parent.remove(additionalPanel);
    }
    if (myRootToPanel.size() == 1) {
      configureRootsPanel.add(myRootToPanel.values().iterator().next().getPanel(), BorderLayout.CENTER);
      parent.add(configureRootsPanel, BorderLayout.NORTH);
      if (additionalPanel != null) {
        parent.add(additionalPanel, BorderLayout.CENTER);
      }
    }
    else {
      final MultipleRootEditorWithSplitter multipleRootsEditor = new MultipleRootEditorWithSplitter(myRootToPanel, myVCS.getProject());
      configureRootsPanel.add(multipleRootsEditor, BorderLayout.CENTER);
      parent.add(configureRootsPanel, BorderLayout.CENTER);
      if (additionalPanel != null) {
        parent.add(additionalPanel, BorderLayout.SOUTH);
      }
    }
  }
}
项目:tools-idea    文件:QuickMerge.java   
@Override
public void run(ContinuationContext context) {
  final Intersection intersection;
  final ChangeListManager listManager = ChangeListManager.getInstance(myProject);
  final List<LocalChangeList> localChangeLists = listManager.getChangeListsCopy();

  if (myMergeAll) {
    intersection = getMergeAllIntersection(localChangeLists);
  } else {
    intersection = checkIntersection(myLists, localChangeLists);
  }
  if (intersection == null || intersection.getChangesSubset().isEmpty()) return;

  final LocalChangesAction action = myInteraction.selectLocalChangesAction(myMergeAll);
  switch (action) {
    // shelve
    case shelve:
      context.next(new ShelveLocalChanges(intersection));
      return;
    // cancel
    case cancel:
      context.cancelEverything();
      return;
    // continue
    case continueMerge:
      return;
    // inspect
    case inspect:
      // here's cast is due to generic's bug
      @SuppressWarnings("unchecked") final Collection<Change> changes = (Collection<Change>) intersection.getChangesSubset().values();
      final List<FilePath> paths = ChangesUtil.getPaths(changes);
      Collections.sort(paths, FilePathByPathComparator.getInstance());
      myInteraction.showIntersectedLocalPaths(paths);
      context.cancelEverything();
      return;
    default:
  }
}
项目:intellij-ce-playground    文件:SvnUpdateContext.java   
public SvnUpdateContext(final SvnVcs vcs, FilePath[] contentRoots) {
  myVcs = vcs;
  myContentRoots = Arrays.asList(contentRoots);
  Collections.sort(myContentRoots, FilePathByPathComparator.getInstance());
  myUpdatedExternals = new HashSet<File>();
}
项目:tools-idea    文件:SvnUpdateContext.java   
public SvnUpdateContext(final SvnVcs vcs, FilePath[] contentRoots) {
  myVcs = vcs;
  myContentRoots = Arrays.asList(contentRoots);
  Collections.sort(myContentRoots, FilePathByPathComparator.getInstance());
  myUpdatedExternals = new HashSet<File>();
}