1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.uruma.component.jface; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.Collections; |
20 | |
import java.util.List; |
21 | |
|
22 | |
import org.eclipse.swt.widgets.Tree; |
23 | |
import org.seasar.uruma.annotation.ComponentAttribute; |
24 | |
import org.seasar.uruma.annotation.ComponentElement; |
25 | |
import org.seasar.uruma.annotation.FieldDescription; |
26 | |
import org.seasar.uruma.annotation.RenderingPolicy; |
27 | |
import org.seasar.uruma.annotation.RenderingPolicy.ConversionType; |
28 | |
import org.seasar.uruma.annotation.RenderingPolicy.TargetType; |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
@ComponentElement |
36 | 8 | public class TreeComponent extends CompositeComponent { |
37 | |
|
38 | |
|
39 | |
|
40 | |
@RenderingPolicy(conversionType = ConversionType.BOOLEAN) |
41 | |
@ComponentAttribute |
42 | |
@FieldDescription("ヘッダの表示状態") |
43 | |
public String headerVisible; |
44 | |
|
45 | |
|
46 | |
|
47 | |
|
48 | |
@RenderingPolicy(conversionType = ConversionType.BOOLEAN) |
49 | |
@ComponentAttribute |
50 | |
@FieldDescription("ラインの表示状態") |
51 | |
public String linesVisible; |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
@RenderingPolicy(targetType = TargetType.NONE) |
57 | |
@ComponentAttribute |
58 | |
@FieldDescription("デフォルトでツリー展開する階層") |
59 | 8 | public String autoExpandLevel = "1"; |
60 | |
|
61 | 8 | private List<TreeItemComponent> children = new ArrayList<TreeItemComponent>(); |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
public void addTreeItem(final TreeItemComponent child) { |
70 | 8 | children.add(child); |
71 | 8 | } |
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
public List<TreeItemComponent> getTreeItems() { |
79 | 0 | return Collections.unmodifiableList(children); |
80 | |
} |
81 | |
} |