KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > build > SourceFeatureWriter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.build;
12
13 import java.io.IOException JavaDoc;
14 import java.io.OutputStream JavaDoc;
15 import java.util.LinkedHashMap JavaDoc;
16 import java.util.Map JavaDoc;
17 import org.eclipse.core.runtime.CoreException;
18 import org.eclipse.pde.internal.build.builder.FeatureBuildScriptGenerator;
19 import org.eclipse.update.core.Feature;
20 import org.eclipse.update.core.IIncludedFeatureReference;
21
22 public class SourceFeatureWriter extends FeatureWriter {
23
24     public SourceFeatureWriter(OutputStream JavaDoc out, Feature feature, FeatureBuildScriptGenerator generator) throws IOException JavaDoc {
25         super(out, feature, generator);
26     }
27
28     public void printIncludes() {
29         Map JavaDoc parameters = new LinkedHashMap JavaDoc();
30         // TO CHECK Here we should have the raw list...
31
IIncludedFeatureReference[] features = feature.getFeatureIncluded();
32         for (int i = 0; i < features.length; i++) {
33             parameters.clear();
34             try {
35                 parameters.put("id", features[i].getVersionedIdentifier().getIdentifier()); //$NON-NLS-1$
36
parameters.put("version", features[i].getVersionedIdentifier().getVersion()); //$NON-NLS-1$
37
} catch (CoreException e) {
38                 e.printStackTrace(); //TO CHECK better handling of exception
39
}
40
41             printTag("includes", parameters, true, true, true); //$NON-NLS-1$
42
}
43     }
44 }
45
Popular Tags