Mercurial > projects > dwt-addons
diff dwtx/text/edits/EditDocument.d @ 129:eb30df5ca28b
Added JFace Text sources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 23 Aug 2008 19:10:48 +0200 |
parents | |
children | b56e9be9fe88 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtx/text/edits/EditDocument.d Sat Aug 23 19:10:48 2008 +0200 @@ -0,0 +1,211 @@ +/******************************************************************************* + * Copyright (c) 2000, 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module dwtx.text.edits.EditDocument; + +import dwt.dwthelper.utils; + +import dwtx.jface.text.BadLocationException; +import dwtx.jface.text.BadPositionCategoryException; +import dwtx.jface.text.IDocument; +import dwtx.jface.text.IDocumentListener; +import dwtx.jface.text.IDocumentPartitioner; +import dwtx.jface.text.IDocumentPartitioningListener; +import dwtx.jface.text.IPositionUpdater; +import dwtx.jface.text.IRegion; +import dwtx.jface.text.ITypedRegion; +import dwtx.jface.text.Position; + +class EditDocument : IDocument { + + private StringBuffer fBuffer; + + public EditDocument(String content) { + fBuffer= new StringBuffer(content); + } + + public void addDocumentListener(IDocumentListener listener) { + throw new UnsupportedOperationException(); + } + + public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) { + throw new UnsupportedOperationException(); + } + + public void addPosition(Position position) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException { + throw new UnsupportedOperationException(); + } + + public void addPositionCategory(String category) { + throw new UnsupportedOperationException(); + } + + public void addPositionUpdater(IPositionUpdater updater) { + throw new UnsupportedOperationException(); + } + + public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) { + throw new UnsupportedOperationException(); + } + + public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException { + throw new UnsupportedOperationException(); + } + + public int computeNumberOfLines(String text) { + throw new UnsupportedOperationException(); + } + + public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public bool containsPosition(String category, int offset, int length) { + throw new UnsupportedOperationException(); + } + + public bool containsPositionCategory(String category) { + throw new UnsupportedOperationException(); + } + + public String get() { + return fBuffer.toString(); + } + + public String get(int offset, int length) throws BadLocationException { + return fBuffer.substring(offset, offset + length); + } + + public char getChar(int offset) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public String getContentType(int offset) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public IDocumentPartitioner getDocumentPartitioner() { + throw new UnsupportedOperationException(); + } + + public String[] getLegalContentTypes() { + throw new UnsupportedOperationException(); + } + + public String[] getLegalLineDelimiters() { + throw new UnsupportedOperationException(); + } + + public int getLength() { + return fBuffer.length(); + } + + public String getLineDelimiter(int line) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public IRegion getLineInformation(int line) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public IRegion getLineInformationOfOffset(int offset) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public int getLineLength(int line) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public int getLineOffset(int line) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public int getLineOfOffset(int offset) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public int getNumberOfLines() { + throw new UnsupportedOperationException(); + } + + public int getNumberOfLines(int offset, int length) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public ITypedRegion getPartition(int offset) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public String[] getPositionCategories() { + throw new UnsupportedOperationException(); + } + + public Position[] getPositions(String category) throws BadPositionCategoryException { + throw new UnsupportedOperationException(); + } + + public IPositionUpdater[] getPositionUpdaters() { + throw new UnsupportedOperationException(); + } + + public void insertPositionUpdater(IPositionUpdater updater, int index) { + throw new UnsupportedOperationException(); + } + + public void removeDocumentListener(IDocumentListener listener) { + throw new UnsupportedOperationException(); + } + + public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) { + throw new UnsupportedOperationException(); + } + + public void removePosition(Position position) { + throw new UnsupportedOperationException(); + } + + public void removePosition(String category, Position position) throws BadPositionCategoryException { + throw new UnsupportedOperationException(); + } + + public void removePositionCategory(String category) throws BadPositionCategoryException { + throw new UnsupportedOperationException(); + } + + public void removePositionUpdater(IPositionUpdater updater) { + throw new UnsupportedOperationException(); + } + + public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) { + throw new UnsupportedOperationException(); + } + + public void replace(int offset, int length, String text) throws BadLocationException { + fBuffer.replace(offset, offset + length, text); + } + + public int search(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) throws BadLocationException { + throw new UnsupportedOperationException(); + } + + public void set(String text) { + throw new UnsupportedOperationException(); + } + + public void setDocumentPartitioner(IDocumentPartitioner partitioner) { + throw new UnsupportedOperationException(); + } +}