1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.seasar.eclipse.common.util; |
17 | |
|
18 | |
import org.eclipse.core.runtime.IConfigurationElement; |
19 | |
import org.eclipse.core.runtime.IExtension; |
20 | |
import org.eclipse.core.runtime.IExtensionPoint; |
21 | |
import org.eclipse.core.runtime.IExtensionRegistry; |
22 | |
import org.eclipse.core.runtime.Platform; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | 0 | public class ExtensionAcceptor { |
29 | |
|
30 | |
public static void accept(String namespace, String extensionPointName, |
31 | |
ExtensionVisitor visitor) { |
32 | 0 | IExtensionRegistry registry = Platform.getExtensionRegistry(); |
33 | 0 | IExtensionPoint point = registry.getExtensionPoint(namespace, |
34 | |
extensionPointName); |
35 | |
|
36 | 0 | for (IExtension extension : point.getExtensions()) { |
37 | 0 | for (IConfigurationElement element : extension.getConfigurationElements()) { |
38 | 0 | visitor.visit(element); |
39 | |
} |
40 | |
} |
41 | |
|
42 | 0 | } |
43 | |
|
44 | 0 | public interface ExtensionVisitor { |
45 | |
void visit(IConfigurationElement e); |
46 | |
} |
47 | |
|
48 | |
} |