@Override public int compare(RecordSection o1, RecordSection o2) { int i1 = overrides.indexOf(o1.getExtension().getId()); int i2 = overrides.indexOf(o2.getExtension().getId()); return (i2 == -1 || i1 == -1) ? (i2 - i1) : (i1 - i2); } });
@Override public int compare(RecordSection o1, RecordSection o2) { int i1 = sectionOverrides.indexOf(o1.getExtension().getId()); int i2 = sectionOverrides.indexOf(o2.getExtension().getId()); return (i2 == -1 || i1 == -1) ? (i2 - i1) : (i1 - i2); } });
@Override public List<RecordSection> getAllSections() { List<RecordSection> result = new ArrayList<RecordSection>(); List<RecordSection> allSections = super.getAllSections(); final List<String> overrides = this.configuration.getSectionsOverride(); for (RecordSection section : allSections) { result.add(new ConfiguredRecordSection(this.configuration, section.getExtension(), this.uixManager, this.orderFilter)); } if (overrides != null && !overrides.isEmpty()) { Collections.<RecordSection>sort(result, new Comparator<RecordSection>() { @Override public int compare(RecordSection o1, RecordSection o2) { int i1 = overrides.indexOf(o1.getExtension().getId()); int i2 = overrides.indexOf(o2.getExtension().getId()); return (i2 == -1 || i1 == -1) ? (i2 - i1) : (i1 - i2); } }); } return Collections.unmodifiableList(result); }
for (final RecordSection section : updatedSections) { if (!sectionOverrides.contains(section.getExtension().getId())) { section.setEnabled(false); } else {