Object[] children; if (_parentElement instanceof EOModelContainer) { EOModelContainer modelContainer = (EOModelContainer) _parentElement; children = new Object[] { modelContainer.getModel() }; } else if (_parentElement instanceof EOModelGroup) { EOModelGroup modelGroup = (EOModelGroup) _parentElement; children = modelGroup.getModels().toArray(); } else if (_parentElement instanceof EOModel) { EOModel model = (EOModel) _parentElement; Set modelChildren = new TreeSet(PropertyListComparator.AscendingPropertyListComparator); if (myShowEntities) { modelChildren.addAll(model.getEntities()); } if (myShowStoredProcedures) { modelChildren.addAll(model.getStoredProcedures()); } if (myShowDatabaseConfigs) { modelChildren.addAll(model.getDatabaseConfigs(false)); } children = modelChildren.toArray(); } else if (_parentElement instanceof EOEntity) { EOEntity entity = (EOEntity) _parentElement; Set entityChildren = new TreeSet(PropertyListComparator.AscendingPropertyListComparator); if (myShowAttributes) { entityChildren.addAll(entity.getAttributes()); } if (myShowRelationships) { entityChildren.addAll(entity.getRelationships()); } if (myShowFetchSpecs) { entityChildren.addAll(entity.getFetchSpecs()); } children = entityChildren.toArray(); } else if (_parentElement instanceof EORelationship) { EORelationship relationship = (EORelationship) _parentElement; children = new EORelationshipPath(null, relationship).getChildren(); } else if (_parentElement instanceof EORelationshipPath) { EORelationshipPath relationshipPath = (EORelationshipPath) _parentElement; children = relationshipPath.getChildren(); } else if (_parentElement instanceof EOStoredProcedure) { EOStoredProcedure storedProcedure = (EOStoredProcedure) _parentElement; List arguments = storedProcedure.getArguments(); children = arguments.toArray(); } else { children = null; } return children; }
Object[] children; if (_parentElement instanceof EOModelContainer) { EOModelContainer modelContainer = (EOModelContainer) _parentElement; children = new Object[] { modelContainer.getModel() }; } else if (_parentElement instanceof EOModelGroup) { EOModelGroup modelGroup = (EOModelGroup) _parentElement; Set modelGroupChildren = new TreeSet(new EOSortableEOModelObjectComparator()); modelGroupChildren.addAll(modelGroup.getModels()); children = modelGroupChildren.toArray(); } else if (_parentElement instanceof EOModel) { EOModel model = (EOModel) _parentElement; Set modelChildren = new TreeSet(new EOSortableEOModelObjectComparator()); if (myShowEntities) { modelChildren.addAll(model.getEntities()); } if (myShowStoredProcedures) { modelChildren.addAll(model.getStoredProcedures()); } if (myShowDatabaseConfigs) { modelChildren.addAll(model.getDatabaseConfigs(false)); } children = modelChildren.toArray(); } else if (_parentElement instanceof EOEntity) { EOEntity entity = (EOEntity) _parentElement; Set entityChildren = new TreeSet(new EOSortableEOModelObjectComparator()); if (myShowAttributes) { entityChildren.addAll(entity.getAttributes()); } if (myShowRelationships) { entityChildren.addAll(entity.getRelationships()); } if (myShowFetchSpecs) { entityChildren.addAll(entity.getFetchSpecs()); } children = entityChildren.toArray(); } else if (_parentElement instanceof EORelationship) { EORelationship relationship = (EORelationship) _parentElement; Set relationshipPathChildren = new TreeSet(new EOSortableEOModelObjectComparator()); relationshipPathChildren.addAll(Arrays.asList(new EORelationshipPath(null, relationship).getChildren())); children = relationshipPathChildren.toArray(); } else if (_parentElement instanceof EORelationshipPath) { EORelationshipPath relationshipPath = (EORelationshipPath) _parentElement; Set relationshipPathChildren = new TreeSet(new EOSortableEOModelObjectComparator()); relationshipPathChildren.addAll(Arrays.asList(relationshipPath.getChildren())); children = relationshipPathChildren.toArray(); } else if (_parentElement instanceof EOStoredProcedure) { EOStoredProcedure storedProcedure = (EOStoredProcedure) _parentElement; Set arguments = new TreeSet(new EOSortableEOModelObjectComparator()); arguments.addAll(storedProcedure.getArguments()); children = arguments.toArray(); } else { children = null; } return children; }
  public Object[] getChildren(Object _parentElement) {    Object[] children;    if (_parentElement instanceof EOModelContainer) {      EOModelContainer modelContainer = (EOModelContainer) _parentElement;      children = new Object[] { modelContainer.getModel() };    }    else if (_parentElement instanceof EOModelGroup) {      EOModelGroup modelGroup = (EOModelGroup) _parentElement;      children = modelGroup.getModels().toArray();    }    else if (_parentElement instanceof EOModel) {      EOModel model = (EOModel) _parentElement;      Set modelChildren = new TreeSet(PropertyListComparator.AscendingPropertyListComparator);      if (myShowEntities) {        modelChildren.addAll(model.getEntities());      }      if (myShowStoredProcedures) {        modelChildren.addAll(model.getStoredProcedures());      }      if (myShowDatabaseConfigs) {        modelChildren.addAll(model.getDatabaseConfigs(false));      }      children = modelChildren.toArray();    }    else if (_parentElement instanceof EOEntity) {      EOEntity entity = (EOEntity) _parentElement;      Set entityChildren = new TreeSet(PropertyListComparator.AscendingPropertyListComparator);      if (myShowAttributes) {        entityChildren.addAll(entity.getAttributes());      }      if (myShowRelationships) {        entityChildren.addAll(entity.getRelationships());      }      if (myShowFetchSpecs) {        entityChildren.addAll(entity.getFetchSpecs());      }      children = entityChildren.toArray();    }    else if (_parentElement instanceof EORelationship) {      EORelationship relationship = (EORelationship) _parentElement;      children = new EORelationshipPath(null, relationship).getChildren();    }    else if (_parentElement instanceof EORelationshipPath) {      EORelationshipPath relationshipPath = (EORelationshipPath) _parentElement;      children = relationshipPath.getChildren();    }    else if (_parentElement instanceof EOStoredProcedure) {      EOStoredProcedure storedProcedure = (EOStoredProcedure) _parentElement;      List arguments = storedProcedure.getArguments();      children = arguments.toArray();    }    else {      children = null;    }    return children;  }