OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 73 | Rev 180 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 73 Rev 83
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.ui.group;
14
 package org.openconcerto.ui.group;
15
 
15
 
-
 
16
import java.util.Collection;
-
 
17
import java.util.Collections;
-
 
18
 
16
import net.jcip.annotations.GuardedBy;
19
import net.jcip.annotations.GuardedBy;
17
 
20
 
18
public class Item {
21
public class Item {
19
 
22
 
20
    public static Item copy(final Item item, final Group newParent) {
23
    public static Item copy(final Item item, final Group newParent) {
Line 69... Line 72...
69
 
72
 
70
    public final Item getChildFromID(final String id) {
73
    public final Item getChildFromID(final String id) {
71
        return this.getDescFromID(id, 1);
74
        return this.getDescFromID(id, 1);
72
    }
75
    }
73
 
76
 
-
 
77
    /**
-
 
78
     * Get all descendant leaves, including this.
-
 
79
     * 
-
 
80
     * @return the descendant non-group.
-
 
81
     */
-
 
82
    public Collection<Item> getDescendantItems() {
-
 
83
        return Collections.singletonList(this);
-
 
84
    }
-
 
85
 
-
 
86
    protected void getDescendantItems(final Collection<Item> res) {
-
 
87
        res.add(this);
-
 
88
    }
-
 
89
 
74
    public final Item getDescFromID(final String id) {
90
    public final Item getDescFromID(final String id) {
75
        return this.getDescFromID(id, -1);
91
        return this.getDescFromID(id, -1);
76
    }
92
    }
77
 
93
 
78
    public Item getDescFromID(final String id, final int maxLevel) {
94
    public Item getDescFromID(final String id, final int maxLevel) {