com.intellij.navigation.GotoClassContributor Java Examples

The following examples show how to use com.intellij.navigation.GotoClassContributor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GotoSymbolModel2.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
public String getFullName(final Object element) {
  for(ChooseByNameContributor c: getContributors()) {
    if (c instanceof GotoClassContributor) {
      String result = ((GotoClassContributor) c).getQualifiedName((NavigationItem) element);
      if (result != null) return result;
    }
  }

  if (element instanceof PsiElement) {
    final PsiElement psiElement = (PsiElement)element;

    final String containerText = SymbolPresentationUtil.getSymbolContainerText(psiElement);
    return containerText + "." + getElementName(element);
  }

  return getElementName(element);
}
 
Example #2
Source File: GotoClassModel2.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public String getFullName(final Object element) {
  if (element instanceof PsiElement && !((PsiElement)element).isValid()) {
    return null;
  }

  for (ChooseByNameContributor c : getContributors()) {
    if (c instanceof GotoClassContributor) {
      String result = ((GotoClassContributor)c).getQualifiedName((NavigationItem)element);
      if (result != null) return result;
    }
  }

  return getElementName(element);
}
 
Example #3
Source File: GotoClassModel2.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static String[] getSeparatorsFromContributors(List<ChooseByNameContributor> contributors) {
  final Set<String> separators = new HashSet<>();
  separators.add(".");
  for(ChooseByNameContributor c: contributors) {
    if (c instanceof GotoClassContributor) {
      ContainerUtil.addIfNotNull(separators, ((GotoClassContributor)c).getQualifiedNameSeparator());
    }
  }
  return separators.toArray(new String[separators.size()]);
}