KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > model > bundle > ManifestHeader


1 /*******************************************************************************
2  * Copyright (c) 2000, 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.ui.model.bundle;
12
13 import java.io.PrintWriter JavaDoc;
14
15 import org.eclipse.pde.internal.core.bundle.BundleObject;
16 import org.eclipse.pde.internal.core.ibundle.IBundle;
17 import org.eclipse.pde.internal.ui.model.IDocumentKey;
18
19 public class ManifestHeader extends BundleObject implements IDocumentKey {
20     private static final long serialVersionUID = 1L;
21     private int fOffset = -1;
22     private int fLength = -1;
23     
24     protected String JavaDoc fName;
25     protected String JavaDoc fValue;
26     private IBundle fBundle;
27     
28     public ManifestHeader(String JavaDoc name, String JavaDoc value, IBundle bundle) {
29         fName = name;
30         fValue = value;
31         fBundle = bundle;
32         setModel(fBundle.getModel());
33     }
34
35     /* (non-Javadoc)
36      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setName(java.lang.String)
37      */

38     public void setName(String JavaDoc name) {
39         fName = name;
40     }
41     /* (non-Javadoc)
42      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getName()
43      */

44     public String JavaDoc getName() {
45         return fName;
46     }
47     
48     public void setValue(String JavaDoc value) {
49         fValue = value;
50     }
51     
52     public String JavaDoc getValue() {
53         return fValue;
54     }
55     /* (non-Javadoc)
56      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setOffset(int)
57      */

58     public void setOffset(int offset) {
59         fOffset = offset;
60     }
61     /* (non-Javadoc)
62      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getOffset()
63      */

64     public int getOffset() {
65         return fOffset;
66     }
67     /* (non-Javadoc)
68      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#setLength(int)
69      */

70     public void setLength(int length) {
71         fLength = length;
72     }
73     /* (non-Javadoc)
74      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#getLength()
75      */

76     public int getLength() {
77         return fLength;
78     }
79     /* (non-Javadoc)
80      * @see org.eclipse.pde.internal.ui.model.IDocumentKey#write()
81      */

82     public String JavaDoc write() {
83         updateValue();
84         return fName + ": " + fValue; //$NON-NLS-1$
85
}
86     /* (non-Javadoc)
87      * @see org.eclipse.pde.core.IWritable#write(java.lang.String, java.io.PrintWriter)
88      */

89     public void write(String JavaDoc indent, PrintWriter JavaDoc writer) {
90     }
91     
92     public void setBundle(IBundle bundle) {
93         fBundle = bundle;
94     }
95     
96     public IBundle getBundle() {
97         return fBundle;
98     }
99     
100     public void updateValue() {
101     }
102     
103     
104 }
105
Popular Tags