diff options
Diffstat (limited to 'org.eclipse.text')
61 files changed, 494 insertions, 928 deletions
diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocument.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocument.java index c88e59e3567..f92da76b972 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocument.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocument.java @@ -50,6 +50,7 @@ public class ChildDocument extends ProjectionDocument { * * @see org.eclipse.jface.text.Position#overlapsWith(int, int) */ + @Override public boolean overlapsWith(int regionOffset, int regionLength) { boolean appending= (regionOffset == offset + length) && regionLength == 0; return appending || super.overlapsWith(regionOffset, regionLength); diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocumentManager.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocumentManager.java index c844eeb7128..443d64e3b0e 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocumentManager.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ChildDocumentManager.java @@ -27,9 +27,7 @@ import org.eclipse.jface.text.IDocument; */ public class ChildDocumentManager extends ProjectionDocumentManager { - /* - * @see org.eclipse.jface.text.projection.ProjectionDocumentManager#createProjectionDocument(org.eclipse.jface.text.IDocument) - */ + @Override protected ProjectionDocument createProjectionDocument(IDocument master) { return new ChildDocument(master); } diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/FragmentUpdater.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/FragmentUpdater.java index bc441e287e9..cf591448bb1 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/FragmentUpdater.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/FragmentUpdater.java @@ -41,9 +41,7 @@ class FragmentUpdater extends DefaultPositionUpdater { super(fragmentCategory); } - /* - * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void update(DocumentEvent event) { try { @@ -72,9 +70,7 @@ class FragmentUpdater extends DefaultPositionUpdater { } } - /* - * @see org.eclipse.jface.text.DefaultPositionUpdater#adaptToInsert() - */ + @Override protected void adaptToInsert() { int myStart= fPosition.offset; int myEnd= Math.max(myStart, fPosition.offset + fPosition.length - (fIsLast || isAffectingReplace() ? 0 : 1)); diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java index 0fe28d233ef..7b3b6d0453f 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocument.java @@ -187,6 +187,7 @@ public class ProjectionDocument extends AbstractDocument { * @return the projection mapping used by this document * @deprecated As of 3.4, replaced by {@link #getDocumentInformationMapping()} */ + @Deprecated public ProjectionMapping getProjectionMapping(){ return fMapping; } @@ -210,10 +211,7 @@ public class ProjectionDocument extends AbstractDocument { return fMasterDocument; } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#getDefaultLineDelimiter() - * @since 3.1 - */ + @Override public String getDefaultLineDelimiter() { return TextUtilities.getDefaultLineDelimiter(fMasterDocument); } @@ -618,9 +616,7 @@ public class ProjectionDocument extends AbstractDocument { return fIsUpdating; } - /* - * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) throws BadLocationException { try { fIsUpdating= true; @@ -634,9 +630,7 @@ public class ProjectionDocument extends AbstractDocument { } } - /* - * @see org.eclipse.jface.text.IDocument#set(java.lang.String) - */ + @Override public void set(String text) { try { fIsUpdating= true; @@ -752,9 +746,7 @@ public class ProjectionDocument extends AbstractDocument { } } - /* - * @see org.eclipse.jface.text.AbstractDocument#fireDocumentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ + @Override protected void fireDocumentAboutToBeChanged(DocumentEvent event) { fOriginalEvent= event; // delay it until there is a notification from the master document @@ -773,13 +765,12 @@ public class ProjectionDocument extends AbstractDocument { * * @param event the event to be ignored */ + @Override protected void fireDocumentChanged(DocumentEvent event) { super.fireDocumentChanged(fSlaveEvent); } - /* - * @see org.eclipse.jface.text.AbstractDocument#updateDocumentStructures(org.eclipse.jface.text.DocumentEvent) - */ + @Override protected void updateDocumentStructures(DocumentEvent event) { super.updateDocumentStructures(event); ensureWellFormedSegmentation(computeAnchor(event)); @@ -846,9 +837,7 @@ public class ProjectionDocument extends AbstractDocument { return changed; } - /* - * @see IDocumentExtension#registerPostNotificationReplace(IDocumentListener, IDocumentExtension.IReplace) - */ + @Override public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) { if (!isUpdating()) throw new UnsupportedOperationException(); diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java index 4f3cde301ec..9d154107510 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionDocumentManager.java @@ -124,23 +124,17 @@ public class ProjectionDocumentManager implements IDocumentListener, ISlaveDocum } } - /* - * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void documentChanged(DocumentEvent event) { fireDocumentEvent(false, event); } - /* - * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void documentAboutToBeChanged(DocumentEvent event) { fireDocumentEvent(true, event); } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#createMasterSlaveMapping(org.eclipse.jface.text.IDocument) - */ + @Override public IDocumentInformationMapping createMasterSlaveMapping(IDocument slave) { if (slave instanceof ProjectionDocument) { ProjectionDocument projectionDocument= (ProjectionDocument) slave; @@ -149,9 +143,7 @@ public class ProjectionDocumentManager implements IDocumentListener, ISlaveDocum return null; } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#createSlaveDocument(org.eclipse.jface.text.IDocument) - */ + @Override public IDocument createSlaveDocument(IDocument master) { if (!hasProjection(master)) master.addDocumentListener(this); @@ -170,9 +162,7 @@ public class ProjectionDocumentManager implements IDocumentListener, ISlaveDocum return new ProjectionDocument(master); } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#freeSlaveDocument(org.eclipse.jface.text.IDocument) - */ + @Override public void freeSlaveDocument(IDocument slave) { if (slave instanceof ProjectionDocument) { ProjectionDocument projectionDocument= (ProjectionDocument) slave; @@ -184,33 +174,25 @@ public class ProjectionDocumentManager implements IDocumentListener, ISlaveDocum } } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#getMasterDocument(org.eclipse.jface.text.IDocument) - */ + @Override public IDocument getMasterDocument(IDocument slave) { if (slave instanceof ProjectionDocument) return ((ProjectionDocument) slave).getMasterDocument(); return null; } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#isSlaveDocument(org.eclipse.jface.text.IDocument) - */ + @Override public boolean isSlaveDocument(IDocument document) { return (document instanceof ProjectionDocument); } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManager#setAutoExpandMode(org.eclipse.jface.text.IDocument, boolean) - */ + @Override public void setAutoExpandMode(IDocument slave, boolean autoExpanding) { if (slave instanceof ProjectionDocument) ((ProjectionDocument) slave).setAutoExpandMode(autoExpanding); } - /* - * @see org.eclipse.jface.text.ISlaveDocumentManagerExtension#getSlaveDocuments(org.eclipse.jface.text.IDocument) - */ + @Override public IDocument[] getSlaveDocuments(IDocument master) { List list= (List) fProjectionRegistry.get(master); if (list != null) { diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionMapping.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionMapping.java index a162d298aca..81d788dfaff 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionMapping.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionMapping.java @@ -355,9 +355,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return new Region(offset, exclusiveEndOffset - offset); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#getCoverage() - */ + @Override public IRegion getCoverage() { Position[] fragments= getFragments(); if (fragments != null && fragments.length > 0) { @@ -368,18 +366,14 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return new Region(0, 0); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toOriginOffset(int) - */ + @Override public int toOriginOffset(int imageOffset) throws BadLocationException { Segment segment= findSegment(imageOffset); int relative= imageOffset - segment.offset; return segment.fragment.offset + relative; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toOriginRegion(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion toOriginRegion(IRegion imageRegion) throws BadLocationException { int imageOffset= imageRegion.getOffset(); int imageLength= imageRegion.getLength(); @@ -400,9 +394,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return new Region(originOffset, (inclusiveOriginEndOffset + 1) - originOffset); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toOriginLines(int) - */ + @Override public IRegion toOriginLines(int imageLine) throws BadLocationException { IRegion imageRegion= fSlaveDocument.getLineInformation(imageLine); IRegion originRegion= toOriginRegion(imageRegion); @@ -415,17 +407,13 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return new Region(originStartLine, (originEndLine + 1) - originStartLine); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toOriginLine(int) - */ + @Override public int toOriginLine(int imageLine) throws BadLocationException { IRegion lines= toOriginLines(imageLine); return (lines.getLength() > 1 ? -1 : lines.getOffset()); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toImageOffset(int) - */ + @Override public int toImageOffset(int originOffset) throws BadLocationException { Fragment fragment= findFragment(originOffset); if (fragment != null) { @@ -435,31 +423,22 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return -1; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension#toExactImageRegion(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException { return toImageRegion(originRegion, true, false); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toImageRegion(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion toImageRegion(IRegion originRegion) throws BadLocationException { return toImageRegion(originRegion, false, false); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension2#toClosestImageRegion(org.eclipse.jface.text.IRegion) - * @since 3.1 - */ + @Override public IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException { return toImageRegion(originRegion, false, true); } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toImageLine(int) - */ + @Override public int toImageLine(int originLine) throws BadLocationException { IRegion originRegion= fMasterDocument.getLineInformation(originLine); IRegion imageRegion= toImageRegion(originRegion); @@ -482,9 +461,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return startLine; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMapping#toClosestImageLine(int) - */ + @Override public int toClosestImageLine(int originLine) throws BadLocationException { try { @@ -526,9 +503,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return -1; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension#toExactOriginRegions(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException { if (imageRegion.getLength() == 0) @@ -566,9 +541,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return result; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension#getImageLength() - */ + @Override public int getImageLength() { Position[] segments= getSegments(); int length= 0; @@ -577,9 +550,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return length; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension#toExactImageRegions(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException { int offset= originRegion.getOffset(); @@ -622,9 +593,7 @@ public class ProjectionMapping implements IDocumentInformationMapping , IDocumen return result; } - /* - * @see org.eclipse.jface.text.IDocumentInformationMappingExtension#getExactCoverage(org.eclipse.jface.text.IRegion) - */ + @Override public IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException { int originOffset= originRegion.getOffset(); diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionTextStore.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionTextStore.java index 516c2b4fba3..f593e30b973 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionTextStore.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/ProjectionTextStore.java @@ -35,16 +35,12 @@ class ProjectionTextStore implements ITextStore { private int fOffset; private int fLength; - /* - * @see org.eclipse.jface.text.IRegion#getLength() - */ + @Override public int getLength() { return fLength; } - /* - * @see org.eclipse.jface.text.IRegion#getOffset() - */ + @Override public int getOffset() { return fOffset; } @@ -85,9 +81,7 @@ class ProjectionTextStore implements ITextStore { throw new IllegalStateException(); } - /* - * @see org.eclipse.jface.text.ITextStore#set(java.lang.String) - */ + @Override public void set(String contents) { IRegion masterRegion= fMapping.getCoverage(); @@ -101,9 +95,7 @@ class ProjectionTextStore implements ITextStore { } } - /* - * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) { fReusableRegion.update(offset, length); try { @@ -114,16 +106,12 @@ class ProjectionTextStore implements ITextStore { } } - /* - * @see org.eclipse.jface.text.ITextStore#getLength() - */ + @Override public int getLength() { return fMapping.getImageLength(); } - /* - * @see org.eclipse.jface.text.ITextStore#get(int) - */ + @Override public char get(int offset) { try { int originOffset= fMapping.toOriginOffset(offset); @@ -136,9 +124,7 @@ class ProjectionTextStore implements ITextStore { return (char) 0; } - /* - * @see ITextStore#get(int, int) - */ + @Override public String get(int offset, int length) { try { IRegion[] fragments= fMapping.toExactOriginRegions(new Region(offset, length)); diff --git a/org.eclipse.text/projection/org/eclipse/jface/text/projection/SegmentUpdater.java b/org.eclipse.text/projection/org/eclipse/jface/text/projection/SegmentUpdater.java index 16146b1680c..e388bdac2e2 100644 --- a/org.eclipse.text/projection/org/eclipse/jface/text/projection/SegmentUpdater.java +++ b/org.eclipse.text/projection/org/eclipse/jface/text/projection/SegmentUpdater.java @@ -42,9 +42,7 @@ class SegmentUpdater extends DefaultPositionUpdater { super(segmentCategory); } - /* - * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void update(DocumentEvent event) { Assert.isTrue(event instanceof ProjectionDocumentEvent); @@ -82,9 +80,7 @@ class SegmentUpdater extends DefaultPositionUpdater { } } - /* - * @see org.eclipse.jface.text.DefaultPositionUpdater#adaptToInsert() - */ + @Override protected void adaptToInsert() { Segment segment= (Segment) fPosition; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java index a4e5095b579..ba2fe5ac7d2 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractDocument.java @@ -238,9 +238,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return fPositions; } - /* - * @see org.eclipse.jface.text.IDocument#getDocumentPartitioner() - */ + @Override public IDocumentPartitioner getDocumentPartitioner() { return getDocumentPartitioner(DEFAULT_PARTITIONING); } @@ -269,9 +267,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, fTracker= tracker; } - /* - * @see org.eclipse.jface.text.IDocument#setDocumentPartitioner(org.eclipse.jface.text.IDocumentPartitioner) - */ + @Override public void setDocumentPartitioner(IDocumentPartitioner partitioner) { setDocumentPartitioner(DEFAULT_PARTITIONING, partitioner); } @@ -298,57 +294,43 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, //------------------------------------------------------- - /* - * @see org.eclipse.jface.text.IDocument#addDocumentListener(org.eclipse.jface.text.IDocumentListener) - */ + @Override public void addDocumentListener(IDocumentListener listener) { Assert.isNotNull(listener); fDocumentListeners.add(listener); } - /* - * @see org.eclipse.jface.text.IDocument#removeDocumentListener(org.eclipse.jface.text.IDocumentListener) - */ + @Override public void removeDocumentListener(IDocumentListener listener) { Assert.isNotNull(listener); fDocumentListeners.remove(listener); } - /* - * @see org.eclipse.jface.text.IDocument#addPrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener) - */ + @Override public void addPrenotifiedDocumentListener(IDocumentListener listener) { Assert.isNotNull(listener); fPrenotifiedDocumentListeners.add(listener); } - /* - * @see org.eclipse.jface.text.IDocument#removePrenotifiedDocumentListener(org.eclipse.jface.text.IDocumentListener) - */ + @Override public void removePrenotifiedDocumentListener(IDocumentListener listener) { Assert.isNotNull(listener); fPrenotifiedDocumentListeners.remove(listener); } - /* - * @see org.eclipse.jface.text.IDocument#addDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener) - */ + @Override public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) { Assert.isNotNull(listener); fDocumentPartitioningListeners.add(listener); } - /* - * @see org.eclipse.jface.text.IDocument#removeDocumentPartitioningListener(org.eclipse.jface.text.IDocumentPartitioningListener) - */ + @Override public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) { Assert.isNotNull(listener); fDocumentPartitioningListeners.remove(listener); } - /* - * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position) - */ + @Override public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException { if ((0 > position.offset) || (0 > position.length) || (position.offset + position.length > getLength())) @@ -368,9 +350,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, endPositions.add(computeIndexInPositionList(endPositions, position.offset + position.length - 1, false), position); } - /* - * @see org.eclipse.jface.text.IDocument#addPosition(org.eclipse.jface.text.Position) - */ + @Override public void addPosition(Position position) throws BadLocationException { try { addPosition(DEFAULT_CATEGORY, position); @@ -378,9 +358,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocument#addPositionCategory(java.lang.String) - */ + @Override public void addPositionCategory(String category) { if (category == null) @@ -392,16 +370,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocument#addPositionUpdater(org.eclipse.jface.text.IPositionUpdater) - */ + @Override public void addPositionUpdater(IPositionUpdater updater) { insertPositionUpdater(updater, fPositionUpdaters.size()); } - /* - * @see org.eclipse.jface.text.IDocument#containsPosition(java.lang.String, int, int) - */ + @Override public boolean containsPosition(String category, int offset, int length) { if (category == null) @@ -429,9 +403,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return false; } - /* - * @see org.eclipse.jface.text.IDocument#containsPositionCategory(java.lang.String) - */ + @Override public boolean containsPositionCategory(String category) { if (category != null) return fPositions.containsKey(category); @@ -451,6 +423,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @see IDocument#computeIndexInCategory(String, int) * @deprecated As of 3.4, replaced by {@link #computeIndexInPositionList(List, int, boolean)} */ + @Deprecated protected int computeIndexInPositionList(List positions, int offset) { return computeIndexInPositionList(positions, offset, true); } @@ -529,9 +502,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return position.getOffset() + position.getLength() - 1; } - /* - * @see org.eclipse.jface.text.IDocument#computeIndexInCategory(java.lang.String, int) - */ + @Override public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException { if (0 > offset || offset > getLength()) @@ -550,6 +521,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * * @deprecated as of 2.0. Use <code>fireDocumentPartitioningChanged(IRegion)</code> instead. */ + @Deprecated protected void fireDocumentPartitioningChanged() { if (fDocumentPartitioningListeners == null) return; @@ -571,6 +543,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * <code>fireDocumentPartitioningChanged(DocumentPartitioningChangedEvent)</code> * instead. */ + @Deprecated protected void fireDocumentPartitioningChanged(IRegion region) { if (fDocumentPartitioningListeners == null) return; @@ -732,6 +705,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @since 2.0 * @deprecated as of 3.0. Use <code>doFireDocumentChanged2(DocumentEvent)</code> instead; this method will be removed. */ + @Deprecated protected void doFireDocumentChanged(DocumentEvent event, boolean firePartitionChange, IRegion partitionChange) { doFireDocumentChanged2(event); } @@ -798,18 +772,14 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, fDeferredDocumentEvent= event; } - /* - * @see org.eclipse.jface.text.IDocument#getChar(int) - */ + @Override public char getChar(int pos) throws BadLocationException { if ((0 > pos) || (pos >= getLength())) throw new BadLocationException(); return getStore().get(pos); } - /* - * @see org.eclipse.jface.text.IDocument#getContentType(int) - */ + @Override public String getContentType(int offset) throws BadLocationException { String contentType= null; try { @@ -821,9 +791,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return contentType; } - /* - * @see org.eclipse.jface.text.IDocument#getLegalContentTypes() - */ + @Override public String[] getLegalContentTypes() { String[] contentTypes= null; try { @@ -835,31 +803,22 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return contentTypes; } - /* - * @see org.eclipse.jface.text.IDocument#getLength() - */ + @Override public int getLength() { return getStore().getLength(); } - /* - * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int) - */ + @Override public String getLineDelimiter(int line) throws BadLocationException { return getTracker().getLineDelimiter(line); } - /* - * @see org.eclipse.jface.text.IDocument#getLegalLineDelimiters() - */ + @Override public String[] getLegalLineDelimiters() { return getTracker().getLegalLineDelimiters(); } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#getDefaultLineDelimiter() - * @since 3.1 - */ + @Override public String getDefaultLineDelimiter() { String lineDelimiter= null; @@ -892,74 +851,53 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#setInitialLineDelimiter(java.lang.String) - * @since 3.1 - */ + @Override public void setInitialLineDelimiter(String lineDelimiter) { Assert.isNotNull(lineDelimiter); fInitialLineDelimiter= lineDelimiter; } - /* - * @see org.eclipse.jface.text.IDocument#getLineLength(int) - */ + @Override public int getLineLength(int line) throws BadLocationException { return getTracker().getLineLength(line); } - /* - * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int) - */ + @Override public int getLineOfOffset(int pos) throws BadLocationException { return getTracker().getLineNumberOfOffset(pos); } - /* - * @see org.eclipse.jface.text.IDocument#getLineOffset(int) - */ + @Override public int getLineOffset(int line) throws BadLocationException { return getTracker().getLineOffset(line); } - /* - * @see org.eclipse.jface.text.IDocument#getLineInformation(int) - */ + @Override public IRegion getLineInformation(int line) throws BadLocationException { return getTracker().getLineInformation(line); } - /* - * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int) - */ + @Override public IRegion getLineInformationOfOffset(int offset) throws BadLocationException { return getTracker().getLineInformationOfOffset(offset); } - /* - * @see org.eclipse.jface.text.IDocument#getNumberOfLines() - */ + @Override public int getNumberOfLines() { return getTracker().getNumberOfLines(); } - /* - * @see org.eclipse.jface.text.IDocument#getNumberOfLines(int, int) - */ + @Override public int getNumberOfLines(int offset, int length) throws BadLocationException { return getTracker().getNumberOfLines(offset, length); } - /* - * @see org.eclipse.jface.text.IDocument#computeNumberOfLines(java.lang.String) - */ + @Override public int computeNumberOfLines(String text) { return getTracker().computeNumberOfLines(text); } - /* - * @see org.eclipse.jface.text.IDocument#getPartition(int) - */ + @Override public ITypedRegion getPartition(int offset) throws BadLocationException { ITypedRegion partition= null; try { @@ -971,9 +909,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return partition; } - /* - * @see org.eclipse.jface.text.IDocument#computePartitioning(int, int) - */ + @Override public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException { ITypedRegion[] partitioning= null; try { @@ -985,9 +921,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return partitioning; } - /* - * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String) - */ + @Override public Position[] getPositions(String category) throws BadPositionCategoryException { if (category == null) @@ -1002,9 +936,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return positions; } - /* - * @see org.eclipse.jface.text.IDocument#getPositionCategories() - */ + @Override public String[] getPositionCategories() { String[] categories= new String[fPositions.size()]; Iterator keys= fPositions.keySet().iterator(); @@ -1013,25 +945,19 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return categories; } - /* - * @see org.eclipse.jface.text.IDocument#getPositionUpdaters() - */ + @Override public IPositionUpdater[] getPositionUpdaters() { IPositionUpdater[] updaters= new IPositionUpdater[fPositionUpdaters.size()]; fPositionUpdaters.toArray(updaters); return updaters; } - /* - * @see org.eclipse.jface.text.IDocument#get() - */ + @Override public String get() { return getStore().get(0, getLength()); } - /* - * @see org.eclipse.jface.text.IDocument#get(int, int) - */ + @Override public String get(int pos, int length) throws BadLocationException { int myLength= getLength(); if ((0 > pos) || (0 > length) || (pos + length > myLength)) @@ -1039,9 +965,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return getStore().get(pos, length); } - /* - * @see org.eclipse.jface.text.IDocument#insertPositionUpdater(org.eclipse.jface.text.IPositionUpdater, int) - */ + @Override public void insertPositionUpdater(IPositionUpdater updater, int index) { for (int i= fPositionUpdaters.size() - 1; i >= 0; i--) { @@ -1055,9 +979,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, fPositionUpdaters.add(index, updater); } - /* - * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position) - */ + @Override public void removePosition(String category, Position position) throws BadPositionCategoryException { if (position == null) @@ -1116,9 +1038,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocument#removePosition(org.eclipse.jface.text.Position) - */ + @Override public void removePosition(Position position) { try { removePosition(DEFAULT_CATEGORY, position); @@ -1126,9 +1046,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocument#removePositionCategory(java.lang.String) - */ + @Override public void removePositionCategory(String category) throws BadPositionCategoryException { if (category == null) @@ -1141,9 +1059,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, fEndPositions.remove(category); } - /* - * @see org.eclipse.jface.text.IDocument#removePositionUpdater(org.eclipse.jface.text.IPositionUpdater) - */ + @Override public void removePositionUpdater(IPositionUpdater updater) { for (int i= fPositionUpdaters.size() - 1; i >= 0; i--) { if (fPositionUpdaters.get(i) == updater) { @@ -1162,18 +1078,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return fNextModificationStamp; } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#getModificationStamp() - * @since 3.1 - */ + @Override public long getModificationStamp() { return fModificationStamp; } - /* - * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String) - * @since 3.1 - */ + @Override public void replace(int pos, int length, String text, long modificationStamp) throws BadLocationException { if ((0 > pos) || (0 > length) || (pos + length > getLength())) throw new BadLocationException(); @@ -1196,13 +1106,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * * @since 3.4 */ + @Override public boolean isLineInformationRepairNeeded(int offset, int length, String text) throws BadLocationException { return false; } - /* - * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String) - */ + @Override public void replace(int pos, int length, String text) throws BadLocationException { if (length == 0 && (text == null || text.length() == 0)) replace(pos, length, text, getModificationStamp()); @@ -1210,17 +1119,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, replace(pos, length, text, getNextModificationStamp()); } - /* - * @see org.eclipse.jface.text.IDocument#set(java.lang.String) - */ + @Override public void set(String text) { set(text, getNextModificationStamp()); } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#set(java.lang.String, long) - * @since 3.1 - */ + @Override public void set(String text, long modificationStamp) { int length= getStore().getLength(); @@ -1259,6 +1163,8 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * * @deprecated as of 3.0 search is provided by {@link FindReplaceDocumentAdapter} */ + @Deprecated + @Override public int search(int startPosition, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException { try { IRegion region= getFindReplaceDocumentAdapter().find(startPosition, findString, forwardSearch, caseSensitive, wholeWord, false); @@ -1316,26 +1222,17 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension2#acceptPostNotificationReplaces() - * @since 2.1 - */ + @Override public void acceptPostNotificationReplaces() { fAcceptPostNotificationReplaces= true; } - /* - * @see org.eclipse.jface.text.IDocumentExtension2#ignorePostNotificationReplaces() - * @since 2.1 - */ + @Override public void ignorePostNotificationReplaces() { fAcceptPostNotificationReplaces= false; } - /* - * @see org.eclipse.jface.text.IDocumentExtension#registerPostNotificationReplace(org.eclipse.jface.text.IDocumentListener, org.eclipse.jface.text.IDocumentExtension.IReplace) - * @since 2.0 - */ + @Override public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace) { if (fAcceptPostNotificationReplaces) { if (fPostNotificationChanges == null) @@ -1344,18 +1241,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension#stopPostNotificationProcessing() - * @since 2.0 - */ + @Override public void stopPostNotificationProcessing() { ++ fStoppedCount; } - /* - * @see org.eclipse.jface.text.IDocumentExtension#resumePostNotificationProcessing() - * @since 2.0 - */ + @Override public void resumePostNotificationProcessing() { -- fStoppedCount; if (fStoppedCount == 0 && fReentranceCount == 0) @@ -1370,6 +1261,8 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * {@link IDocumentExtension4#startRewriteSession(DocumentRewriteSessionType)} * instead. */ + @Deprecated + @Override public void startSequentialRewrite(boolean normalized) { } @@ -1379,13 +1272,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @since 2.0 * @deprecated As of 3.1, replaced by {@link IDocumentExtension4#stopRewriteSession(DocumentRewriteSession)} */ + @Deprecated + @Override public void stopSequentialRewrite() { } - /* - * @see org.eclipse.jface.text.IDocumentExtension2#resumeListenerNotification() - * @since 2.1 - */ + @Override public void resumeListenerNotification() { -- fStoppedListenerNotification; if (fStoppedListenerNotification == 0) { @@ -1393,10 +1285,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension2#stopListenerNotification() - * @since 2.1 - */ + @Override public void stopListenerNotification() { ++ fStoppedListenerNotification; } @@ -1419,6 +1308,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @see org.eclipse.jface.text.IDocumentExtension3#computeZeroLengthPartitioning(java.lang.String, int, int) * @since 3.0 */ + @Override public ITypedRegion[] computePartitioning(String partitioning, int offset, int length, boolean includeZeroLengthPartitions) throws BadLocationException, BadPartitioningException { if ((0 > offset) || (0 > length) || (offset + length > getLength())) throw new BadLocationException(); @@ -1441,6 +1331,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @see org.eclipse.jface.text.IDocumentExtension3#getZeroLengthContentType(java.lang.String, int) * @since 3.0 */ + @Override public String getContentType(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException { if ((0 > offset) || (offset > getLength())) throw new BadLocationException(); @@ -1459,18 +1350,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, throw new BadPartitioningException(); } - /* - * @see org.eclipse.jface.text.IDocumentExtension3#getDocumentPartitioner(java.lang.String) - * @since 3.0 - */ + @Override public IDocumentPartitioner getDocumentPartitioner(String partitioning) { return fDocumentPartitioners != null ? (IDocumentPartitioner) fDocumentPartitioners.get(partitioning) : null; } - /* - * @see org.eclipse.jface.text.IDocumentExtension3#getLegalContentTypes(java.lang.String) - * @since 3.0 - */ + @Override public String[] getLegalContentTypes(String partitioning) throws BadPartitioningException { IDocumentPartitioner partitioner= getDocumentPartitioner(partitioning); if (partitioner != null) @@ -1484,6 +1369,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, * @see org.eclipse.jface.text.IDocumentExtension3#getZeroLengthPartition(java.lang.String, int) * @since 3.0 */ + @Override public ITypedRegion getPartition(String partitioning, int offset, boolean preferOpenPartitions) throws BadLocationException, BadPartitioningException { if ((0 > offset) || (offset > getLength())) throw new BadLocationException(); @@ -1502,10 +1388,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, throw new BadPartitioningException(); } - /* - * @see org.eclipse.jface.text.IDocumentExtension3#getPartitionings() - * @since 3.0 - */ + @Override public String[] getPartitionings() { if (fDocumentPartitioners == null) return new String[0]; @@ -1514,10 +1397,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, return partitionings; } - /* - * @see org.eclipse.jface.text.IDocumentExtension3#setDocumentPartitioner(java.lang.String, org.eclipse.jface.text.IDocumentPartitioner) - * @since 3.0 - */ + @Override public void setDocumentPartitioner(String partitioning, IDocumentPartitioner partitioner) { if (partitioner == null) { if (fDocumentPartitioners != null) { @@ -1535,10 +1415,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, fireDocumentPartitioningChanged(event); } - /* - * @see org.eclipse.jface.text.IRepairableDocument#repairLineInformation() - * @since 3.0 - */ + @Override public void repairLineInformation() { getTracker().set(get()); } @@ -1564,17 +1441,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#getActiveRewriteSession() - */ + @Override public final DocumentRewriteSession getActiveRewriteSession() { return fDocumentRewriteSession; } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#startRewriteSession(org.eclipse.jface.text.DocumentRewriteSessionType) - * @since 3.1 - */ + @Override public DocumentRewriteSession startRewriteSession(DocumentRewriteSessionType sessionType) { if (getActiveRewriteSession() != null) @@ -1622,10 +1494,7 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#stopRewriteSession(org.eclipse.jface.text.DocumentRewriteSession) - * @since 3.1 - */ + @Override public void stopRewriteSession(DocumentRewriteSession session) { if (fDocumentRewriteSession == session) { @@ -1673,20 +1542,14 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, } } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#addDocumentRewriteSessionListener(org.eclipse.jface.text.IDocumentRewriteSessionListener) - * @since 3.1 - */ + @Override public void addDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener) { Assert.isNotNull(listener); if (! fDocumentRewriteSessionListeners.contains(listener)) fDocumentRewriteSessionListeners.add(listener); } - /* - * @see org.eclipse.jface.text.IDocumentExtension4#removeDocumentRewriteSessionListener(org.eclipse.jface.text.IDocumentRewriteSessionListener) - * @since 3.1 - */ + @Override public void removeDocumentRewriteSessionListener(IDocumentRewriteSessionListener listener) { Assert.isNotNull(listener); fDocumentRewriteSessionListeners.remove(listener); @@ -1842,10 +1705,12 @@ public abstract class AbstractDocument implements IDocument, IDocumentExtension, */ private static void log(final Exception ex) { SafeRunner.run(new ISafeRunnable() { + @Override public void run() throws Exception { throw ex; } + @Override public void handleException(Throwable exception) { // NOTE: Logging is done by SafeRunner } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java index 86a80ef9fcc..ba4f3ac17a3 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/AbstractLineTracker.java @@ -95,10 +95,12 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE * @since 3.2 */ private ILineTracker fDelegate= new ListLineTracker() { + @Override public String[] getLegalLineDelimiters() { return AbstractLineTracker.this.getLegalLineDelimiters(); } + @Override protected DelimiterInfo nextDelimiterInfo(String text, int offset) { return AbstractLineTracker.this.nextDelimiterInfo(text, offset); } @@ -114,64 +116,48 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE protected AbstractLineTracker() { } - /* - * @see org.eclipse.jface.text.ILineTracker#computeNumberOfLines(java.lang.String) - */ + @Override public int computeNumberOfLines(String text) { return fDelegate.computeNumberOfLines(text); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineDelimiter(int) - */ + @Override public String getLineDelimiter(int line) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineDelimiter(line); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformation(int) - */ + @Override public IRegion getLineInformation(int line) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineInformation(line); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int) - */ + @Override public IRegion getLineInformationOfOffset(int offset) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineInformationOfOffset(offset); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineLength(int) - */ + @Override public int getLineLength(int line) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineLength(line); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineNumberOfOffset(int) - */ + @Override public int getLineNumberOfOffset(int offset) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineNumberOfOffset(offset); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineOffset(int) - */ + @Override public int getLineOffset(int line) throws BadLocationException { checkRewriteSession(); return fDelegate.getLineOffset(line); } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines() - */ + @Override public int getNumberOfLines() { try { checkRewriteSession(); @@ -181,17 +167,13 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE return fDelegate.getNumberOfLines(); } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines(int, int) - */ + @Override public int getNumberOfLines(int offset, int length) throws BadLocationException { checkRewriteSession(); return fDelegate.getNumberOfLines(offset, length); } - /* - * @see org.eclipse.jface.text.ILineTracker#set(java.lang.String) - */ + @Override public void set(String text) { if (hasActiveRewriteSession()) { fPendingRequests.clear(); @@ -202,9 +184,7 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE fDelegate.set(text); } - /* - * @see org.eclipse.jface.text.ILineTracker#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) throws BadLocationException { if (hasActiveRewriteSession()) { fPendingRequests.add(new Request(offset, length, text)); @@ -225,10 +205,12 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE if (fNeedsConversion) { fNeedsConversion= false; fDelegate= new TreeLineTracker((ListLineTracker) fDelegate) { + @Override protected DelimiterInfo nextDelimiterInfo(String text, int offset) { return AbstractLineTracker.this.nextDelimiterInfo(text, offset); } + @Override public String[] getLegalLineDelimiters() { return AbstractLineTracker.this.getLegalLineDelimiters(); } @@ -246,10 +228,7 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE */ protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset); - /* - * @see org.eclipse.jface.text.ILineTrackerExtension#startRewriteSession(org.eclipse.jface.text.DocumentRewriteSession) - * @since 3.1 - */ + @Override public final void startRewriteSession(DocumentRewriteSession session) { if (fActiveRewriteSession != null) throw new IllegalStateException(); @@ -257,10 +236,7 @@ public abstract class AbstractLineTracker implements ILineTracker, ILineTrackerE fPendingRequests= new ArrayList(20); } - /* - * @see org.eclipse.jface.text.ILineTrackerExtension#stopRewriteSession(org.eclipse.jface.text.DocumentRewriteSession, java.lang.String) - * @since 3.1 - */ + @Override public final void stopRewriteSession(DocumentRewriteSession session, String text) { if (fActiveRewriteSession == session) { fActiveRewriteSession= null; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Assert.java b/org.eclipse.text/src/org/eclipse/jface/text/Assert.java index da5e9d6dca7..e75ce25d9f7 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/Assert.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/Assert.java @@ -31,6 +31,7 @@ package org.eclipse.jface.text; * @deprecated As of 3.3, replaced by {@link org.eclipse.core.runtime.Assert} * @noinstantiate This class is not intended to be instantiated by clients. */ +@Deprecated public final class Assert { /** diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java index 3310baced21..88a7b7c2477 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/ConfigurableLineTracker.java @@ -46,16 +46,12 @@ public class ConfigurableLineTracker extends AbstractLineTracker { fDelimiters= TextUtilities.copy(legalLineDelimiters); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLegalLineDelimiters() - */ + @Override public String[] getLegalLineDelimiters() { return TextUtilities.copy(fDelimiters); } - /* - * @see org.eclipse.jface.text.AbstractLineTracker#nextDelimiterInfo(java.lang.String, int) - */ + @Override protected DelimiterInfo nextDelimiterInfo(String text, int offset) { if (fDelimiters.length > 1) { int[] info= TextUtilities.indexOf(fDelimiters, text, offset); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java index 002b907149a..12d1bbf5627 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/CopyOnWriteTextStore.java @@ -63,16 +63,12 @@ public class CopyOnWriteTextStore implements ITextStore { fCopyLimit= fText.length() > SMALL_TEXT_LIMIT ? fText.length() / 2 : 0; } - /* - * @see org.eclipse.jface.text.ITextStore#get(int) - */ + @Override public char get(int offset) { return fText.charAt(offset); } - /* - * @see org.eclipse.jface.text.ITextStore#get(int, int) - */ + @Override public String get(int offset, int length) { if (length < fCopyLimit) { // create a copy to avoid sharing of contained char[] - bug 292664 @@ -81,24 +77,18 @@ public class CopyOnWriteTextStore implements ITextStore { return fText.substring(offset, offset + length); } - /* - * @see org.eclipse.jface.text.ITextStore#getLength() - */ + @Override public int getLength() { return fText.length(); } - /* - * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) { // modification not supported throw new UnsupportedOperationException(); } - /* - * @see org.eclipse.jface.text.ITextStore#set(java.lang.String) - */ + @Override public void set(String text) { // modification not supported throw new UnsupportedOperationException(); @@ -125,30 +115,22 @@ public class CopyOnWriteTextStore implements ITextStore { fModifiableTextStore= modifiableTextStore; } - /* - * @see org.eclipse.jface.text.ITextStore#get(int) - */ + @Override public char get(int offset) { return fTextStore.get(offset); } - /* - * @see org.eclipse.jface.text.ITextStore#get(int, int) - */ + @Override public String get(int offset, int length) { return fTextStore.get(offset, length); } - /* - * @see org.eclipse.jface.text.ITextStore#getLength() - */ + @Override public int getLength() { return fTextStore.getLength(); } - /* - * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) { if (fTextStore != fModifiableTextStore) { String content= fTextStore.get(0, fTextStore.getLength()); @@ -158,9 +140,7 @@ public class CopyOnWriteTextStore implements ITextStore { fTextStore.replace(offset, length, text); } - /* - * @see org.eclipse.jface.text.ITextStore#set(java.lang.String) - */ + @Override public void set(String text) { fTextStore= new StringTextStore(text); fModifiableTextStore.set(""); //$NON-NLS-1$ diff --git a/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java index b069c25cb23..8f801470d6f 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/DefaultLineTracker.java @@ -35,16 +35,12 @@ public class DefaultLineTracker extends AbstractLineTracker { public DefaultLineTracker() { } - /* - * @see org.eclipse.jface.text.ILineTracker#getLegalLineDelimiters() - */ + @Override public String[] getLegalLineDelimiters() { return TextUtilities.copy(DELIMITERS); } - /* - * @see org.eclipse.jface.text.AbstractLineTracker#nextDelimiterInfo(java.lang.String, int) - */ + @Override protected DelimiterInfo nextDelimiterInfo(String text, int offset) { char ch; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java b/org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java index c79124fdc87..e9de513d3ea 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/DefaultPositionUpdater.java @@ -200,9 +200,7 @@ public class DefaultPositionUpdater implements IPositionUpdater { return true; } - /* - * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void update(DocumentEvent event) { try { diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Document.java b/org.eclipse.text/src/org/eclipse/jface/text/Document.java index 6be4fb9a73d..1f9ba5a4e0e 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/Document.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/Document.java @@ -65,10 +65,7 @@ public class Document extends AbstractDocument { completeInitialization(); } - /* - * @see org.eclipse.jface.text.IRepairableDocumentExtension#isLineInformationRepairNeeded(int, int, java.lang.String) - * @since 3.4 - */ + @Override public boolean isLineInformationRepairNeeded(int offset, int length, String text) throws BadLocationException { if ((0 > offset) || (0 > length) || (offset + length > getLength())) throw new BadLocationException(); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java b/org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java index 2b6e563156a..57c54aa8da8 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/DocumentEvent.java @@ -129,10 +129,7 @@ public class DocumentEvent { return fModificationStamp; } - /* - * @see java.lang.Object#toString() - * @since 3.4 - */ + @Override public String toString() { StringBuffer buffer= new StringBuffer(); buffer.append("offset: " ); //$NON-NLS-1$ diff --git a/org.eclipse.text/src/org/eclipse/jface/text/DocumentRewriteSession.java b/org.eclipse.text/src/org/eclipse/jface/text/DocumentRewriteSession.java index 478b3093dac..8787fbe4ccc 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/DocumentRewriteSession.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/DocumentRewriteSession.java @@ -41,9 +41,7 @@ public class DocumentRewriteSession { return fSessionType; } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { return new StringBuffer().append(hashCode()).toString(); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java index 8ec45f3b142..101966307af 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/FindReplaceDocumentAdapter.java @@ -606,16 +606,12 @@ public class FindReplaceDocumentAdapter implements CharSequence { // ---------- CharSequence implementation ---------- - /* - * @see java.lang.CharSequence#length() - */ + @Override public int length() { return fDocument.getLength(); } - /* - * @see java.lang.CharSequence#charAt(int) - */ + @Override public char charAt(int index) { try { return fDocument.getChar(index); @@ -624,9 +620,7 @@ public class FindReplaceDocumentAdapter implements CharSequence { } } - /* - * @see java.lang.CharSequence#subSequence(int, int) - */ + @Override public CharSequence subSequence(int start, int end) { try { return fDocument.get(start, end - start); @@ -635,9 +629,7 @@ public class FindReplaceDocumentAdapter implements CharSequence { } } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { return fDocument.get(); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java index 4102107caae..2e886537c19 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/GapTextStore.java @@ -77,6 +77,7 @@ public class GapTextStore implements ITextStore { * (>= 0) * @deprecated use {@link GapTextStore#GapTextStore(int, int, float)} instead */ + @Deprecated public GapTextStore(int lowWatermark, int highWatermark) { /* * Legacy constructor. The API contract states that highWatermark is the upper bound for the @@ -137,9 +138,7 @@ public class GapTextStore implements ITextStore { fSizeMultiplier= 1 / (1 - maxGapFactor / 2); } - /* - * @see org.eclipse.jface.text.ITextStore#get(int) - */ + @Override public final char get(int offset) { if (offset < fGapStart) return fContent[offset]; @@ -147,9 +146,7 @@ public class GapTextStore implements ITextStore { return fContent[offset + gapSize()]; } - /* - * @see org.eclipse.jface.text.ITextStore#get(int, int) - */ + @Override public final String get(int offset, int length) { if (fGapStart <= offset) return new String(fContent, offset + gapSize() , length); @@ -165,16 +162,12 @@ public class GapTextStore implements ITextStore { return buf.toString(); } - /* - * @see org.eclipse.jface.text.ITextStore#getLength() - */ + @Override public final int getLength() { return fContent.length - gapSize(); } - /* - * @see org.eclipse.jface.text.ITextStore#set(java.lang.String) - */ + @Override public final void set(String text) { /* * Moves the gap to the end of the content. There is no sensible prediction of where the @@ -185,9 +178,7 @@ public class GapTextStore implements ITextStore { replace(0, getLength(), text); } - /* - * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String) - */ + @Override public final void replace(int offset, int length, String text) { if (text == null) { adjustGap(offset, length, 0); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java b/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java index 32581aa0364..6c106405773 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/IDocument.java @@ -646,5 +646,6 @@ public interface IDocument { * @exception BadLocationException if startOffset is an invalid document offset * @deprecated as of 3.0 search is provided by {@link FindReplaceDocumentAdapter} */ + @Deprecated int search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java b/org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java index f66feac19e2..804d17fa32e 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/IDocumentExtension.java @@ -79,6 +79,7 @@ public interface IDocumentExtension { * @param normalize <code>true</code> if performed from the start to the end of the document * @deprecated since 3.1. Use {@link IDocumentExtension4#startRewriteSession(DocumentRewriteSessionType)} instead. */ + @Deprecated void startSequentialRewrite(boolean normalize); /** @@ -86,5 +87,6 @@ public interface IDocumentExtension { * has only any effect if <code>startSequentialRewrite</code> has been called before. * @deprecated since 3.1. Use {@link IDocumentExtension4#stopRewriteSession(DocumentRewriteSession)} instead. */ + @Deprecated void stopSequentialRewrite(); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Line.java b/org.eclipse.text/src/org/eclipse/jface/text/Line.java index 0f810df505d..9e1dd7a4f0b 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/Line.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/Line.java @@ -50,16 +50,12 @@ final class Line implements IRegion { this.delimiter= null; } - /* - * @see org.eclipse.jface.text.IRegion#getOffset() - */ + @Override public int getOffset() { return offset; } - /* - * @see org.eclipse.jface.text.IRegion#getLength() - */ + @Override public int getLength() { return length; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java index 591c2492d48..11fcf70c977 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/ListLineTracker.java @@ -116,9 +116,7 @@ abstract class ListLineTracker implements ILineTracker { return getLineNumberOfOffset(target) - startLine + 1; } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineLength(int) - */ + @Override public final int getLineLength(int line) throws BadLocationException { int lines= fLines.size(); @@ -132,9 +130,7 @@ abstract class ListLineTracker implements ILineTracker { return l.length; } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineNumberOfOffset(int) - */ + @Override public final int getLineNumberOfOffset(int position) throws BadLocationException { if (position < 0 || position > fTextLength) throw new BadLocationException(); @@ -152,9 +148,7 @@ abstract class ListLineTracker implements ILineTracker { return findLine(position); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int) - */ + @Override public final IRegion getLineInformationOfOffset(int position) throws BadLocationException { if (position > fTextLength) throw new BadLocationException(); @@ -170,9 +164,7 @@ abstract class ListLineTracker implements ILineTracker { return getLineInformation(findLine(position)); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformation(int) - */ + @Override public final IRegion getLineInformation(int line) throws BadLocationException { int lines= fLines.size(); @@ -191,9 +183,7 @@ abstract class ListLineTracker implements ILineTracker { return (l.delimiter != null ? new Line(l.offset, l.length - l.delimiter.length()) : l); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineOffset(int) - */ + @Override public final int getLineOffset(int line) throws BadLocationException { int lines= fLines.size(); @@ -214,9 +204,7 @@ abstract class ListLineTracker implements ILineTracker { return l.offset; } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines() - */ + @Override public final int getNumberOfLines() { int lines= fLines.size(); @@ -227,9 +215,7 @@ abstract class ListLineTracker implements ILineTracker { return (l.delimiter != null ? lines + 1 : lines); } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines(int, int) - */ + @Override public final int getNumberOfLines(int position, int length) throws BadLocationException { if (position < 0 || position + length > fTextLength) @@ -241,9 +227,7 @@ abstract class ListLineTracker implements ILineTracker { return getNumberOfLines(getLineNumberOfOffset(position), position, length); } - /* - * @see org.eclipse.jface.text.ILineTracker#computeNumberOfLines(java.lang.String) - */ + @Override public final int computeNumberOfLines(String text) { int count= 0; int start= 0; @@ -256,9 +240,7 @@ abstract class ListLineTracker implements ILineTracker { return count; } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineDelimiter(int) - */ + @Override public final String getLineDelimiter(int line) throws BadLocationException { int lines= fLines.size(); @@ -331,16 +313,12 @@ abstract class ListLineTracker implements ILineTracker { return count; } - /* - * @see org.eclipse.jface.text.ILineTracker#replace(int, int, java.lang.String) - */ + @Override public final void replace(int position, int length, String text) throws BadLocationException { throw new UnsupportedOperationException(); } - /* - * @see org.eclipse.jface.text.ILineTracker#set(java.lang.String) - */ + @Override public final void set(String text) { fLines.clear(); if (text != null) { diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Position.java b/org.eclipse.text/src/org/eclipse/jface/text/Position.java index 98c2ff79060..12f36e458e1 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/Position.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/Position.java @@ -71,9 +71,7 @@ public class Position { protected Position() { } - /* - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { int deleted= isDeleted ? 0 : 1; return (offset << 24) | (length << 16) | deleted; @@ -95,9 +93,7 @@ public class Position { isDeleted= false; } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object other) { if (other instanceof Position) { Position rp= (Position) other; @@ -196,10 +192,7 @@ public class Position { this.offset= offset; } - /* - * @see java.lang.Object#toString() - * @since 3.5 - */ + @Override public String toString() { String position= "offset: " + offset + ", length: " + length; //$NON-NLS-1$//$NON-NLS-2$ return isDeleted ? position + " (deleted)" : position; //$NON-NLS-1$ diff --git a/org.eclipse.text/src/org/eclipse/jface/text/Region.java b/org.eclipse.text/src/org/eclipse/jface/text/Region.java index c5b97357739..ac1f93141bf 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/Region.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/Region.java @@ -32,23 +32,17 @@ public class Region implements IRegion { fLength= length; } - /* - * @see org.eclipse.jface.text.IRegion#getLength() - */ + @Override public int getLength() { return fLength; } - /* - * @see org.eclipse.jface.text.IRegion#getOffset() - */ + @Override public int getOffset() { return fOffset; } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object o) { if (o instanceof IRegion) { IRegion r= (IRegion) o; @@ -57,16 +51,12 @@ public class Region implements IRegion { return false; } - /* - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { return (fOffset << 24) | (fLength << 16); } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { return "offset: " + fOffset + ", length: " + fLength; //$NON-NLS-1$ //$NON-NLS-2$; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/RewriteSessionEditProcessor.java b/org.eclipse.text/src/org/eclipse/jface/text/RewriteSessionEditProcessor.java index 06e02a096fe..86550d63519 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/RewriteSessionEditProcessor.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/RewriteSessionEditProcessor.java @@ -36,26 +36,31 @@ public final class RewriteSessionEditProcessor extends TextEditProcessor { private static final class SizeVisitor extends TextEditVisitor { int fSize= 0; + @Override public boolean visit(CopyTargetEdit edit) { fSize += edit.getLength(); return super.visit(edit); } + @Override public boolean visit(DeleteEdit edit) { fSize += edit.getLength(); return super.visit(edit); } + @Override public boolean visit(InsertEdit edit) { fSize += edit.getText().length(); return super.visit(edit); } + @Override public boolean visit(MoveTargetEdit edit) { fSize += edit.getLength(); return super.visit(edit); } + @Override public boolean visit(ReplaceEdit edit) { fSize += Math.max(edit.getLength(), edit.getText().length()); return super.visit(edit); @@ -76,9 +81,7 @@ public final class RewriteSessionEditProcessor extends TextEditProcessor { super(document, root, style); } - /* - * @see org.eclipse.text.edits.TextEditProcessor#performEdits() - */ + @Override public UndoEdit performEdits() throws MalformedTreeException, BadLocationException { IDocument document= getDocument(); if (!(document instanceof IDocumentExtension4)) diff --git a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java index e7b8e5fb00b..3c26c5de467 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/SequentialRewriteTextStore.java @@ -24,6 +24,7 @@ import java.util.LinkedList; * @since 2.0 * @deprecated since 3.3 as {@link GapTextStore} performs better even for sequential rewrite scenarios */ +@Deprecated public class SequentialRewriteTextStore implements ITextStore { /** @@ -71,9 +72,7 @@ public class SequentialRewriteTextStore implements ITextStore { return fSource; } - /* - * @see org.eclipse.jface.text.ITextStore#replace(int, int, java.lang.String) - */ + @Override public void replace(int offset, int length, String text) { if (text == null) text= ""; //$NON-NLS-1$ @@ -112,17 +111,13 @@ public class SequentialRewriteTextStore implements ITextStore { } } - /* - * @see org.eclipse.jface.text.ITextStore#set(java.lang.String) - */ + @Override public void set(String text) { fSource.set(text); fReplaceList.clear(); } - /* - * @see org.eclipse.jface.text.ITextStore#get(int, int) - */ + @Override public String get(int offset, int length) { if (fReplaceList.isEmpty()) @@ -182,9 +177,7 @@ public class SequentialRewriteTextStore implements ITextStore { return replace.newOffset - replace.offset + replace.text.length() - replace.length; } - /* - * @see org.eclipse.jface.text.ITextStore#get(int) - */ + @Override public char get(int offset) { if (fReplaceList.isEmpty()) return fSource.get(offset); @@ -223,9 +216,7 @@ public class SequentialRewriteTextStore implements ITextStore { } } - /* - * @see org.eclipse.jface.text.ITextStore#getLength() - */ + @Override public int getLength() { if (fReplaceList.isEmpty()) return fSource.getLength(); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java index b30eef61bc1..64fcf4c94c7 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/TextUtilities.java @@ -41,6 +41,7 @@ public class TextUtilities { * * @deprecated use DELIMITERS instead */ + @Deprecated public final static String[] fgDelimiters= DELIMITERS; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.java b/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.java index e25c1e00164..faede932120 100755 --- a/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/TreeLineTracker.java @@ -118,9 +118,7 @@ abstract class TreeLineTracker implements ILineTracker { /** The balance factor. */ byte balance; - /* - * @see java.lang.Object#toString() - */ + @Override public final String toString() { String bal; switch (balance) { @@ -593,9 +591,7 @@ abstract class TreeLineTracker implements ILineTracker { } } - /* - * @see org.eclipse.jface.text.ILineTracker#replace(int, int, java.lang.String) - */ + @Override public final void replace(int offset, int length, String text) throws BadLocationException { if (ASSERT) checkTree(); @@ -1065,17 +1061,13 @@ abstract class TreeLineTracker implements ILineTracker { */ protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset); - /* - * @see org.eclipse.jface.text.ILineTracker#getLineDelimiter(int) - */ + @Override public final String getLineDelimiter(int line) throws BadLocationException { Node node= nodeByLine(line); return node.delimiter == NO_DELIM ? null : node.delimiter; } - /* - * @see org.eclipse.jface.text.ILineTracker#computeNumberOfLines(java.lang.String) - */ + @Override public final int computeNumberOfLines(String text) { int count= 0; int start= 0; @@ -1088,9 +1080,7 @@ abstract class TreeLineTracker implements ILineTracker { return count; } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines() - */ + @Override public final int getNumberOfLines() { // TODO track separately? Node node= fRoot; @@ -1102,9 +1092,7 @@ abstract class TreeLineTracker implements ILineTracker { return lines; } - /* - * @see org.eclipse.jface.text.ILineTracker#getNumberOfLines(int, int) - */ + @Override public final int getNumberOfLines(int offset, int length) throws BadLocationException { if (length == 0) return 1; @@ -1115,31 +1103,23 @@ abstract class TreeLineTracker implements ILineTracker { return endLine - startLine + 1; } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineOffset(int) - */ + @Override public final int getLineOffset(int line) throws BadLocationException { return offsetByLine(line); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineLength(int) - */ + @Override public final int getLineLength(int line) throws BadLocationException { Node node= nodeByLine(line); return node.length; } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineNumberOfOffset(int) - */ + @Override public final int getLineNumberOfOffset(int offset) throws BadLocationException { return lineByOffset(offset); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int) - */ + @Override public final IRegion getLineInformationOfOffset(final int offset) throws BadLocationException { // Inline nodeByOffset start as we need both node and offset int remaining= offset; @@ -1167,9 +1147,7 @@ abstract class TreeLineTracker implements ILineTracker { return new Region(lineOffset, node.pureLength()); } - /* - * @see org.eclipse.jface.text.ILineTracker#getLineInformation(int) - */ + @Override public final IRegion getLineInformation(int line) throws BadLocationException { try { // Inline nodeByLine start @@ -1233,9 +1211,7 @@ abstract class TreeLineTracker implements ILineTracker { } } - /* - * @see org.eclipse.jface.text.ILineTracker#set(java.lang.String) - */ + @Override public final void set(String text) { fRoot= new Node(0, NO_DELIM); try { @@ -1245,9 +1221,7 @@ abstract class TreeLineTracker implements ILineTracker { } } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { int depth= computeDepth(fRoot); int WIDTH= 30; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java b/org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java index a0cf55c43e4..420d62557c5 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/TypedPosition.java @@ -55,9 +55,7 @@ public class TypedPosition extends Position { return fType; } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object o) { if (o instanceof TypedPosition) { if (super.equals(o)) { @@ -68,18 +66,13 @@ public class TypedPosition extends Position { return false; } - /* - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { int type= fType == null ? 0 : fType.hashCode(); return super.hashCode() | type; } - /* - * @see org.eclipse.jface.text.Region#toString() - * @since 3.5 - */ + @Override public String toString() { return fType + " - " + super.toString(); //$NON-NLS-1$ } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java b/org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java index 189d4913c3c..85962a36c6c 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/TypedRegion.java @@ -32,16 +32,12 @@ public class TypedRegion extends Region implements ITypedRegion { fType= type; } - /* - * @see org.eclipse.jface.text.ITypedRegion#getType() - */ + @Override public String getType() { return fType; } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object o) { if (o instanceof TypedRegion) { TypedRegion r= (TypedRegion) o; @@ -50,18 +46,13 @@ public class TypedRegion extends Region implements ITypedRegion { return false; } - /* - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { int type= fType == null ? 0 : fType.hashCode(); return super.hashCode() | type; } - /* - * @see org.eclipse.jface.text.Region#toString() - * @since 3.5 - */ + @Override public String toString() { return fType + " - " + super.toString(); //$NON-NLS-1$ } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/InclusivePositionUpdater.java b/org.eclipse.text/src/org/eclipse/jface/text/link/InclusivePositionUpdater.java index c785eaa960e..9bb54abe265 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/link/InclusivePositionUpdater.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/link/InclusivePositionUpdater.java @@ -38,9 +38,7 @@ public class InclusivePositionUpdater implements IPositionUpdater { fCategory= category; } - /* - * @see org.eclipse.jface.text.IPositionUpdater#update(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void update(DocumentEvent event) { int eventOffset= event.getOffset(); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java index 16af314a0c3..d91f4a119ed 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeManager.java @@ -37,23 +37,17 @@ class LinkedModeManager { */ private class Listener implements ILinkedModeListener { - /* - * @see org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel.ILinkedModeListener#left(org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel, int) - */ + @Override public void left(LinkedModeModel model, int flags) { LinkedModeManager.this.left(model, flags); } - /* - * @see org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel.ILinkedModeListener#suspend(org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel) - */ + @Override public void suspend(LinkedModeModel model) { // not interested } - /* - * @see org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel.ILinkedModeListener#resume(org.eclipse.jdt.internal.ui.text.link2.LinkedModeModel, int) - */ + @Override public void resume(LinkedModeModel model, int flags) { // not interested } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeModel.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeModel.java index f85439bf063..d6ad8897ef9 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeModel.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedModeModel.java @@ -143,9 +143,7 @@ public class LinkedModeModel { fEdit= edit; } - /* - * @see org.eclipse.jface.text.IDocumentExtension.IReplace#perform(org.eclipse.jface.text.IDocument, org.eclipse.jface.text.IDocumentListener) - */ + @Override public void perform(IDocument document, IDocumentListener owner) throws RuntimeException, MalformedTreeException { document.removeDocumentListener(owner); fIsChanging= true; @@ -178,6 +176,7 @@ public class LinkedModeModel { * * @param event {@inheritDoc} */ + @Override public void documentAboutToBeChanged(DocumentEvent event) { // don't react on changes executed by the parent model if (fParentEnvironment != null && fParentEnvironment.isChanging()) @@ -197,6 +196,7 @@ public class LinkedModeModel { * * @param event {@inheritDoc} */ + @Override public void documentChanged(DocumentEvent event) { if (fExit) { LinkedModeModel.this.exit(ILinkedModeListener.EXTERNAL_MODIFICATION); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPosition.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPosition.java index 4d3ddbc3d87..079ff6177c1 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPosition.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPosition.java @@ -65,9 +65,7 @@ public class LinkedPosition extends Position { return fDocument; } - /* - * @see org.eclipse.jface.text.Position#equals(java.lang.Object) - */ + @Override public boolean equals(Object other) { if (other instanceof LinkedPosition) { LinkedPosition p= (LinkedPosition) other; @@ -118,6 +116,7 @@ public class LinkedPosition extends Position { * @return <code>true</code> if <code>pOffset</code> is in * <code>[offset, offset + length]</code> */ + @Override public boolean includes(int pOffset) { return this.offset <= pOffset && pOffset <= this.offset + this.length; } @@ -169,9 +168,7 @@ public class LinkedPosition extends Position { fSequenceNumber= sequence; } - /* - * @see org.eclipse.jface.text.Position#hashCode() - */ + @Override public int hashCode() { return fDocument.hashCode() | super.hashCode() | fSequenceNumber; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java index a2c10a401c0..9c8450d316a 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/link/LinkedPositionGroup.java @@ -407,6 +407,7 @@ public class LinkedPositionGroup { * @return <code>true</code> if this group is empty, <code>false</code> otherwise * @deprecated As of 3.1, replaced by {@link #isEmpty()} */ + @Deprecated public boolean isEmtpy() { return isEmpty(); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java index 4cf6c1642e7..490083414c3 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationMap.java @@ -49,142 +49,110 @@ class AnnotationMap implements IAnnotationMap { fInternalMap= new HashMap(capacity); } - /* - * @see org.eclipse.jface.text.source.ISynchronizable#setLockObject(java.lang.Object) - */ - public synchronized void setLockObject(Object lockObject) { + @Override + public synchronized void setLockObject(Object lockObject) { fLockObject= lockObject; } - /* - * @see org.eclipse.jface.text.source.ISynchronizable#getLockObject() - */ - public synchronized Object getLockObject() { + @Override + public synchronized Object getLockObject() { if (fLockObject == null) return fInternalLockObject; return fLockObject; } - /* - * @see org.eclipse.jface.text.source.IAnnotationMap#valuesIterator() - */ - public Iterator valuesIterator() { + @Override + public Iterator valuesIterator() { synchronized (getLockObject()) { return new ArrayList(fInternalMap.values()).iterator(); } } - /* - * @see org.eclipse.jface.text.source.IAnnotationMap#keySetIterator() - */ - public Iterator keySetIterator() { + @Override + public Iterator keySetIterator() { synchronized (getLockObject()) { return new ArrayList(fInternalMap.keySet()).iterator(); } } - /* - * @see java.util.Map#containsKey(java.lang.Object) - */ - public boolean containsKey(Object annotation) { + @Override + public boolean containsKey(Object annotation) { synchronized (getLockObject()) { return fInternalMap.containsKey(annotation); } } - /* - * @see java.util.Map#put(java.lang.Object, java.lang.Object) - */ - public Object put(Object annotation, Object position) { + @Override + public Object put(Object annotation, Object position) { synchronized (getLockObject()) { return fInternalMap.put(annotation, position); } } - /* - * @see java.util.Map#get(java.lang.Object) - */ - public Object get(Object annotation) { + @Override + public Object get(Object annotation) { synchronized (getLockObject()) { return fInternalMap.get(annotation); } } - /* - * @see java.util.Map#clear() - */ - public void clear() { + @Override + public void clear() { synchronized (getLockObject()) { fInternalMap.clear(); } } - /* - * @see java.util.Map#remove(java.lang.Object) - */ - public Object remove(Object annotation) { + @Override + public Object remove(Object annotation) { synchronized (getLockObject()) { return fInternalMap.remove(annotation); } } - /* - * @see java.util.Map#size() - */ - public int size() { + @Override + public int size() { synchronized (getLockObject()) { return fInternalMap.size(); } } - /* - * @see java.util.Map#isEmpty() - */ - public boolean isEmpty() { + @Override + public boolean isEmpty() { synchronized (getLockObject()) { return fInternalMap.isEmpty(); } } - /* - * @see java.util.Map#containsValue(java.lang.Object) - */ + @Override public boolean containsValue(Object value) { synchronized(getLockObject()) { return fInternalMap.containsValue(value); } } - /* - * @see java.util.Map#putAll(java.util.Map) - */ + @Override public void putAll(Map map) { synchronized (getLockObject()) { fInternalMap.putAll(map); } } - /* - * @see IAnnotationMap#entrySet() - */ + @Override public Set entrySet() { synchronized (getLockObject()) { return fInternalMap.entrySet(); } } - /* - * @see IAnnotationMap#keySet() - */ + @Override public Set keySet() { synchronized (getLockObject()) { return fInternalMap.keySet(); } } - /* - * @see IAnnotationMap#values() - */ + @Override public Collection values() { synchronized (getLockObject()) { return fInternalMap.values(); diff --git a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java index b23cc3a6960..3631aee4f0d 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/source/AnnotationModel.java @@ -83,16 +83,12 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens fNext= findNext(); } - /* - * @see java.util.Iterator#hasNext() - */ + @Override public boolean hasNext() { return fNext != null; } - /* - * @see java.util.Iterator#next() - */ + @Override public Object next() { if (!hasNext()) throw new NoSuchElementException(); @@ -102,9 +98,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return result; } - /* - * @see java.util.Iterator#remove() - */ + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -158,25 +152,19 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens fNext= findNext(); } - /* (non-Javadoc) - * @see java.util.Iterator#hasNext() - */ + @Override public boolean hasNext() { return fNext != null; } - /* (non-Javadoc) - * @see java.util.Iterator#next() - */ + @Override public Object next() { Object result= fNext; fNext= findNext(); return result; } - /* (non-Javadoc) - * @see java.util.Iterator#remove() - */ + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -213,10 +201,12 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens fCurrent= (Iterator) fSuperIterator.next(); // there is at least one. } + @Override public void remove() { throw new UnsupportedOperationException(); } + @Override public boolean hasNext() { if (fCurrentElement != null) return true; @@ -231,6 +221,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return false; } + @Override public Object next() { if (!hasNext()) throw new NoSuchElementException(); @@ -249,16 +240,12 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens */ private class InternalModelListener implements IAnnotationModelListener, IAnnotationModelListenerExtension { - /* - * @see org.eclipse.jface.text.source.IAnnotationModelListener#modelChanged(org.eclipse.jface.text.source.IAnnotationModel) - */ + @Override public void modelChanged(IAnnotationModel model) { AnnotationModel.this.fireModelChanged(new AnnotationModelEvent(model, true)); } - /* - * @see org.eclipse.jface.text.source.IAnnotationModelListenerExtension#modelChanged(org.eclipse.jface.text.source.AnnotationModelEvent) - */ + @Override public void modelChanged(AnnotationModelEvent event) { AnnotationModel.this.fireModelChanged(event); } @@ -268,6 +255,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * The list of managed annotations * @deprecated since 3.0 use <code>getAnnotationMap</code> instead */ + @Deprecated protected Map fAnnotations; /** * The map which maps {@link Position} to {@link Annotation}. @@ -316,9 +304,11 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens fDocumentListener= new IDocumentListener() { + @Override public void documentAboutToBeChanged(DocumentEvent event) { } + @Override public void documentChanged(DocumentEvent event) { fDocumentChanged= true; } @@ -335,19 +325,13 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return (IAnnotationMap) fAnnotations; } - /* - * @see org.eclipse.jface.text.ISynchronizable#getLockObject() - * @since 3.0 - */ - public Object getLockObject() { + @Override + public Object getLockObject() { return getAnnotationMap().getLockObject(); } - /* - * @see org.eclipse.jface.text.ISynchronizable#setLockObject(java.lang.Object) - * @since 3.0 - */ - public void setLockObject(Object lockObject) { + @Override + public void setLockObject(Object lockObject) { getAnnotationMap().setLockObject(lockObject); } @@ -369,9 +353,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#addAnnotation(org.eclipse.jface.text.source.Annotation, org.eclipse.jface.text.Position) - */ + @Override public void addAnnotation(Annotation annotation, Position position) { try { addAnnotation(annotation, position, true); @@ -380,10 +362,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see org.eclipse.jface.text.source.IAnnotationModelExtension#replaceAnnotations(org.eclipse.jface.text.source.Annotation[], java.util.Map) - * @since 3.0 - */ + @Override public void replaceAnnotations(Annotation[] annotationsToRemove, Map annotationsToAdd) { try { replaceAnnotations(annotationsToRemove, annotationsToAdd, true); @@ -450,9 +429,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#addAnnotationModelListener(org.eclipse.jface.text.source.IAnnotationModelListener) - */ + @Override public void addAnnotationModelListener(IAnnotationModelListener listener) { if (!fAnnotationModelListeners.contains(listener)) { fAnnotationModelListeners.add(listener); @@ -493,9 +470,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens document.removePosition(position); } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#connect(org.eclipse.jface.text.IDocument) - */ + @Override public void connect(IDocument document) { Assert.isTrue(fDocument == null || fDocument == document); @@ -536,9 +511,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens protected void disconnected() { } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#disconnect(org.eclipse.jface.text.IDocument) - */ + @Override public void disconnect(IDocument document) { Assert.isTrue(fDocument == document); @@ -675,6 +648,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens synchronized (getLockObject()) { if (fModelEvent != null) new Thread() { + @Override public void run() { fireModelChanged(); } @@ -685,9 +659,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#getAnnotationIterator() - */ + @Override public Iterator getAnnotationIterator() { return getAnnotationIterator(true, true); } @@ -697,6 +669,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * * @since 3.4 */ + @Override public Iterator getAnnotationIterator(int offset, int length, boolean canStartBefore, boolean canEndAfter) { Iterator regionIterator= getRegionAnnotationIterator(offset, length, canStartBefore, canEndAfter); @@ -784,9 +757,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return getAnnotationMap().keySetIterator(); } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#getPosition(org.eclipse.jface.text.source.Annotation) - */ + @Override public Position getPosition(Annotation annotation) { Position position= (Position) fAnnotations.get(annotation); if (position != null) @@ -798,10 +769,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return position; } - /* - * @see org.eclipse.jface.text.source.IAnnotationModelExtension#removeAllAnnotations() - * @since 3.0 - */ + @Override public void removeAllAnnotations() { removeAllAnnotations(true); } @@ -834,9 +802,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens fireModelChanged(); } - /* - * @see org.eclipse.jface.text.source.IAnnotationModel#removeAnnotation(org.eclipse.jface.text.source.Annotation) - */ + @Override public void removeAnnotation(Annotation annotation) { removeAnnotation(annotation, true); } @@ -869,10 +835,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see org.eclipse.jface.text.source.IAnnotationModelExtension#modifyAnnotationPosition(org.eclipse.jface.text.source.Annotation, org.eclipse.jface.text.Position) - * @since 3.0 - */ + @Override public void modifyAnnotationPosition(Annotation annotation, Position position) { modifyAnnotationPosition(annotation, position, true); } @@ -947,9 +910,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens } } - /* - * @see IAnnotationModel#removeAnnotationModelListener(IAnnotationModelListener) - */ + @Override public void removeAnnotationModelListener(IAnnotationModelListener listener) { fAnnotationModelListeners.remove(listener); } @@ -958,6 +919,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * @see org.eclipse.jface.text.source.IAnnotationModelExtension#attach(java.lang.Object, java.lang.Object) * @since 3.0 */ + @Override public void addAnnotationModel(Object key, IAnnotationModel attachment) { Assert.isNotNull(attachment); if (!fAttachments.containsValue(attachment)) { @@ -972,6 +934,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * @see org.eclipse.jface.text.source.IAnnotationModelExtension#get(java.lang.Object) * @since 3.0 */ + @Override public IAnnotationModel getAnnotationModel(Object key) { return (IAnnotationModel) fAttachments.get(key); } @@ -980,6 +943,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens * @see org.eclipse.jface.text.source.IAnnotationModelExtension#detach(java.lang.Object) * @since 3.0 */ + @Override public IAnnotationModel removeAnnotationModel(Object key) { IAnnotationModel ret= (IAnnotationModel) fAttachments.remove(key); if (ret != null) { @@ -990,10 +954,7 @@ public class AnnotationModel implements IAnnotationModel, IAnnotationModelExtens return ret; } - /* - * @see org.eclipse.jface.text.source.IAnnotationModelExtension#getModificationStamp() - * @since 3.0 - */ + @Override public Object getModificationStamp() { return fModificationStamp; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java b/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java index 5812ded4089..4c73d8045d7 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/source/IAnnotationMap.java @@ -57,6 +57,7 @@ public interface IAnnotationMap extends Map, ISynchronizable { * * The returned set is not synchronized on this annotation map's lock object. */ + @Override Set entrySet(); /** @@ -64,6 +65,7 @@ public interface IAnnotationMap extends Map, ISynchronizable { * * The returned set is not synchronized on this annotation map's lock object. */ + @Override Set keySet(); /** @@ -71,5 +73,6 @@ public interface IAnnotationMap extends Map, ISynchronizable { * * The returned collection is not synchronized on this annotation map's lock object. */ + @Override Collection values(); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/DocumentTemplateContext.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/DocumentTemplateContext.java index cc01386f2a0..b16623cc240 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/DocumentTemplateContext.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/DocumentTemplateContext.java @@ -165,16 +165,12 @@ public class DocumentTemplateContext extends TemplateContext { return fPosition.getOffset() + fPosition.getLength(); } - /* - * @see org.eclipse.jface.text.templates.TemplateContext#canEvaluate(org.eclipse.jface.text.templates.Template) - */ + @Override public boolean canEvaluate(Template template) { return true; } - /* - * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template) - */ + @Override public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException { if (!canEvaluate(template)) return null; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java index 19f27f6415e..3a3b4d2d9a3 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/GlobalTemplateVariables.java @@ -59,6 +59,7 @@ public class GlobalTemplateVariables { public WordSelection() { super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedWord")); //$NON-NLS-1$ } + @Override protected String resolve(TemplateContext context) { String selection= context.getVariable(SELECTION); if (selection == null) @@ -82,6 +83,7 @@ public class GlobalTemplateVariables { public LineSelection() { super(NAME, TextTemplateMessages.getString("GlobalVariables.variable.description.selectedLines")); //$NON-NLS-1$ } + @Override protected String resolve(TemplateContext context) { String selection= context.getVariable(SELECTION); if (selection == null) @@ -113,6 +115,7 @@ public class GlobalTemplateVariables { public Date() { super("date", TextTemplateMessages.getString("GlobalVariables.variable.description.date")); //$NON-NLS-1$ //$NON-NLS-2$ } + @Override protected String resolve(TemplateContext context) { return DateFormat.getDateInstance().format(new java.util.Date()); } @@ -128,6 +131,7 @@ public class GlobalTemplateVariables { public Year() { super("year", TextTemplateMessages.getString("GlobalVariables.variable.description.year")); //$NON-NLS-1$ //$NON-NLS-2$ } + @Override protected String resolve(TemplateContext context) { return Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); } @@ -144,9 +148,7 @@ public class GlobalTemplateVariables { super("time", TextTemplateMessages.getString("GlobalVariables.variable.description.time")); //$NON-NLS-1$ //$NON-NLS-2$ } - /** - * {@inheritDoc} - */ + @Override protected String resolve(TemplateContext context) { return DateFormat.getTimeInstance().format(new java.util.Date()); } @@ -163,9 +165,7 @@ public class GlobalTemplateVariables { super("user", TextTemplateMessages.getString("GlobalVariables.variable.description.user")); //$NON-NLS-1$ //$NON-NLS-2$ } - /** - * {@inheritDoc} - */ + @Override protected String resolve(TemplateContext context) { return System.getProperty("user.name"); //$NON-NLS-1$ } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/SimpleTemplateVariableResolver.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/SimpleTemplateVariableResolver.java index 6597d60e95e..5885d70fd49 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/SimpleTemplateVariableResolver.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/SimpleTemplateVariableResolver.java @@ -43,6 +43,7 @@ public class SimpleTemplateVariableResolver extends TemplateVariableResolver { /* * @see TemplateVariableResolver#evaluate(TemplateContext) */ + @Override protected String resolve(TemplateContext context) { return fEvaluationString; } @@ -54,6 +55,7 @@ public class SimpleTemplateVariableResolver extends TemplateVariableResolver { * @param context {@inheritDoc} * @return <code>true</code> */ + @Override protected boolean isUnambiguous(TemplateContext context) { return true; } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/Template.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/Template.java index 9c6d5728ece..c58b972ccf7 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/Template.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/Template.java @@ -62,6 +62,7 @@ public class Template { * @param pattern the template pattern * @deprecated as of 3.1 replaced by {@link #Template(String, String, String, String, boolean)} */ + @Deprecated public Template(String name, String description, String contextTypeId, String pattern) { this(name, description, contextTypeId, pattern, true); // templates are auto insertable per default } @@ -86,9 +87,7 @@ public class Template { fIsAutoInsertable= isAutoInsertable; } - /* - * @see Object#hashCode() - */ + @Override public int hashCode() { return fName.hashCode() ^ fPattern.hashCode() ^ fContextTypeId.hashCode(); } @@ -99,6 +98,7 @@ public class Template { * @param description the new description * @deprecated Templates should never be modified */ + @Deprecated public void setDescription(String description) { Assert.isNotNull(description); fDescription= description; @@ -119,6 +119,7 @@ public class Template { * @param contextTypeId the new context type name * @deprecated Templates should never be modified */ + @Deprecated public void setContextTypeId(String contextTypeId) { Assert.isNotNull(contextTypeId); fContextTypeId= contextTypeId; @@ -139,6 +140,7 @@ public class Template { * @param name the name of the template * @deprecated Templates should never be modified */ + @Deprecated public void setName(String name) { fName= name; } @@ -158,6 +160,7 @@ public class Template { * @param pattern the new pattern of the template * @deprecated Templates should never be modified */ + @Deprecated public void setPattern(String pattern) { fPattern= pattern; } @@ -184,9 +187,7 @@ public class Template { return fContextTypeId.equals(contextTypeId); } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object o) { if (!(o instanceof Template)) return false; diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateTranslator.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateTranslator.java index a67e51477fd..9cf79156f27 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateTranslator.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateTranslator.java @@ -313,6 +313,7 @@ public class TemplateTranslator { * @return a new instance of <code>TemplateVariable</code> * @deprecated as of 3.3 use {@link #createVariable(TemplateVariableType, String, int[])} instead */ + @Deprecated protected TemplateVariable createVariable(String type, String name, int[] offsets) { return createVariable(fCurrentType, name, offsets); } diff --git a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariableType.java b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariableType.java index 9d9b4ca5df5..e3b705f1354 100644 --- a/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariableType.java +++ b/org.eclipse.text/src/org/eclipse/jface/text/templates/TemplateVariableType.java @@ -61,9 +61,7 @@ public final class TemplateVariableType { return fParams; } - /* - * @see java.lang.Object#equals(java.lang.Object) - */ + @Override public boolean equals(Object obj) { if (obj instanceof TemplateVariableType) { TemplateVariableType other= (TemplateVariableType) obj; @@ -72,17 +70,12 @@ public final class TemplateVariableType { return false; } - /* - * @see java.lang.Object#hashCode() - */ + @Override public int hashCode() { return fName.hashCode() + fParams.hashCode(); } - /* - * @see java.lang.Object#toString() - * @since 3.3 - */ + @Override public String toString() { return fName + fParams.toString(); } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java index 117f7663a9a..d6c513c18d6 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/CopySourceEdit.java @@ -62,25 +62,31 @@ public final class CopySourceEdit extends TextEdit { fParents.add(fCurrentParent); fCurrentParent= copy; } + @Override public void postVisit(TextEdit edit) { fCurrentParent= (TextEdit)fParents.remove(fParents.size() - 1); } + @Override public boolean visitNode(TextEdit edit) { manageCopy(edit.doCopy()); return true; } + @Override public boolean visit(CopySourceEdit edit) { manageCopy(new RangeMarker(edit.getOffset(), edit.getLength())); return true; } + @Override public boolean visit(CopyTargetEdit edit) { manageCopy(new InsertEdit(edit.getOffset(), edit.getSourceEdit().getContent())); return true; } + @Override public boolean visit(MoveSourceEdit edit) { manageCopy(new DeleteEdit(edit.getOffset(), edit.getLength())); return true; } + @Override public boolean visit(MoveTargetEdit edit) { manageCopy(new InsertEdit(edit.getOffset(), edit.getSourceEdit().getContent())); return true; @@ -167,6 +173,7 @@ public final class CopySourceEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new CopySourceEdit(this); } @@ -174,6 +181,7 @@ public final class CopySourceEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -199,6 +207,7 @@ public final class CopySourceEdit extends TextEdit { /* * @see TextEdit#postProcessCopy */ + @Override protected void postProcessCopy(TextEditCopier copier) { if (fTarget != null) { CopySourceEdit source= (CopySourceEdit)copier.getCopy(this); @@ -210,6 +219,7 @@ public final class CopySourceEdit extends TextEdit { //---- consistency check ---------------------------------------------------- + @Override int traverseConsistencyCheck(TextEditProcessor processor, IDocument document, List sourceEdits) { int result= super.traverseConsistencyCheck(processor, document, sourceEdits); // Since source computation takes place in a recursive fashion (see @@ -234,6 +244,7 @@ public final class CopySourceEdit extends TextEdit { return result; } + @Override void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { if (fTarget == null) throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.no_target")); //$NON-NLS-1$ @@ -247,6 +258,7 @@ public final class CopySourceEdit extends TextEdit { //---- source computation ------------------------------------------------------- + @Override void traverseSourceComputation(TextEditProcessor processor, IDocument document) { // always perform source computation independent of processor.considerEdit // The target might need the source and the source is computed in a @@ -254,6 +266,7 @@ public final class CopySourceEdit extends TextEdit { performSourceComputation(processor, document); } + @Override void performSourceComputation(TextEditProcessor processor, IDocument document) { try { MultiTextEdit root= new MultiTextEdit(getOffset(), getLength()); @@ -300,6 +313,7 @@ public final class CopySourceEdit extends TextEdit { //---- document updating ---------------------------------------------------------------- + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { fDelta= 0; return fDelta; @@ -310,6 +324,7 @@ public final class CopySourceEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java index f0cf3a1a7e7..1c6569e3bdb 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/CopyTargetEdit.java @@ -99,6 +99,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new CopyTargetEdit(this); } @@ -106,6 +107,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#postProcessCopy */ + @Override protected void postProcessCopy(TextEditCopier copier) { if (fSource != null) { CopyTargetEdit target= (CopyTargetEdit)copier.getCopy(this); @@ -118,6 +120,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -128,6 +131,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#traverseConsistencyCheck */ + @Override int traverseConsistencyCheck(TextEditProcessor processor, IDocument document, List sourceEdits) { return super.traverseConsistencyCheck(processor, document, sourceEdits) + 1; } @@ -135,6 +139,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#performConsistencyCheck */ + @Override void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { if (fSource == null) throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.no_source")); //$NON-NLS-1$ @@ -145,6 +150,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { String source= fSource.getContent(); document.replace(getOffset(), getLength(), source); @@ -156,6 +162,7 @@ public final class CopyTargetEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java b/org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java index f5c08386107..8338b4a865d 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/CopyingRangeMarker.java @@ -46,6 +46,7 @@ public final class CopyingRangeMarker extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new CopyingRangeMarker(this); } @@ -53,6 +54,7 @@ public final class CopyingRangeMarker extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -63,6 +65,7 @@ public final class CopyingRangeMarker extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { fText= document.get(getOffset(), getLength()); fDelta= 0; @@ -72,6 +75,7 @@ public final class CopyingRangeMarker extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java index 9eb364ebde3..041cb7d53b5 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/DeleteEdit.java @@ -43,6 +43,7 @@ public final class DeleteEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new DeleteEdit(this); } @@ -50,6 +51,7 @@ public final class DeleteEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -60,6 +62,7 @@ public final class DeleteEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$ fDelta= -getLength(); @@ -69,6 +72,7 @@ public final class DeleteEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return true; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java b/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java index 872256385c4..981c94a4560 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/EditDocument.java @@ -30,166 +30,207 @@ class EditDocument implements IDocument { fBuffer= new StringBuffer(content); } + @Override public void addDocumentListener(IDocumentListener listener) { throw new UnsupportedOperationException(); } + @Override public void addDocumentPartitioningListener(IDocumentPartitioningListener listener) { throw new UnsupportedOperationException(); } + @Override public void addPosition(Position position) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException { throw new UnsupportedOperationException(); } + @Override public void addPositionCategory(String category) { throw new UnsupportedOperationException(); } + @Override public void addPositionUpdater(IPositionUpdater updater) { throw new UnsupportedOperationException(); } + @Override public void addPrenotifiedDocumentListener(IDocumentListener documentAdapter) { throw new UnsupportedOperationException(); } + @Override public int computeIndexInCategory(String category, int offset) throws BadLocationException, BadPositionCategoryException { throw new UnsupportedOperationException(); } + @Override public int computeNumberOfLines(String text) { throw new UnsupportedOperationException(); } + @Override public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public boolean containsPosition(String category, int offset, int length) { throw new UnsupportedOperationException(); } + @Override public boolean containsPositionCategory(String category) { throw new UnsupportedOperationException(); } + @Override public String get() { return fBuffer.toString(); } + @Override public String get(int offset, int length) throws BadLocationException { return fBuffer.substring(offset, offset + length); } + @Override public char getChar(int offset) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public String getContentType(int offset) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public IDocumentPartitioner getDocumentPartitioner() { throw new UnsupportedOperationException(); } + @Override public String[] getLegalContentTypes() { throw new UnsupportedOperationException(); } + @Override public String[] getLegalLineDelimiters() { throw new UnsupportedOperationException(); } + @Override public int getLength() { return fBuffer.length(); } + @Override public String getLineDelimiter(int line) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public IRegion getLineInformation(int line) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public IRegion getLineInformationOfOffset(int offset) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public int getLineLength(int line) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public int getLineOffset(int line) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public int getLineOfOffset(int offset) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public int getNumberOfLines() { throw new UnsupportedOperationException(); } + @Override public int getNumberOfLines(int offset, int length) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public ITypedRegion getPartition(int offset) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public String[] getPositionCategories() { throw new UnsupportedOperationException(); } + @Override public Position[] getPositions(String category) throws BadPositionCategoryException { throw new UnsupportedOperationException(); } + @Override public IPositionUpdater[] getPositionUpdaters() { throw new UnsupportedOperationException(); } + @Override public void insertPositionUpdater(IPositionUpdater updater, int index) { throw new UnsupportedOperationException(); } + @Override public void removeDocumentListener(IDocumentListener listener) { throw new UnsupportedOperationException(); } + @Override public void removeDocumentPartitioningListener(IDocumentPartitioningListener listener) { throw new UnsupportedOperationException(); } + @Override public void removePosition(Position position) { throw new UnsupportedOperationException(); } + @Override public void removePosition(String category, Position position) throws BadPositionCategoryException { throw new UnsupportedOperationException(); } + @Override public void removePositionCategory(String category) throws BadPositionCategoryException { throw new UnsupportedOperationException(); } + @Override public void removePositionUpdater(IPositionUpdater updater) { throw new UnsupportedOperationException(); } + @Override public void removePrenotifiedDocumentListener(IDocumentListener documentAdapter) { throw new UnsupportedOperationException(); } + @Override public void replace(int offset, int length, String text) throws BadLocationException { fBuffer.replace(offset, offset + length, text); } @@ -199,14 +240,18 @@ class EditDocument implements IDocument { * * @deprecated As of 3.0 search is provided by {@link FindReplaceDocumentAdapter} */ + @Deprecated + @Override public int search(int startOffset, String findString, boolean forwardSearch, boolean caseSensitive, boolean wholeWord) throws BadLocationException { throw new UnsupportedOperationException(); } + @Override public void set(String text) { throw new UnsupportedOperationException(); } + @Override public void setDocumentPartitioner(IDocumentPartitioner partitioner) { throw new UnsupportedOperationException(); } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java index 226fded3733..5d0a5dd6c59 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/InsertEdit.java @@ -60,6 +60,7 @@ public final class InsertEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new InsertEdit(this); } @@ -67,6 +68,7 @@ public final class InsertEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -77,6 +79,7 @@ public final class InsertEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), fText); fDelta= fText.length() - getLength(); @@ -86,14 +89,12 @@ public final class InsertEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } - /* - * @see org.eclipse.text.edits.TextEdit#internalToString(java.lang.StringBuffer, int) - * @since 3.3 - */ + @Override void internalToString(StringBuffer buffer, int indent) { super.internalToString(buffer, indent); buffer.append(" <<").append(fText); //$NON-NLS-1$ diff --git a/org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java index e720c144e95..25f56b4010e 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/MoveSourceEdit.java @@ -149,6 +149,7 @@ public final class MoveSourceEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new MoveSourceEdit(this); } @@ -156,6 +157,7 @@ public final class MoveSourceEdit extends TextEdit { /* * @see TextEdit#postProcessCopy */ + @Override protected void postProcessCopy(TextEditCopier copier) { if (fTarget != null) { MoveSourceEdit source= (MoveSourceEdit)copier.getCopy(this); @@ -170,6 +172,7 @@ public final class MoveSourceEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -179,6 +182,7 @@ public final class MoveSourceEdit extends TextEdit { //---- consistency check ---------------------------------------------------------------- + @Override int traverseConsistencyCheck(TextEditProcessor processor, IDocument document, List sourceEdits) { int result= super.traverseConsistencyCheck(processor, document, sourceEdits); // Since source computation takes place in a recursive fashion (see @@ -203,6 +207,7 @@ public final class MoveSourceEdit extends TextEdit { return result; } + @Override void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { if (fTarget == null) throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.no_target")); //$NON-NLS-1$ @@ -216,6 +221,7 @@ public final class MoveSourceEdit extends TextEdit { //---- source computation -------------------------------------------------------------- + @Override void traverseSourceComputation(TextEditProcessor processor, IDocument document) { // always perform source computation independent of processor.considerEdit // The target might need the source and the source is computed in a @@ -223,6 +229,7 @@ public final class MoveSourceEdit extends TextEdit { performSourceComputation(processor, document); } + @Override void performSourceComputation(TextEditProcessor processor, IDocument document) { try { TextEdit[] children= removeChildren(); @@ -260,6 +267,7 @@ public final class MoveSourceEdit extends TextEdit { //---- document updating ---------------------------------------------------------------- + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$ fDelta= -getLength(); @@ -271,6 +279,7 @@ public final class MoveSourceEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java index 0a812a21b79..1815ca28545 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/MoveTargetEdit.java @@ -98,6 +98,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new MoveTargetEdit(this); } @@ -105,6 +106,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#postProcessCopy */ + @Override protected void postProcessCopy(TextEditCopier copier) { if (fSource != null) { MoveTargetEdit target= (MoveTargetEdit)copier.getCopy(this); @@ -117,6 +119,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -129,6 +132,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#traverseConsistencyCheck */ + @Override int traverseConsistencyCheck(TextEditProcessor processor, IDocument document, List sourceEdits) { return super.traverseConsistencyCheck(processor, document, sourceEdits) + 1; } @@ -136,6 +140,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#performConsistencyCheck */ + @Override void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { if (fSource == null) throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveTargetEdit.no_source")); //$NON-NLS-1$ @@ -148,6 +153,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { String source= fSource.getContent(); document.replace(getOffset(), getLength(), source); @@ -174,6 +180,7 @@ public final class MoveTargetEdit extends TextEdit { /* * @see org.eclipse.text.edits.TextEdit#traversePassThree */ + @Override int traverseRegionUpdating(TextEditProcessor processor, IDocument document, int accumulatedDelta, boolean delete) { // the children got already updated / normalized while they got removed // from the source edit. So we only have to adjust the offset computed to @@ -186,6 +193,7 @@ public final class MoveTargetEdit extends TextEdit { return accumulatedDelta + fDelta; } + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java index b32b348a313..c1dcb81f555 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/MultiTextEdit.java @@ -86,18 +86,14 @@ public class MultiTextEdit extends TextEdit { // does nothing } - /** - * {@inheritDoc} - */ + @Override final boolean isDefined() { if (fDefined) return true; return hasChildren(); } - /** - * {@inheritDoc} - */ + @Override public final int getOffset() { if (fDefined) return super.getOffset(); @@ -109,9 +105,7 @@ public class MultiTextEdit extends TextEdit { return ((TextEdit)children.get(0)).getOffset(); } - /** - * {@inheritDoc} - */ + @Override public final int getLength() { if (fDefined) return super.getLength(); @@ -125,9 +119,7 @@ public class MultiTextEdit extends TextEdit { return last.getOffset() - first.getOffset() + last.getLength(); } - /** - * {@inheritDoc} - */ + @Override public final boolean covers(TextEdit other) { if (fDefined) return super.covers(other); @@ -135,9 +127,7 @@ public class MultiTextEdit extends TextEdit { return true; } - /* - * @see org.eclipse.text.edits.TextEdit#canZeroLengthCover() - */ + @Override protected boolean canZeroLengthCover() { return true; } @@ -145,6 +135,7 @@ public class MultiTextEdit extends TextEdit { /* * @see TextEdit#copy */ + @Override protected TextEdit doCopy() { Assert.isTrue(MultiTextEdit.class == getClass(), "Subclasses must reimplement copy0"); //$NON-NLS-1$ return new MultiTextEdit(this); @@ -153,6 +144,7 @@ public class MultiTextEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -160,19 +152,13 @@ public class MultiTextEdit extends TextEdit { } } - /* - * @see org.eclipse.text.edits.TextEdit#adjustOffset(int) - * @since 3.1 - */ + @Override void adjustOffset(int delta) { if (fDefined) super.adjustOffset(delta); } - /* - * @see org.eclipse.text.edits.TextEdit#adjustLength(int) - * @since 3.1 - */ + @Override void adjustLength(int delta) { if (fDefined) super.adjustLength(delta); @@ -181,6 +167,7 @@ public class MultiTextEdit extends TextEdit { /* * @see TextEdit#performConsistencyCheck */ + @Override void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException { checkIntegrity(); } @@ -188,6 +175,7 @@ public class MultiTextEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { fDelta= 0; return fDelta; @@ -196,10 +184,12 @@ public class MultiTextEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } + @Override void aboutToBeAdded(TextEdit parent) { defineRegion(parent.getOffset()); } @@ -218,10 +208,7 @@ public class MultiTextEdit extends TextEdit { fDefined= true; } - /* - * @see org.eclipse.text.edits.TextEdit#internalToString(java.lang.StringBuffer, int) - * @since 3.3 - */ + @Override void internalToString(StringBuffer buffer, int indent) { super.internalToString(buffer, indent); if (! fDefined) diff --git a/org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java b/org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java index 68a43e55fa7..673ed497296 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/RangeMarker.java @@ -41,6 +41,7 @@ public final class RangeMarker extends TextEdit { /* * @see TextEdit#copy */ + @Override protected TextEdit doCopy() { return new RangeMarker(this); } @@ -48,6 +49,7 @@ public final class RangeMarker extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -58,6 +60,7 @@ public final class RangeMarker extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { fDelta= 0; return fDelta; @@ -66,6 +69,7 @@ public final class RangeMarker extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java index b8b488762fb..bd13a6911fc 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/ReplaceEdit.java @@ -61,6 +61,7 @@ public final class ReplaceEdit extends TextEdit { /* * @see TextEdit#doCopy */ + @Override protected TextEdit doCopy() { return new ReplaceEdit(this); } @@ -68,6 +69,7 @@ public final class ReplaceEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -78,6 +80,7 @@ public final class ReplaceEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { document.replace(getOffset(), getLength(), fText); fDelta= fText.length() - getLength(); @@ -87,14 +90,12 @@ public final class ReplaceEdit extends TextEdit { /* * @see TextEdit#deleteChildren */ + @Override boolean deleteChildren() { return true; } - /* - * @see org.eclipse.text.edits.TextEdit#internalToString(java.lang.StringBuffer, int) - * @since 3.3 - */ + @Override void internalToString(StringBuffer buffer, int indent) { super.internalToString(buffer, indent); buffer.append(" <<").append(fText); //$NON-NLS-1$ diff --git a/org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java index c304a12270f..b3aba990a9c 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/TextEdit.java @@ -99,6 +99,7 @@ public abstract class TextEdit { public static final int UPDATE_REGIONS= 1 << 1; private static class InsertionComparator implements Comparator { + @Override public int compare(Object o1, Object o2) throws MalformedTreeException { TextEdit edit1= (TextEdit)o1; TextEdit edit2= (TextEdit)o2; @@ -496,6 +497,7 @@ public abstract class TextEdit { * * @see Object#equals(java.lang.Object) */ + @Override public final boolean equals(Object obj) { return this == obj; // equivalent to Object.equals } @@ -509,13 +511,12 @@ public abstract class TextEdit { * * @see Object#hashCode() */ + @Override public final int hashCode() { return super.hashCode(); } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { StringBuffer buffer= new StringBuffer(); toStringWithChildren(buffer, 0); diff --git a/org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java b/org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java index d69e60e7a02..86f8e1861fc 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/UndoCollector.java @@ -46,6 +46,7 @@ class UndoCollector implements IDocumentListener { } } + @Override public void documentChanged(DocumentEvent event) { fLength+= getDelta(event); } @@ -55,6 +56,7 @@ class UndoCollector implements IDocumentListener { return text == null ? -event.getLength() : (text.length() - event.getLength()); } + @Override public void documentAboutToBeChanged(DocumentEvent event) { int offset= event.getOffset(); int currentLength= event.getLength(); diff --git a/org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java b/org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java index ed714f6c694..57601327cab 100644 --- a/org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java +++ b/org.eclipse.text/src/org/eclipse/text/edits/UndoEdit.java @@ -39,31 +39,27 @@ public final class UndoEdit extends TextEdit { super(other); } - /* - * @see org.eclipse.text.edits.TextEdit#internalAdd(org.eclipse.text.edits.TextEdit) - */ + @Override void internalAdd(TextEdit child) throws MalformedTreeException { throw new MalformedTreeException(null, this, TextEditMessages.getString("UndoEdit.no_children")); //$NON-NLS-1$ } - /* - * @see org.eclipse.text.edits.MultiTextEdit#aboutToBeAdded(org.eclipse.text.edits.TextEdit) - */ + @Override void aboutToBeAdded(TextEdit parent) { throw new MalformedTreeException(parent, this, TextEditMessages.getString("UndoEdit.can_not_be_added")); //$NON-NLS-1$ } + @Override UndoEdit dispatchPerformEdits(TextEditProcessor processor) throws BadLocationException { return processor.executeUndo(); } + @Override void dispatchCheckIntegrity(TextEditProcessor processor) throws MalformedTreeException { processor.checkIntegrityUndo(); } - /* - * @see org.eclipse.text.edits.TextEdit#doCopy() - */ + @Override protected TextEdit doCopy() { return new UndoEdit(this); } @@ -71,6 +67,7 @@ public final class UndoEdit extends TextEdit { /* * @see TextEdit#accept0 */ + @Override protected void accept0(TextEditVisitor visitor) { boolean visitChildren= visitor.visit(this); if (visitChildren) { @@ -81,6 +78,7 @@ public final class UndoEdit extends TextEdit { /* * @see TextEdit#performDocumentUpdating */ + @Override int performDocumentUpdating(IDocument document) throws BadLocationException { fDelta= 0; return fDelta; @@ -100,6 +98,7 @@ public final class UndoEdit extends TextEdit { internalSetLength(length); } + @Override boolean deleteChildren() { return false; } diff --git a/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java b/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java index 6f36f682d37..7f15f60f664 100644 --- a/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java +++ b/org.eclipse.text/src/org/eclipse/text/undo/DocumentUndoManager.java @@ -128,9 +128,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { fPreservedText= null; } - /* - * @see org.eclipse.core.commands.operations.IUndoableOperation#dispose() - */ + @Override public void dispose() { reinitialize(); } @@ -150,9 +148,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { } } - /* - * @see org.eclipse.core.commands.operations.IUndoableOperation#canUndo() - */ + @Override public boolean canUndo() { if (isValid()) { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) { @@ -220,9 +216,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return false; } - /* - * @see org.eclipse.core.commands.operations.IUndoableOperation#canRedo() - */ + @Override public boolean canRedo() { if (isValid()) { if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) { @@ -238,16 +232,12 @@ public class DocumentUndoManager implements IDocumentUndoManager { return false; } - /* - * @see org.eclipse.core.commands.operations.IUndoableOperation#canExecute() - */ + @Override public boolean canExecute() { return fDocumentUndoManager.isConnected(); } - /* - * @see org.eclipse.core.commands.operations.IUndoableOperation.IUndoableOperation#execute(IProgressMonitor, IAdaptable) - */ + @Override public IStatus execute(IProgressMonitor monitor, IAdaptable uiInfo) { // Text changes execute as they are typed, so executing one has no // effect. @@ -258,6 +248,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { * {@inheritDoc} * Notifies clients about the undo. */ + @Override public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { if (isValid()) { fDocumentUndoManager.fireDocumentUndo(fStart, fPreservedText, fText, uiInfo, DocumentUndoEvent.ABOUT_TO_UNDO, false); @@ -290,6 +281,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { * @param uiInfo an adaptable that can provide UI info if needed * @return the status */ + @Override public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { if (isValid()) { fDocumentUndoManager.fireDocumentUndo(fStart, fText, fPreservedText, uiInfo, DocumentUndoEvent.ABOUT_TO_REDO, false); @@ -377,9 +369,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return fStart > -1 && fEnd > -1 && fText != null; } - /* - * @see java.lang.Object#toString() - */ + @Override public String toString() { String delimiter= ", "; //$NON-NLS-1$ StringBuffer text= new StringBuffer(super.toString()); @@ -452,9 +442,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { fChanges.add(change); } - /* - * @see org.eclipse.text.undo.UndoableTextChange#undo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ + @Override public IStatus undo(IProgressMonitor monitor, IAdaptable uiInfo) { int size= fChanges.size(); @@ -475,9 +463,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return Status.OK_STATUS; } - /* - * @see org.eclipse.text.undo.UndoableTextChange#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) - */ + @Override public IStatus redo(IProgressMonitor monitor, IAdaptable uiInfo) { int size= fChanges.size(); @@ -498,9 +484,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return Status.OK_STATUS; } - /* - * @see org.eclipse.text.undo.UndoableTextChange#updateTextChange() - */ + @Override protected void updateTextChange() { // first gather the data from the buffers super.updateTextChange(); @@ -519,9 +503,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { reinitialize(); } - /* - * @see org.eclipse.text.undo.UndoableTextChange#createCurrent() - */ + @Override protected UndoableTextChange createCurrent() { if (!fDocumentUndoManager.fFoldingIntoCompoundChange) @@ -531,9 +513,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return this; } - /* - * @see org.eclipse.text.undo.UndoableTextChange#commit() - */ + @Override protected void commit() { // if there is pending data, update the text change if (fStart > -1) @@ -542,16 +522,12 @@ public class DocumentUndoManager implements IDocumentUndoManager { fDocumentUndoManager.resetProcessChangeState(); } - /* - * @see org.eclipse.text.undo.UndoableTextChange#isValid() - */ + @Override protected boolean isValid() { return fStart > -1 || fChanges.size() > 0; } - /* - * @see org.eclipse.text.undo.UndoableTextChange#getUndoModificationStamp() - */ + @Override protected long getUndoModificationStamp() { if (fStart > -1) return super.getUndoModificationStamp(); @@ -562,9 +538,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return fUndoModificationStamp; } - /* - * @see org.eclipse.text.undo.UndoableTextChange#getRedoModificationStamp() - */ + @Override protected long getRedoModificationStamp() { if (fStart > -1) return super.getRedoModificationStamp(); @@ -584,9 +558,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { private String fReplacedText; - /* - * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void documentAboutToBeChanged(DocumentEvent event) { try { fReplacedText= event.getDocument().get(event.getOffset(), @@ -597,9 +569,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { } } - /* - * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent) - */ + @Override public void documentChanged(DocumentEvent event) { fPreservedRedoModificationStamp= event.getModificationStamp(); @@ -646,6 +616,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { private IUndoableOperation fOperation; + @Override public void historyNotification(final OperationHistoryEvent event) { final int type= event.getEventType(); switch (type) { @@ -785,30 +756,22 @@ public class DocumentUndoManager implements IDocumentUndoManager { fDocumentUndoListeners= new ListenerList(ListenerList.IDENTITY); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#addDocumentUndoListener(org.eclipse.jface.text.IDocumentUndoListener) - */ + @Override public void addDocumentUndoListener(IDocumentUndoListener listener) { fDocumentUndoListeners.add(listener); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#removeDocumentUndoListener(org.eclipse.jface.text.IDocumentUndoListener) - */ + @Override public void removeDocumentUndoListener(IDocumentUndoListener listener) { fDocumentUndoListeners.remove(listener); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#getUndoContext() - */ + @Override public IUndoContext getUndoContext() { return fUndoContext; } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#commit() - */ + @Override public void commit() { // if fCurrent has never been placed on the history, do so now. // this can happen when there are multiple programmatically commits in a @@ -821,9 +784,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { fCurrent.commit(); } - /* - * @see org.eclipse.text.undo.IDocumentUndoManager#reset() - */ + @Override public void reset() { if (isConnected()) { shutdown(); @@ -831,16 +792,12 @@ public class DocumentUndoManager implements IDocumentUndoManager { } } - /* - * @see org.eclipse.text.undo.IDocumentUndoManager#redoable() - */ + @Override public boolean redoable() { return OperationHistoryFactory.getOperationHistory().canRedo(fUndoContext); } - /* - * @see org.eclipse.text.undo.IDocumentUndoManager#undoable() - */ + @Override public boolean undoable() { return OperationHistoryFactory.getOperationHistory().canUndo(fUndoContext); } @@ -848,22 +805,19 @@ public class DocumentUndoManager implements IDocumentUndoManager { /* * @see org.eclipse.text.undo.IDocumentUndoManager#undo() */ + @Override public void redo() throws ExecutionException { if (isConnected() && redoable()) OperationHistoryFactory.getOperationHistory().redo(getUndoContext(), null, null); } - /* - * @see org.eclipse.text.undo.IDocumentUndoManager#undo() - */ + @Override public void undo() throws ExecutionException { if (undoable()) OperationHistoryFactory.getOperationHistory().undo(fUndoContext, null, null); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#connect(java.lang.Object) - */ + @Override public void connect(Object client) { if (!isConnected()) { initialize(); @@ -872,9 +826,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { fConnected.add(client); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#disconnect(java.lang.Object) - */ + @Override public void disconnect(Object client) { fConnected.remove(client); if (!isConnected()) { @@ -882,9 +834,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { } } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#beginCompoundChange() - */ + @Override public void beginCompoundChange() { if (isConnected()) { fFoldingIntoCompoundChange= true; @@ -892,9 +842,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { } } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#endCompoundChange() - */ + @Override public void endCompoundChange() { if (isConnected()) { fFoldingIntoCompoundChange= false; @@ -905,6 +853,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { /* * @see org.eclipse.jface.text.IDocumentUndoManager#setUndoLimit(int) */ + @Override public void setMaximalUndoLevel(int undoLimit) { fHistory.setLimit(fUndoContext, undoLimit); } @@ -1237,9 +1186,7 @@ public class DocumentUndoManager implements IDocumentUndoManager { return !fConnected.isEmpty(); } - /* - * @see org.eclipse.jface.text.IDocumentUndoManager#transferUndoHistory(IDocumentUndoManager) - */ + @Override public void transferUndoHistory(IDocumentUndoManager manager) { IUndoContext oldUndoContext= manager.getUndoContext(); // Get the history for the old undo context. |