Column.java
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.sling.api.resource.Resource
*/
package com.day.cq.dam.commons.schemaforms.internal;
import com.day.cq.dam.commons.schemaforms.internal.MergeableResource;
import com.day.cq.dam.commons.schemaforms.internal.MergedItemResource;
import java.util.Iterator;
import java.util.List;
import org.apache.sling.api.resource.Resource;
public class Column
extends MergedItemResource {
public Column(Resource resource) {
super(resource);
}
@Override
protected boolean merge(Resource other) {
if (other instanceof Column) {
List<Resource> items = this.itemsResource.getItems();
if (other.getName().equals(this.getName())) {
Column otherCol = (Column)other;
Iterator<Resource> it = otherCol.itemsResource.listChildren();
while (it.hasNext()) {
items.add(this.getItemResource(it.next()));
}
return true;
}
}
return false;
}
@Override
protected Resource getItemResource(Resource res) {
return res;
}
}