- public void checkItemConsistency(List<TemplateDetailsItem> list) {
- if (list == null)
- list = new ArrayList<>(items.getValue());
+ public void applyList(List<TemplateDetailsItem> srcList) {
+ applyList(srcList, false);
+ }
+ public void applyList(List<TemplateDetailsItem> srcList, boolean async) {
+ boolean changes;
+ if (srcList == null) {
+ srcList = new ArrayList<>(items.getValue());
+ changes = false;
+ }
+ else
+ changes = true;
+
+ srcList = Collections.unmodifiableList(srcList);
+
+ {
+ Logger.debug("tmpl", "Considering old list");
+ for (TemplateDetailsItem item : srcList)
+ Logger.debug("tmpl", String.format(Locale.US, " id %d pos %d", item.getId(),
+ item.getPosition()));
+ }
+
+ ArrayList<TemplateDetailsItem> newList = new ArrayList<>();
+
+ boolean hasEmptyItem = false;