Mercurial > projects > dwt-addons
diff dwtx/jface/text/AbstractDocument.d @ 140:26688fec6d23
Following dsss compile errors
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 03:23:46 +0200 |
parents | b6bad70d540a |
children | 000f9136b8f7 |
line wrap: on
line diff
--- a/dwtx/jface/text/AbstractDocument.d Sun Aug 24 02:31:41 2008 +0200 +++ b/dwtx/jface/text/AbstractDocument.d Sun Aug 24 03:23:46 2008 +0200 @@ -493,7 +493,7 @@ /* * @see dwtx.jface.text.IDocument#addPosition(java.lang.String, dwtx.jface.text.Position) */ - public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException { + public void addPosition(String category, Position position) { if ((0 > position.offset) || (0 > position.length) || (position.offset + position.length > getLength())) throw new BadLocationException(); @@ -505,7 +505,7 @@ if (list is null) throw new BadPositionCategoryException(); list.add(computeIndexInPositionList(list, position.offset), position); - + List endPositions= cast(List) fEndPositions.get(category); if (endPositions is null) throw new BadPositionCategoryException(); @@ -598,7 +598,7 @@ protected int computeIndexInPositionList(List positions, int offset) { return computeIndexInPositionList(positions, offset, true); } - + /** * Computes the index in the list of positions at which a position with the given * position would be inserted. The position to insert is supposed to become the first @@ -676,7 +676,7 @@ /* * @see dwtx.jface.text.IDocument#computeIndexInCategory(java.lang.String, int) */ - public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException { + public int computeIndexInCategory(String category, int offset) { if (0 > offset || offset > getLength()) throw new BadLocationException(); @@ -697,7 +697,7 @@ protected void fireDocumentPartitioningChanged() { if (fDocumentPartitioningListeners is null) return; - + Object[] listeners= fDocumentPartitioningListeners.getListeners(); for (int i= 0; i < listeners.length; i++) (cast(IDocumentPartitioningListener)listeners[i]).documentPartitioningChanged(this); @@ -718,7 +718,7 @@ protected void fireDocumentPartitioningChanged(IRegion region) { if (fDocumentPartitioningListeners is null) return; - + Object[] listeners= fDocumentPartitioningListeners.getListeners(); for (int i= 0; i < listeners.length; i++) { IDocumentPartitioningListener l= cast(IDocumentPartitioningListener)listeners[i]; @@ -785,7 +785,7 @@ Object[] listeners= fPrenotifiedDocumentListeners.getListeners(); for (int i= 0; i < listeners.length; i++) (cast(IDocumentListener)listeners[i]).documentAboutToBeChanged(event); - + listeners= fDocumentListeners.getListeners(); for (int i= 0; i < listeners.length; i++) (cast(IDocumentListener)listeners[i]).documentAboutToBeChanged(event); @@ -967,20 +967,20 @@ public String[] getLegalLineDelimiters() { return getTracker().getLegalLineDelimiters(); } - + /* * @see dwtx.jface.text.IDocumentExtension4#getDefaultLineDelimiter() * @since 3.1 */ public String getDefaultLineDelimiter() { - + String lineDelimiter= null; - + try { lineDelimiter= getLineDelimiter(0); } catch (BadLocationException x) { } - + if (lineDelimiter !is null) return lineDelimiter; @@ -996,14 +996,14 @@ break; } } - + if (lineDelimiter is null) lineDelimiter= delimiters[0]; - + return lineDelimiter; - + } - + /* * @see dwtx.jface.text.IDocumentExtension4#setInitialLineDelimiter(java.lang.String) * @since 3.1 @@ -1182,7 +1182,7 @@ if (c is null) throw new BadPositionCategoryException(); removeFromPositionsList(c, position, true); - + List endPositions= cast(List) fEndPositions.get(category); if (endPositions is null) throw new BadPositionCategoryException(); @@ -1199,14 +1199,14 @@ */ private void removeFromPositionsList(List positions, Position position, bool orderedByOffset) { int size= positions.size(); - + //Assume position is somewhere near it was before int index= computeIndexInPositionList(positions, orderedByOffset ? position.offset : position.offset + position.length - 1, orderedByOffset); if (index < size && positions.get(index) is position) { positions.remove(index); return; } - + int back= index - 1; int forth= index + 1; while (back >= 0 || forth < size) { @@ -1217,7 +1217,7 @@ } back--; } - + if (forth < size) { if (position is positions.get(forth)) { positions.remove(forth); @@ -1305,7 +1305,7 @@ /** * {@inheritDoc} - * + * * @since 3.4 */ public bool isLineInformationRepairNeeded(int offset, int length, String text) { @@ -1328,7 +1328,7 @@ public void set(String text) { set(text, getNextModificationStamp()); } - + /* * @see dwtx.jface.text.IDocumentExtension4#set(java.lang.String, long) * @since 3.1 @@ -1523,7 +1523,7 @@ * @see dwtx.jface.text.IDocumentExtension3#computeZeroLengthPartitioning(java.lang.String, int, int) * @since 3.0 */ - public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, bool includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException { + public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, bool includeZeroLengthPartitions) { if ((0 > offset) || (0 > length) || (offset + length > getLength())) throw new BadLocationException(); @@ -1536,7 +1536,7 @@ checkStateOfPartitioner(partitioner, partitioning); return partitioner.computePartitioning(offset, length); } else if (DEFAULT_PARTITIONING.equals(partitioning)) - return new TypedRegion[] { new TypedRegion(offset, length, DEFAULT_CONTENT_TYPE) }; + return [ new TypedRegion(offset, length, DEFAULT_CONTENT_TYPE) ]; else throw new BadPartitioningException(); } @@ -1545,7 +1545,7 @@ * @see dwtx.jface.text.IDocumentExtension3#getZeroLengthContentType(java.lang.String, int) * @since 3.0 */ - public String getContentType(String partitioning, int offset, bool preferOpenPartitions) throws BadLocationException, BadPartitioningException { + public String getContentType(String partitioning, int offset, bool preferOpenPartitions) { if ((0 > offset) || (offset > getLength())) throw new BadLocationException(); @@ -1580,7 +1580,7 @@ if (partitioner !is null) return partitioner.getLegalContentTypes(); if (DEFAULT_PARTITIONING.equals(partitioning)) - return new String[] { DEFAULT_CONTENT_TYPE }; + return [ DEFAULT_CONTENT_TYPE ]; throw new BadPartitioningException(); } @@ -1588,7 +1588,7 @@ * @see dwtx.jface.text.IDocumentExtension3#getZeroLengthPartition(java.lang.String, int) * @since 3.0 */ - public ITypedRegion getPartition(String partitioning, int offset, bool preferOpenPartitions) throws BadLocationException, BadPartitioningException { + public ITypedRegion getPartition(String partitioning, int offset, bool preferOpenPartitions) { if ((0 > offset) || (offset > getLength())) throw new BadLocationException(); @@ -1682,8 +1682,8 @@ fDocumentRewriteSession= new DocumentRewriteSession(sessionType); - if cast(DEBUG) - System.out.println("AbstractDocument: Starting rewrite session: " + fDocumentRewriteSession); //$NON-NLS-1$ + if (DEBUG) + System.out_.println("AbstractDocument: Starting rewrite session: " + fDocumentRewriteSession); //$NON-NLS-1$ fireRewriteSessionChanged(new DocumentRewriteSessionEvent(this, fDocumentRewriteSession, DocumentRewriteSessionEvent.SESSION_START)); @@ -1729,8 +1729,8 @@ public void stopRewriteSession(DocumentRewriteSession session) { if (fDocumentRewriteSession is session) { - if cast(DEBUG) - System.out.println("AbstractDocument: Stopping rewrite session: " + session); //$NON-NLS-1$ + if (DEBUG) + System.out_.println("AbstractDocument: Stopping rewrite session: " + session); //$NON-NLS-1$ DocumentRewriteSessionType sessionType= session.getSessionType(); if (DocumentRewriteSessionType.SEQUENTIAL is sessionType || DocumentRewriteSessionType.STRICTLY_SEQUENTIAL is sessionType) @@ -1809,18 +1809,18 @@ if (session !is null) { extension.stopRewriteSession(session); - if cast(DEBUG) - System.out.println("AbstractDocument: Flushing rewrite session for partition type: " + partitioning); //$NON-NLS-1$ + if (DEBUG) + System.out_.println("AbstractDocument: Flushing rewrite session for partition type: " + partitioning); //$NON-NLS-1$ DocumentPartitioningChangedEvent event= new DocumentPartitioningChangedEvent(this); event.setPartitionChange(partitioning, 0, getLength()); fireDocumentPartitioningChanged(event); } } - + /** * Returns all positions of the given category that are inside the given region. - * + * * @param category the position category * @param offset the start position of the region, must be >= 0 * @param length the length of the region, must be >= 0 @@ -1844,18 +1844,18 @@ } else { documentPositions= getStartingPositions(category, offset, length); } - + ArrayList list= new ArrayList(documentPositions.size()); - + Position region= new Position(offset, length); - + for (Iterator iterator= documentPositions.iterator(); iterator.hasNext();) { Position position= cast(Position) iterator.next(); if (isWithinRegion(region, position, canStartBefore, canEndAfter)) { list.add(position); } } - + Position[] positions= new Position[list.size()]; list.toArray(positions); return positions; @@ -1866,14 +1866,14 @@ return positions; } else { Assert.isLegal(canEndAfter && !canStartBefore); - + List list= getStartingPositions(category, offset, length); Position[] positions= new Position[list.size()]; list.toArray(positions); return positions; } } - + /* * @since 3.4 */ @@ -1889,11 +1889,11 @@ return region.includes(start) && region.includes(start + position.getLength() - 1); } } - + /** * A list of positions in the given category with an offset inside the given * region. The order of the positions is arbitrary. - * + * * @param category the position category * @param offset the offset of the region * @param length the length of the region @@ -1905,17 +1905,17 @@ List positions= cast(List) fPositions.get(category); if (positions is null) throw new BadPositionCategoryException(); - + int indexStart= computeIndexInPositionList(positions, offset, true); int indexEnd= computeIndexInPositionList(positions, offset + length, true); - + return positions.subList(indexStart, indexEnd); } /** * A list of positions in the given category with an end position inside * the given region. The order of the positions is arbitrary. - * + * * @param category the position category * @param offset the offset of the region * @param length the length of the region @@ -1927,10 +1927,10 @@ List positions= cast(List) fEndPositions.get(category); if (positions is null) throw new BadPositionCategoryException(); - + int indexStart= computeIndexInPositionList(positions, offset, false); int indexEnd= computeIndexInPositionList(positions, offset + length, false); - + return positions.subList(indexStart, indexEnd); }