KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > product > IntroInfo


1 /*******************************************************************************
2  * Copyright (c) 2005 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.product;
12
13 import java.io.PrintWriter JavaDoc;
14
15 import org.eclipse.pde.internal.core.iproduct.IIntroInfo;
16 import org.eclipse.pde.internal.core.iproduct.IProductModel;
17 import org.w3c.dom.Element JavaDoc;
18 import org.w3c.dom.Node JavaDoc;
19
20 public class IntroInfo extends ProductObject implements IIntroInfo {
21
22     public static final String JavaDoc P_INTRO_ID = "introId"; //$NON-NLS-1$
23
private static final long serialVersionUID = 1L;
24     private String JavaDoc fIntroId;
25
26     public IntroInfo(IProductModel model) {
27         super(model);
28     }
29
30     public void setId(String JavaDoc id) {
31         String JavaDoc old = fIntroId;
32         fIntroId = id;
33         if (isEditable())
34             firePropertyChanged(P_INTRO_ID, old, fIntroId);
35     }
36
37     public String JavaDoc getId() {
38         return fIntroId;
39     }
40
41     public void parse(Node JavaDoc node) {
42         if (node.getNodeType() == Node.ELEMENT_NODE) {
43             Element JavaDoc element = (Element JavaDoc)node;
44             fIntroId = element.getAttribute(P_INTRO_ID);
45         }
46     }
47
48     public void write(String JavaDoc indent, PrintWriter JavaDoc writer) {
49         if (fIntroId != null && fIntroId.length() > 0)
50             writer.println(indent + "<intro " + P_INTRO_ID + "=\"" + getWritableString(fIntroId) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
51
}
52
53 }
54
Popular Tags