01: /*******************************************************************************
02: * Copyright (c) 2005, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core.target;
11:
12: import java.io.PrintWriter;
13:
14: import org.eclipse.pde.internal.core.itarget.IAdditionalLocation;
15: import org.eclipse.pde.internal.core.itarget.ITargetModel;
16: import org.w3c.dom.Element;
17: import org.w3c.dom.Node;
18:
19: public class AdditionalDirectory extends TargetObject implements
20: IAdditionalLocation {
21:
22: private static final long serialVersionUID = 1L;
23:
24: private String fPath = ""; //$NON-NLS-1$
25:
26: public AdditionalDirectory(ITargetModel model) {
27: super (model);
28: }
29:
30: public String getPath() {
31: return fPath;
32: }
33:
34: public void setPath(String path) {
35: String oldPath = fPath;
36: fPath = path;
37: firePropertyChanged(P_PATH, oldPath, fPath);
38: }
39:
40: public void parse(Node node) {
41: if (node.getNodeType() == Node.ELEMENT_NODE)
42: fPath = ((Element) node).getAttribute("path"); //$NON-NLS-1$
43: }
44:
45: public void write(String indent, PrintWriter writer) {
46: writer
47: .println(indent
48: + "<location path=\"" + getWritableString(fPath) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
49: }
50: }
|