if (tabSectionContentsFromRule.count() > 0) {
Object firstValue = tabSectionContentsFromRule.objectAtIndex(0);
if (firstValue instanceof NSArray) {
for (Enumeration e = tabSectionContentsFromRule.objectEnumerator(); e.hasMoreElements();) {
NSArray tab = (NSArray) e.nextElement();
ERD2WContainer c = new ERD2WContainer();
c.name = (String) tab.objectAtIndex(0);
c.keys = new NSMutableArray();
Object testObject = tab.objectAtIndex(1);
if (testObject instanceof NSArray) { // format #2
for (int i = 1; i < tab.count(); i++) {
NSArray sectionArray = (NSArray) tab.objectAtIndex(i);
ERD2WContainer section = new ERD2WContainer();
section.name = (String) sectionArray.objectAtIndex(0);
section.keys = new NSMutableArray(sectionArray);
section.keys.removeObjectAtIndex(0);
c.keys.addObject(section);
}
} else { // format #1
ERD2WContainer fakeTab = new ERD2WContainer();
fakeTab.name = "";
fakeTab.keys = new NSMutableArray(tab);
fakeTab.keys.removeObjectAtIndex(0);
c.keys.addObject(fakeTab);
}
tabSectionsContents.addObject(c);
}
} else if (firstValue instanceof String) {
tabSectionsContents = ERDirectToWeb.convertedPropertyKeyArray(tabSectionContentsFromRule, '[', ']');
for (Enumeration e = tabSectionsContents.objectEnumerator(); e.hasMoreElements();) {
ERD2WContainer tab = (ERD2WContainer) e.nextElement();
if(tab.displayName == null) {
tab.displayName = "Main";
}
if(tab.name.length() == 0) {
tab.name = "Main";