private static Pair<MavenDomDependency, Set<MavenDomProjectModel>> findDependencyAndParent(PsiFile file, Editor editor) {
    final MavenDomDependency dependency = DomUtil.findDomElement(file.findElementAt(editor.getCaretModel().getOffset()),
                                                                 MavenDomDependency.class);
    if (dependency == null || isManagedDependency(dependency)) return null;

    Set<MavenDomProjectModel> parents = getParentProjects(file);
    if (parents.isEmpty()) return null;

    return Pair.create(dependency, parents);
  }
private static Pair<MavenDomDependency, Set<MavenDomProjectModel>> findDependencyAndParent(PsiFile file, Editor editor)