KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > target > AdditionalDirectory


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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 Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.core.target;
12
13 import java.io.PrintWriter JavaDoc;
14
15 import org.eclipse.pde.internal.core.itarget.IAdditionalLocation;
16 import org.eclipse.pde.internal.core.itarget.ITargetModel;
17 import org.w3c.dom.Element JavaDoc;
18 import org.w3c.dom.Node JavaDoc;
19
20 public class AdditionalDirectory extends TargetObject implements
21         IAdditionalLocation {
22
23     private static final long serialVersionUID = 1L;
24     
25     private String JavaDoc fPath = ""; //$NON-NLS-1$
26

27     public AdditionalDirectory(ITargetModel model) {
28         super(model);
29     }
30
31     public String JavaDoc getPath() {
32         return fPath;
33     }
34
35     public void setPath(String JavaDoc path) {
36         String JavaDoc oldPath = fPath;
37         fPath = path;
38         firePropertyChanged(P_PATH, oldPath, fPath);
39     }
40
41     public void parse(Node JavaDoc node) {
42         if (node.getNodeType() == Node.ELEMENT_NODE)
43             fPath = ((Element JavaDoc)node).getAttribute("path"); //$NON-NLS-1$
44
}
45
46     public void write(String JavaDoc indent, PrintWriter JavaDoc writer) {
47         writer.println(indent + "<location path=\"" + getWritableString(fPath) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
48
}
49 }
50
Popular Tags