Lines 34-42
Link Here
|
34 |
protected static final String VALIDATOR_EXT_ID = PLUGIN_ID + ".validator"; |
34 |
protected static final String VALIDATOR_EXT_ID = PLUGIN_ID + ".validator"; |
35 |
protected static final String TAD_VERSION_EXT_ID = PLUGIN_ID + |
35 |
protected static final String TAD_VERSION_EXT_ID = PLUGIN_ID + |
36 |
".tad_versions"; |
36 |
".tad_versions"; |
|
|
37 |
protected static final String REPORT_ARTIFACT_TYPES_EXT_ID = PLUGIN_ID + |
38 |
".reportArtifactTypes"; |
37 |
protected static final String ATT_CLASS = "class"; |
39 |
protected static final String ATT_CLASS = "class"; |
38 |
protected static final String ATT_TAD_NAME = "tad_name"; |
40 |
protected static final String ATT_TAD_NAME = "tad_name"; |
39 |
protected static final String ATT_TAD_VERSION = "version"; |
41 |
protected static final String ATT_TAD_VERSION = "version"; |
|
|
42 |
protected static final String ATT_ARTIFACT_TYPE = "artifactType"; |
40 |
//protected ResourceBundle resourcebundle = null; |
43 |
//protected ResourceBundle resourcebundle = null; |
41 |
|
44 |
|
42 |
/* Holds validators read from the platform registry. Lazy initialized in |
45 |
/* Holds validators read from the platform registry. Lazy initialized in |
Lines 50-55
Link Here
|
50 |
* Lazy initialized in computeTADVersions(). */ |
53 |
* Lazy initialized in computeTADVersions(). */ |
51 |
private String tadVersions[][]; |
54 |
private String tadVersions[][]; |
52 |
|
55 |
|
|
|
56 |
/* Holds artifact type names for reporting read from the platform registry. |
57 |
* Lazy initialized in getAllReportArtifactTypes(). */ |
58 |
private String reportArtifactTypes[]; |
59 |
|
53 |
/** |
60 |
/** |
54 |
* Constructor for wsiTestToolsPlugin. |
61 |
* Constructor for wsiTestToolsPlugin. |
55 |
* @param descriptor an IPluginDescriptor object. |
62 |
* @param descriptor an IPluginDescriptor object. |
Lines 168-171
Link Here
|
168 |
tadVersions = computeTADVersions(); |
175 |
tadVersions = computeTADVersions(); |
169 |
return tadVersions; |
176 |
return tadVersions; |
170 |
} |
177 |
} |
|
|
178 |
|
179 |
/* Computes the list of artifact types by scanning the platform registry. */ |
180 |
private String[] computeReportArtifactTypes() { |
181 |
IExtensionRegistry registry = Platform.getExtensionRegistry(); |
182 |
IExtensionPoint extensionPoint = registry.getExtensionPoint( |
183 |
REPORT_ARTIFACT_TYPES_EXT_ID); |
184 |
IExtension[] extensions = extensionPoint.getExtensions(); |
185 |
ArrayList results = new ArrayList(); |
186 |
for (int i = 0; i < extensions.length; i++) { |
187 |
IConfigurationElement reportArtifactElements[] = extensions[i]. |
188 |
getConfigurationElements(); |
189 |
for (int j = 0; j < reportArtifactElements.length; j++) { |
190 |
String reportArtifact = reportArtifactElements[j].getAttribute( |
191 |
ATT_ARTIFACT_TYPE); |
192 |
results.add(reportArtifact); |
193 |
} |
194 |
} |
195 |
return (String[]) results.toArray(new String[0]); |
196 |
} |
197 |
|
198 |
/** |
199 |
* Find all report artifact types tags found in the platform registry |
200 |
* extension points org.eclipse.wst.wsi.reportArtifactTypes. |
201 |
* @return an array containing these Strings |
202 |
*/ |
203 |
public String[] getAllReportArtifactTypes() { |
204 |
if (reportArtifactTypes == null) |
205 |
reportArtifactTypes = computeReportArtifactTypes(); |
206 |
return reportArtifactTypes; |
207 |
} |
171 |
} |
208 |
} |