1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.seasar.uruma.rcp.configuration.elements;
17
18 import org.eclipse.ui.IViewPart;
19 import org.seasar.uruma.annotation.ConfigurationAttribute;
20 import org.seasar.uruma.component.rcp.ViewPartComponent;
21 import org.seasar.uruma.core.UrumaConstants;
22 import org.seasar.uruma.rcp.configuration.ConfigurationElement;
23
24
25
26
27
28
29
30 public class ViewElement extends AbstractConfigurationElement implements
31 UrumaConstants {
32
33
34
35
36 public static final String ELEMENT_NAME = "view";
37
38
39
40
41 public ViewElement() {
42 super();
43 }
44
45
46
47
48
49
50
51 public ViewElement(final ViewPartComponent component) {
52 super();
53 this.id = createRcpId(component.getId());
54 this.name = component.title;
55 this.category = component.category;
56 this.clazz = component.clazz;
57 this.icon = component.image;
58 this.allowMultiple = Boolean.parseBoolean(component.allowMultiple);
59 }
60
61
62
63
64 @ConfigurationAttribute(required = true)
65 public String id;
66
67
68
69
70 @ConfigurationAttribute(required = true)
71 public String name;
72
73
74
75
76 @ConfigurationAttribute
77 public String category;
78
79
80
81
82 @ConfigurationAttribute(name = "class", required = true)
83 public String clazz;
84
85
86
87
88 @ConfigurationAttribute
89 public String icon;
90
91
92
93
94 @ConfigurationAttribute
95 public String fastViewWidthRatio;
96
97
98
99
100 @ConfigurationAttribute
101 public boolean allowMultiple;
102
103
104
105
106 @Override
107 public String toString() {
108 return name + " : " + id;
109 }
110 }