KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > model > DocumentTextNode


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;
12
13 public class DocumentTextNode implements IDocumentTextNode {
14     private int fOffset = -1;
15     private int fLength = 0;
16     private IDocumentNode fEnclosingElement;
17     private String JavaDoc fText;
18
19     /* (non-Javadoc)
20      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setEnclosingElement(org.eclipse.pde.internal.ui.model.IDocumentNode)
21      */

22     public void setEnclosingElement(IDocumentNode node) {
23         fEnclosingElement = node;
24     }
25     /* (non-Javadoc)
26      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getEnclosingElement()
27      */

28     public IDocumentNode getEnclosingElement() {
29         return fEnclosingElement;
30     }
31     /* (non-Javadoc)
32      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setText(java.lang.String)
33      */

34     public void setText(String JavaDoc text) {
35         fText = text;
36     }
37     /* (non-Javadoc)
38      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getText()
39      */

40     public String JavaDoc getText() {
41         return fText == null ? "" : fText; //$NON-NLS-1$
42
}
43     /* (non-Javadoc)
44      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setOffset(int)
45      */

46     public void setOffset(int offset) {
47         fOffset = offset;
48     }
49     /* (non-Javadoc)
50      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getOffset()
51      */

52     public int getOffset() {
53         return fOffset;
54     }
55     
56     /* (non-Javadoc)
57      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#getLength()
58      */

59     public int getLength() {
60         return fLength;
61     }
62     
63     /* (non-Javadoc)
64      * @see org.eclipse.pde.internal.ui.model.IDocumentTextNode#setLength(int)
65      */

66     public void setLength(int length) {
67         fLength = length;
68     }
69     
70 }
71
Popular Tags