1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package pl.edu.agh.cast.data;
19
20 import org.apache.log4j.ConsoleAppender;
21 import org.apache.log4j.Level;
22 import org.apache.log4j.Logger;
23 import org.apache.log4j.PatternLayout;
24 import org.eclipse.core.runtime.Plugin;
25 import org.osgi.framework.BundleContext;
26
27
28
29
30
31
32 public class Activator extends Plugin {
33
34 private static final String ID = "id";
35
36 private static final String NAME = "name";
37
38 private static final String DESCRIPTION = "description";
39
40 private static final String POINT = "point";
41
42
43
44
45 public static final String PLUGIN_ID = "pl.edu.agh.cast.data";
46
47
48
49
50 public static final String DATA_IMPORTER_EXTENSION_ID = "pl.edu.agh.cast.importer.data";
51
52
53
54
55 public static final String DATA_PREPROCESSOR_EXTENSION_ID = "pl.edu.agh.cast.importer.preprocessing";
56
57
58
59
60 public static final String DATA_IMPORTER_NAME = NAME;
61
62
63
64
65 public static final String DATA_IMPORTER_ID = ID;
66
67
68
69
70 public static final String DATA_IMPORTER_DESCRIPTION = DESCRIPTION;
71
72
73
74
75 public static final String DATA_IMPORTER_CLASS = POINT;
76
77
78
79
80 public static final String DATA_IMPORTER = "dataimporter";
81
82
83
84
85 public static final String DATA_PREPROCESSOR_NAME = NAME;
86
87
88
89
90 public static final String DATA_PREPROCESSOR_ID = ID;
91
92
93
94
95 public static final String DATA_PREPROCESSOR_CLASS = POINT;
96
97
98
99
100 public static final String DATA_PREPROCESSOR_DESC = DESCRIPTION;
101
102
103 private static Activator plugin;
104
105 private static Logger log;
106
107
108
109
110 public Activator() {
111 plugin = this;
112 }
113
114
115
116
117
118
119 public static Logger getLogger() {
120 if (log == null) {
121 log = Logger.getLogger(Activator.class);
122 if (!log.getAllAppenders().hasMoreElements()) {
123
124 log.addAppender(new ConsoleAppender(new PatternLayout("%c: %5p [%t] (%F:%L) - %m%n ")));
125 log.setLevel(Level.INFO);
126 }
127 }
128 return log;
129 }
130
131
132
133
134
135
136 public static Activator getDefault() {
137 return plugin;
138 }
139
140
141
142
143
144
145
146
147
148
149
150
151 @Override
152 public void start(BundleContext context) throws Exception {
153 super.start(context);
154 }
155
156
157
158
159
160
161 @Override
162 public void stop(BundleContext context) throws Exception {
163 plugin = null;
164 super.stop(context);
165 }
166 }