private Map<String,TeamExplorerNavigationLinkConfig[]> discoverNavigationLinks(){
  final Map<String,List<TeamExplorerNavigationLinkConfig>> map;
  map=new HashMap<String,List<TeamExplorerNavigationLinkConfig>>();
  for (  final IConfigurationElement element : getExtensions(NAVLINK_EXTENSION_POINT_ID)) {
    final TeamExplorerNavigationLinkConfig navLink=TeamExplorerNavigationLinkConfig.fromConfigurationElement(element);
    List<TeamExplorerNavigationLinkConfig> navLinks=map.get(navLink.getParentID());
    if (navLinks == null) {
      navLinks=new ArrayList<TeamExplorerNavigationLinkConfig>();
      map.put(navLink.getParentID(),navLinks);
    }
    navLinks.add(navLink);
  }
  final Map<String,TeamExplorerNavigationLinkConfig[]> toReturn;
  toReturn=new HashMap<String,TeamExplorerNavigationLinkConfig[]>();
  for (  final String itemID : map.keySet()) {
    final List<TeamExplorerNavigationLinkConfig> list=map.get(itemID);
    final TeamExplorerNavigationLinkConfig[] links=list.toArray(new TeamExplorerNavigationLinkConfig[list.size()]);
    Arrays.sort(links,new TeamExplorerOrderedComponentComparator());
    toReturn.put(itemID,links);
  }
  return toReturn;
}

private Map < String , TeamExplorerNavigationLinkConfig [ ] > discoverNavigationLinks ( ) { final Map < String , List < TeamExplorerNavigationLinkConfig > > map ; map = new HashMap < String , List < TeamExplorerNavigationLinkConfig > > ( ) ; for ( final IConfigurationElement element : getExtensions ( NAVLINK_EXTENSION_POINT_ID ) ) { final TeamExplorerNavigationLinkConfig navLink = TeamExplorerNavigationLinkConfig . fromConfigurationElement ( element ) ; List < TeamExplorerNavigationLinkConfig > navLinks = map . get ( navLink . getParentID ( ) ) ; if ( navLinks == null ) { navLinks = new ArrayList < TeamExplorerNavigationLinkConfig > ( ) ; map . put ( navLink . getParentID ( ) , navLinks ) ; } navLinks . add ( navLink ) ; } final Map < String , TeamExplorerNavigationLinkConfig [ ] > toReturn ; toReturn = new HashMap < String , TeamExplorerNavigationLinkConfig [ ] > ( ) ; for ( final String itemID : map . keySet ( ) ) { final List < TeamExplorerNavigationLinkConfig > list = map . get ( itemID ) ; final TeamExplorerNavigationLinkConfig [ ] links = list . toArray ( new TeamExplorerNavigationLinkConfig [ list . size ( ) ] ) ; Arrays . sort ( links , new TeamExplorerOrderedComponentComparator ( ) ) ; toReturn . put ( itemID , links ) ; } return toReturn ; }
query eclipse for teamexplorernavigationlink extensions and build the navigation link map . the navigation link map contains a navigation item id as a key and an array of navigation links ( sorted by priority ) that target the item as a value .
