Commit 3e57b3f4 authored by Jasper Koehorst's avatar Jasper Koehorst
Browse files

working on duplication issue

parent e5131f64
......@@ -264,7 +264,6 @@ public class TemplateView extends Div {
footer.add(footerContent);
verticalLayout.add(footer);
add(verticalLayout);
// add(buttonDownload);
......@@ -381,7 +380,7 @@ public class TemplateView extends Div {
// Only show items when a true package is selected
if (!listener.getValue().contains("Select a package")) {
// Add all user items when package change occurs
logger.info("User lisr size " + userList);
logger.info("User list size " + userList);
items.get().addAll(userList);
// Add the metadata elements from selected package
for (Metadata m : metadataSet.get(metadata)) {
......@@ -410,6 +409,28 @@ public class TemplateView extends Div {
}
}
}
// Check for duplicate items?
ArrayList<Metadata> uniqueList = new ArrayList<>();
for (Metadata metadata1 : items.get()) {
boolean skip = false;
for (Metadata metadata2 : uniqueList) {
if (metadata1.getStructuredCommentName().equals(metadata2.getStructuredCommentName())) {
skip = true;
}
}
if (!skip) {
uniqueList.add(metadata1);
}
}
// Only retain the final list?...
logger.info("Unique list");
for (Metadata metadata1 : uniqueList) {
logger.info(metadata1.getPackage() + " " + metadata1.getStructuredCommentName());
}
items.get().removeAll(items.get());
items.get().addAll(uniqueList);
// Add the items and select the obligatory items
gridSelection.setItems(items.get());
// Select obligatory items
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment