KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > console > ConsoleDocument


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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.ui.internal.console;
12
13 import org.eclipse.jface.text.BadLocationException;
14 import org.eclipse.jface.text.BadPositionCategoryException;
15 import org.eclipse.jface.text.Document;
16 import org.eclipse.jface.text.IRegion;
17 import org.eclipse.jface.text.Position;
18
19 /**
20  * A console document. Requires synchronization for multi-threaded access.
21  */

22 public class ConsoleDocument extends Document {
23
24     /* (non-Javadoc)
25      * @see org.eclipse.jface.text.IDocument#get(int, int)
26      */

27     public synchronized String JavaDoc get(int pos, int length) throws BadLocationException {
28         return super.get(pos, length);
29     }
30     /* (non-Javadoc)
31      * @see org.eclipse.jface.text.IDocument#getLength()
32      */

33     public synchronized int getLength() {
34         return super.getLength();
35     }
36     /* (non-Javadoc)
37      * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
38      */

39     public synchronized String JavaDoc getLineDelimiter(int line) throws BadLocationException {
40         return super.getLineDelimiter(line);
41     }
42     /* (non-Javadoc)
43      * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
44      */

45     public synchronized IRegion getLineInformation(int line) throws BadLocationException {
46         return super.getLineInformation(line);
47     }
48     /* (non-Javadoc)
49      * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
50      */

51     public synchronized IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
52         return super.getLineInformationOfOffset(offset);
53     }
54     /* (non-Javadoc)
55      * @see org.eclipse.jface.text.IDocument#getLineLength(int)
56      */

57     public synchronized int getLineLength(int line) throws BadLocationException {
58         return super.getLineLength(line);
59     }
60     /* (non-Javadoc)
61      * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
62      */

63     public synchronized int getLineOffset(int line) throws BadLocationException {
64         return super.getLineOffset(line);
65     }
66     /* (non-Javadoc)
67      * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
68      */

69     public int getLineOfOffset(int pos) throws BadLocationException {
70         return super.getLineOfOffset(pos);
71     }
72     /* (non-Javadoc)
73      * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
74      */

75     public synchronized int getNumberOfLines() {
76         return super.getNumberOfLines();
77     }
78     /* (non-Javadoc)
79      * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
80      */

81     public synchronized void replace(int pos, int length, String JavaDoc text) throws BadLocationException {
82         super.replace(pos, length, text);
83     }
84     /* (non-Javadoc)
85      * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
86      */

87     public synchronized void set(String JavaDoc text) {
88         super.set(text);
89     }
90     /* (non-Javadoc)
91      * @see org.eclipse.jface.text.AbstractDocument#completeInitialization()
92      */

93     protected void completeInitialization() {
94         super.completeInitialization();
95         addPositionUpdater(new HyperlinkUpdater());
96     }
97     /* (non-Javadoc)
98      * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
99      */

100     public synchronized void addPosition(String JavaDoc category, Position position) throws BadLocationException, BadPositionCategoryException {
101         super.addPosition(category, position);
102     }
103     /* (non-Javadoc)
104      * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
105      */

106     public synchronized void removePosition(String JavaDoc category, Position position) throws BadPositionCategoryException {
107         super.removePosition(category, position);
108     }
109     /* (non-Javadoc)
110      * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
111      */

112     public synchronized Position[] getPositions(String JavaDoc category) throws BadPositionCategoryException {
113         return super.getPositions(category);
114     }
115 }
116
Popular Tags