blob: 5351803d46bbfb57f9f3a4913c66f8ca7cae1d8e (
plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
/* *******************************************************************
* Copyright (c) 1999-2001 Xerox Corporation,
* 2002 Palo Alto Research Center, Incorporated (PARC).
* All rights reserved.
* This program and the accompanying materials are made available
* under the terms of the Eclipse Public License v1.0
* which accompanies this distribution and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Xerox/PARC initial implementation
* ******************************************************************/
package org.aspectj.ajde.ui;
import java.io.ObjectStreamException;
import java.util.*;
import org.aspectj.asm.*;
/**
* Nested properties use the typesafe enum pattern.
*
* @author Mik Kersten
*/
public class StructureViewProperties {
/**
* @deprecated
*/
public static final String SORT_DECLARATIONAL = StructureViewProperties.Sorting.DECLARATIONAL.toString();
/**
* @deprecated
*/
public void setSorting(String sorting) { }
private List relations = new ArrayList();
private List filteredMemberAccessibility = new ArrayList();
private List filteredMemberModifiers = new ArrayList();
private List filteredMemberKinds = new ArrayList();
private List grouping = new ArrayList();
private Sorting sorting = Sorting.DECLARATIONAL;
private Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS;
public List getRelations() {
return relations;
}
public void setRelations(List relations) {
this.relations = relations;
}
public void addRelation(IRelationship.Kind kind) {
relations.add(kind);
}
public void removeRelation(IRelationship.Kind kind) {
relations.remove(kind);
}
public void setFilteredMemberAccessibility(List memberVisibility) {
this.filteredMemberAccessibility = memberVisibility;
}
public List getFilteredMemberAccessibility() {
return filteredMemberAccessibility;
}
public void addFilteredMemberAccessibility(IProgramElement.Accessibility accessibility) {
this.filteredMemberAccessibility.add(accessibility);
}
public void removeFilteredMemberAccessibility(IProgramElement.Accessibility accessibility) {
this.filteredMemberAccessibility.remove(accessibility);
}
public List getFilteredMemberModifiers() {
return filteredMemberModifiers;
}
public void setFilteredMemberModifiers(List memberModifiers) {
this.filteredMemberModifiers = memberModifiers;
}
public void addFilteredMemberModifiers(IProgramElement.Modifiers modifiers) {
this.filteredMemberModifiers.add(modifiers);
}
public void removeFilteredMemberModifiers(IProgramElement.Modifiers modifiers) {
this.filteredMemberModifiers.remove(modifiers);
}
public StructureViewProperties.Sorting getSorting() {
return sorting;
}
public void setSorting(StructureViewProperties.Sorting sorting) {
this.sorting = sorting;
}
public List getFilteredMemberKinds() {
return filteredMemberKinds;
}
public void setFilteredMemberKinds(List memberKinds) {
this.filteredMemberKinds = memberKinds;
}
public void addFilteredMemberKind(IProgramElement.Kind kind) {
this.filteredMemberKinds.add(kind);
}
public void removeFilteredMemberKind(IProgramElement.Kind kind) {
this.filteredMemberKinds.remove(kind);
}
public List getGrouping() {
return grouping;
}
public void setGrouping(List grouping) {
this.grouping = grouping;
}
public void addGrouping(Grouping grouping) {
this.grouping.add(grouping);
}
public void removeGrouping(Grouping grouping) {
this.grouping.remove(grouping);
}
public Granularity getGranularity() {
return granularity;
}
public void setGranularity(Granularity granularity) {
this.granularity = granularity;
}
public String getName() {
return "<unnamed view>";
}
public String toString() {
return "\nView Properties:"
+ "\n-> sorting: " + sorting
+ "\n-> grouping: " + grouping
+ "\n-> filtered member kinds: " + filteredMemberKinds
+ "\n-> filtered member accessibility: " + filteredMemberAccessibility
+ "\n-> filtered member modifiers: " + filteredMemberModifiers
+ "\n-> relations: " + relations;
}
public static class Hierarchy {
public static final Hierarchy DECLARATION = new Hierarchy("package hierarchy");
public static final Hierarchy CROSSCUTTING = new Hierarchy("crosscutting structure");
public static final Hierarchy INHERITANCE = new Hierarchy("type hierarchy");
public static final Hierarchy[] ALL = { DECLARATION, CROSSCUTTING, INHERITANCE };
private final String name;
private Hierarchy(String name) {
this.name = name;
}
public String toString() {
return name;
}
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
private final int ordinal = nextOrdinal++;
private Object readResolve() throws ObjectStreamException {
return ALL[ordinal];
}
}
public static class Grouping {
public static final Grouping KIND = new Grouping("group by kind");
public static final Grouping VISIBILITY = new Grouping("group by visibility");
public static final Grouping[] ALL = { KIND, VISIBILITY };
private final String name;
private Grouping(String name) {
this.name = name;
}
public String toString() {
return name;
}
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
private final int ordinal = nextOrdinal++;
private Object readResolve() throws ObjectStreamException {
return ALL[ordinal];
}
}
public static class Sorting {
public static final Sorting ALPHABETICAL = new Sorting("sort alphabetically");
public static final Sorting DECLARATIONAL = new Sorting("sort declarationally");
public static final Sorting[] ALL = { ALPHABETICAL, DECLARATIONAL };
private final String name;
private Sorting(String name) {
this.name = name;
}
public String toString() {
return name;
}
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
private final int ordinal = nextOrdinal++;
private Object readResolve() throws ObjectStreamException {
return ALL[ordinal];
}
}
public static class Granularity {
public static final Granularity PACKAGE = new Granularity("package");
public static final Granularity FILE = new Granularity("file");
public static final Granularity TYPE = new Granularity("type");
public static final Granularity MEMBER = new Granularity("member");
public static final Granularity DECLARED_ELEMENTS = new Granularity("declared body elements");
public static final Granularity[] ALL = { PACKAGE, FILE, TYPE, MEMBER, DECLARED_ELEMENTS };
private final String name;
private Granularity(String name) {
this.name = name;
}
public String toString() {
return name;
}
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
private final int ordinal = nextOrdinal++;
private Object readResolve() throws ObjectStreamException {
return ALL[ordinal];
}
}
}
|