}
}
// Sort by feature id so that the JS gets loaded in the right order
if( !jsExtensionsByFeatureId.isEmpty() ) {
SimpleSortingVector featureIds = new SimpleSortingVector();
Enumeration keys = jsExtensionsByFeatureId.keys();
while( keys.hasMoreElements() ) {
featureIds.addElement( keys.nextElement() );
}
featureIds.setSortComparator( JSUtilities.getStringComparator() );
featureIds.reSort();
Enumeration sortedFeatureIds = featureIds.elements();
while( sortedFeatureIds.hasMoreElements() ) {
IJSExtension jsExtension = (IJSExtension) jsExtensionsByFeatureId.get( sortedFeatureIds.nextElement() );
jsExtension.loadFeature( feature.getID(), feature.getVersion(), doc, scriptEngine, ( (WidgetConfigImpl) _widgetConfig ).getJSInjectionPaths() );
}
}