@Override public int compare(PropertyContainer o1, PropertyContainer o2) { if (o1 != null && o2 != null && o1.getOrderIndex() != null && o2.getOrderIndex() != null) { int order1 = o1.getOrderIndex().getValue(); int order2 = o2.getOrderIndex().getValue(); return order1 - order2; } return 0; }
public void sort(Property property) { if (property instanceof PropertyComposite) { PropertyComposite propertyComposite = (PropertyComposite) property; List<PropertyContainer> propertyList = propertyComposite.getPropertyList(); Collections.sort(propertyList, this); for (PropertyContainer propertyContainer : propertyList) { this.sort(propertyContainer.getProperty()); } } }