View | Details | Raw Unified | Return to bug 257446
Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/site/Site.java (-14 / +55 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-27 Link Here
13
import java.io.PrintWriter;
13
import java.io.PrintWriter;
14
import java.util.Locale;
14
import java.util.Locale;
15
import java.util.Vector;
15
import java.util.Vector;
16
17
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.pde.core.IModelChangedEvent;
17
import org.eclipse.pde.core.IModelChangedEvent;
19
import org.eclipse.pde.core.IWritable;
18
import org.eclipse.pde.core.IWritable;
20
import org.eclipse.pde.internal.core.isite.ISite;
19
import org.eclipse.pde.internal.core.isite.*;
21
import org.eclipse.pde.internal.core.isite.ISiteArchive;
22
import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition;
23
import org.eclipse.pde.internal.core.isite.ISiteDescription;
24
import org.eclipse.pde.internal.core.isite.ISiteFeature;
25
import org.w3c.dom.Node;
20
import org.w3c.dom.Node;
26
import org.w3c.dom.NodeList;
21
import org.w3c.dom.NodeList;
27
22
Lines 34-39 Link Here
34
	private String type;
29
	private String type;
35
	private String url;
30
	private String url;
36
	private String mirrorsUrl;
31
	private String mirrorsUrl;
32
	private String digestUrl;
33
	private String associateSitesUrl;
37
	private ISiteDescription description;
34
	private ISiteDescription description;
38
35
39
	/**
36
	/**
Lines 71-76 Link Here
71
	}
68
	}
72
69
73
	/**
70
	/**
71
	 * @see org.eclipse.pde.internal.core.isite.ISite#setDigestURL(String)
72
	 */
73
	public void setDigestURL(String url) throws CoreException {
74
		ensureModelEditable();
75
		Object oldValue = this.digestUrl;
76
		this.digestUrl = url;
77
		firePropertyChanged(P_DIGEST_URL, oldValue, url);
78
	}
79
80
	/**
81
	 * @see org.eclipse.pde.internal.core.isite.ISite#getDigestURL()
82
	 */
83
	public String getDigestURL() {
84
		return digestUrl;
85
	}
86
87
	/**
88
	 * @see org.eclipse.pde.internal.core.isite.ISite#setAssociateSitesURL(String)
89
	 */
90
	public void setAssociateSitesURL(String url) throws CoreException {
91
		ensureModelEditable();
92
		Object oldValue = this.associateSitesUrl;
93
		this.associateSitesUrl = url;
94
		firePropertyChanged(P_ASSOCIATE_SITES_URL, oldValue, url);
95
	}
96
97
	/**
98
	 * @see org.eclipse.pde.internal.core.isite.ISite#getAssociateSitesURL()
99
	 */
100
	public String getAssociateSitesURL() {
101
		return associateSitesUrl;
102
	}
103
104
	/**
74
	 * @see org.eclipse.pde.internal.core.isite.ISite#setMirrorsURL(String)
105
	 * @see org.eclipse.pde.internal.core.isite.ISite#setMirrorsURL(String)
75
	 */
106
	 */
76
	public void setMirrorsURL(String url) throws CoreException {
107
	public void setMirrorsURL(String url) throws CoreException {
Lines 211-222 Link Here
211
		type = null;
242
		type = null;
212
		url = null;
243
		url = null;
213
		mirrorsUrl = null;
244
		mirrorsUrl = null;
245
		digestUrl = null;
246
		associateSitesUrl = null;
214
	}
247
	}
215
248
216
	protected void parse(Node node) {
249
	protected void parse(Node node) {
217
		type = getNodeAttribute(node, "type"); //$NON-NLS-1$
250
		type = getNodeAttribute(node, P_TYPE);
218
		url = getNodeAttribute(node, "url"); //$NON-NLS-1$
251
		url = getNodeAttribute(node, P_URL);
219
		mirrorsUrl = getNodeAttribute(node, "mirrorsURL"); //$NON-NLS-1$
252
		mirrorsUrl = getNodeAttribute(node, P_MIRRORS_URL);
253
		digestUrl = getNodeAttribute(node, P_DIGEST_URL);
254
		associateSitesUrl = getNodeAttribute(node, P_ASSOCIATE_SITES_URL);
220
		NodeList children = node.getChildNodes();
255
		NodeList children = node.getChildNodes();
221
		for (int i = 0; i < children.getLength(); i++) {
256
		for (int i = 0; i < children.getLength(); i++) {
222
			Node child = children.item(i);
257
			Node child = children.item(i);
Lines 243-249 Link Here
243
			((SiteCategoryDefinition) def).parse(child);
278
			((SiteCategoryDefinition) def).parse(child);
244
			((SiteCategoryDefinition) def).setInTheModel(true);
279
			((SiteCategoryDefinition) def).setInTheModel(true);
245
			categoryDefs.add(def);
280
			categoryDefs.add(def);
246
		} else if (tag.equals("description")) { //$NON-NLS-1$
281
		} else if (tag.equals(P_DESCRIPTION)) {
247
			if (description != null)
282
			if (description != null)
248
				return;
283
				return;
249
			description = getModel().getFactory().createDescription(this);
284
			description = getModel().getFactory().createDescription(this);
Lines 259-264 Link Here
259
			setURL(newValue != null ? newValue.toString() : null);
294
			setURL(newValue != null ? newValue.toString() : null);
260
		} else if (name.equals(P_MIRRORS_URL)) {
295
		} else if (name.equals(P_MIRRORS_URL)) {
261
			setMirrorsURL(newValue != null ? newValue.toString() : null);
296
			setMirrorsURL(newValue != null ? newValue.toString() : null);
297
		} else if (name.equals(P_DIGEST_URL)) {
298
			setDigestURL(newValue != null ? newValue.toString() : null);
299
		} else if (name.equals(P_ASSOCIATE_SITES_URL)) {
300
			setAssociateSitesURL(newValue != null ? newValue.toString() : null);
262
		} else if (name.equals(P_DESCRIPTION) && newValue instanceof ISiteDescription) {
301
		} else if (name.equals(P_DESCRIPTION) && newValue instanceof ISiteDescription) {
263
			setDescription((ISiteDescription) newValue);
302
			setDescription((ISiteDescription) newValue);
264
		} else
303
		} else
Lines 269-277 Link Here
269
		writer.print(indent + "<site"); //$NON-NLS-1$
308
		writer.print(indent + "<site"); //$NON-NLS-1$
270
		String indent2 = indent + INDENT;
309
		String indent2 = indent + INDENT;
271
		String indenta = indent + INDENT + INDENT;
310
		String indenta = indent + INDENT + INDENT;
272
		writeIfDefined(indenta, writer, "type", getType()); //$NON-NLS-1$
311
		writeIfDefined(indenta, writer, P_TYPE, getType());
273
		writeIfDefined(indenta, writer, "url", getURL()); //$NON-NLS-1$
312
		writeIfDefined(indenta, writer, P_URL, getURL());
274
		writeIfDefined(indenta, writer, "mirrorsURL", getMirrorsURL()); //$NON-NLS-1$
313
		writeIfDefined(indenta, writer, P_MIRRORS_URL, getMirrorsURL());
314
		writeIfDefined(indenta, writer, P_DIGEST_URL, getDigestURL());
315
		writeIfDefined(indenta, writer, P_ASSOCIATE_SITES_URL, getAssociateSitesURL());
275
		writer.println(">"); //$NON-NLS-1$
316
		writer.println(">"); //$NON-NLS-1$
276
317
277
		if (description != null) {
318
		if (description != null) {
(-)src/org/eclipse/pde/internal/core/isite/ISite.java (-1 / +13 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 24-29 Link Here
24
24
25
	String P_DESCRIPTION = "description"; //$NON-NLS-1$
25
	String P_DESCRIPTION = "description"; //$NON-NLS-1$
26
26
27
	String P_DIGEST_URL = "digestURL"; //$NON-NLS-1$
28
29
	String P_ASSOCIATE_SITES_URL = "associateSitesURL"; //$NON-NLS-1$
30
27
	void setType(String type) throws CoreException;
31
	void setType(String type) throws CoreException;
28
32
29
	String getType();
33
	String getType();
Lines 32-41 Link Here
32
36
33
	void setMirrorsURL(String url) throws CoreException;
37
	void setMirrorsURL(String url) throws CoreException;
34
38
39
	void setDigestURL(String url) throws CoreException;
40
41
	void setAssociateSitesURL(String url) throws CoreException;
42
35
	String getURL();
43
	String getURL();
36
44
37
	String getMirrorsURL();
45
	String getMirrorsURL();
38
46
47
	String getDigestURL();
48
49
	String getAssociateSitesURL();
50
39
	ISiteDescription getDescription();
51
	ISiteDescription getDescription();
40
52
41
	void setDescription(ISiteDescription description) throws CoreException;
53
	void setDescription(ISiteDescription description) throws CoreException;

Return to bug 257446