private Map<String,TeamExplorerSectionConfig[]> discoverSections(){
  final Map<String,List<TeamExplorerSectionConfig>> map;
  map=new HashMap<String,List<TeamExplorerSectionConfig>>();
  for (  final IConfigurationElement element : getExtensions(SECTION_EXTENSION_POINT_ID)) {
    final TeamExplorerSectionConfig section=TeamExplorerSectionConfig.fromConfigurationElement(element);
    List<TeamExplorerSectionConfig> sections=map.get(section.getPageID());
    if (sections == null) {
      sections=new ArrayList<TeamExplorerSectionConfig>();
      map.put(section.getPageID(),sections);
    }
    sections.add(section);
  }
  final Map<String,TeamExplorerSectionConfig[]> toReturn;
  toReturn=new HashMap<String,TeamExplorerSectionConfig[]>();
  for (  final String pageID : map.keySet()) {
    final List<TeamExplorerSectionConfig> list=map.get(pageID);
    final TeamExplorerSectionConfig[] sections=list.toArray(new TeamExplorerSectionConfig[list.size()]);
    Arrays.sort(sections,new TeamExplorerOrderedComponentComparator());
    toReturn.put(pageID,sections);
  }
  return toReturn;
}

private Map < String , TeamExplorerSectionConfig [ ] > discoverSections ( ) { final Map < String , List < TeamExplorerSectionConfig > > map ; map = new HashMap < String , List < TeamExplorerSectionConfig > > ( ) ; for ( final IConfigurationElement element : getExtensions ( SECTION_EXTENSION_POINT_ID ) ) { final TeamExplorerSectionConfig section = TeamExplorerSectionConfig . fromConfigurationElement ( element ) ; List < TeamExplorerSectionConfig > sections = map . get ( section . getPageID ( ) ) ; if ( sections == null ) { sections = new ArrayList < TeamExplorerSectionConfig > ( ) ; map . put ( section . getPageID ( ) , sections ) ; } sections . add ( section ) ; } final Map < String , TeamExplorerSectionConfig [ ] > toReturn ; toReturn = new HashMap < String , TeamExplorerSectionConfig [ ] > ( ) ; for ( final String pageID : map . keySet ( ) ) { final List < TeamExplorerSectionConfig > list = map . get ( pageID ) ; final TeamExplorerSectionConfig [ ] sections = list . toArray ( new TeamExplorerSectionConfig [ list . size ( ) ] ) ; Arrays . sort ( sections , new TeamExplorerOrderedComponentComparator ( ) ) ; toReturn . put ( pageID , sections ) ; } return toReturn ; }
query eclipse for teamexplorerpagesection extensions and build the page section map . the page section map contains a pageid as a key and an array of sections ( sorted by priority ) that target the page as a value .
