001: /*******************************************************************************
002: * Copyright (c) 2000, 2007 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.internal.console;
011:
012: import org.eclipse.jface.text.BadLocationException;
013: import org.eclipse.jface.text.BadPositionCategoryException;
014: import org.eclipse.jface.text.Document;
015: import org.eclipse.jface.text.IRegion;
016: import org.eclipse.jface.text.Position;
017:
018: /**
019: * A console document. Requires synchronization for multi-threaded access.
020: */
021: public class ConsoleDocument extends Document {
022:
023: /* (non-Javadoc)
024: * @see org.eclipse.jface.text.IDocument#get(int, int)
025: */
026: public synchronized String get(int pos, int length)
027: throws BadLocationException {
028: return super .get(pos, length);
029: }
030:
031: /* (non-Javadoc)
032: * @see org.eclipse.jface.text.IDocument#getLength()
033: */
034: public synchronized int getLength() {
035: return super .getLength();
036: }
037:
038: /* (non-Javadoc)
039: * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
040: */
041: public synchronized String getLineDelimiter(int line)
042: throws BadLocationException {
043: return super .getLineDelimiter(line);
044: }
045:
046: /* (non-Javadoc)
047: * @see org.eclipse.jface.text.IDocument#getLineInformation(int)
048: */
049: public synchronized IRegion getLineInformation(int line)
050: throws BadLocationException {
051: return super .getLineInformation(line);
052: }
053:
054: /* (non-Javadoc)
055: * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
056: */
057: public synchronized IRegion getLineInformationOfOffset(int offset)
058: throws BadLocationException {
059: return super .getLineInformationOfOffset(offset);
060: }
061:
062: /* (non-Javadoc)
063: * @see org.eclipse.jface.text.IDocument#getLineLength(int)
064: */
065: public synchronized int getLineLength(int line)
066: throws BadLocationException {
067: return super .getLineLength(line);
068: }
069:
070: /* (non-Javadoc)
071: * @see org.eclipse.jface.text.IDocument#getLineOffset(int)
072: */
073: public synchronized int getLineOffset(int line)
074: throws BadLocationException {
075: return super .getLineOffset(line);
076: }
077:
078: /* (non-Javadoc)
079: * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
080: */
081: public int getLineOfOffset(int pos) throws BadLocationException {
082: return super .getLineOfOffset(pos);
083: }
084:
085: /* (non-Javadoc)
086: * @see org.eclipse.jface.text.IDocument#getNumberOfLines()
087: */
088: public synchronized int getNumberOfLines() {
089: return super .getNumberOfLines();
090: }
091:
092: /* (non-Javadoc)
093: * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
094: */
095: public synchronized void replace(int pos, int length, String text)
096: throws BadLocationException {
097: super .replace(pos, length, text);
098: }
099:
100: /* (non-Javadoc)
101: * @see org.eclipse.jface.text.IDocument#set(java.lang.String)
102: */
103: public synchronized void set(String text) {
104: super .set(text);
105: }
106:
107: /* (non-Javadoc)
108: * @see org.eclipse.jface.text.AbstractDocument#completeInitialization()
109: */
110: protected void completeInitialization() {
111: super .completeInitialization();
112: addPositionUpdater(new HyperlinkUpdater());
113: }
114:
115: /* (non-Javadoc)
116: * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position)
117: */
118: public synchronized void addPosition(String category,
119: Position position) throws BadLocationException,
120: BadPositionCategoryException {
121: super .addPosition(category, position);
122: }
123:
124: /* (non-Javadoc)
125: * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position)
126: */
127: public synchronized void removePosition(String category,
128: Position position) throws BadPositionCategoryException {
129: super .removePosition(category, position);
130: }
131:
132: /* (non-Javadoc)
133: * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String)
134: */
135: public synchronized Position[] getPositions(String category)
136: throws BadPositionCategoryException {
137: return super.getPositions(category);
138: }
139: }
|