{
final DataFactoryMetaData[] datas = DataFactoryRegistry.getInstance().getAll();
final Map<String, Boolean> groupMap = new HashMap<String, Boolean>();
for (int i = 0; i < datas.length; i++)
{
final DataFactoryMetaData data = datas[i];
if (data.isHidden())
{
continue;
}
if (data.isEditorAvailable() == false)
{
continue;
}
final String currentGrouping = data.getGrouping(Locale.getDefault());
groupMap.put(currentGrouping, groupMap.containsKey(currentGrouping));
}
Arrays.sort(datas, new GroupedMetaDataComparator());
Object grouping = null;
JMenu subMenu = null;
boolean firstElement = true;
for (int i = 0; i < datas.length; i++)
{
final DataFactoryMetaData data = datas[i];
if (data.isHidden())
{
continue;
}
if (data.isEditorAvailable() == false)
{
continue;
}
final String currentGrouping = data.getGrouping(Locale.getDefault());
final Boolean isMultiGrouping = groupMap.get(currentGrouping);
if (firstElement == false)
{
if (ObjectUtilities.equal(currentGrouping, grouping) == false)
{