diff options
author | Markus Keller | 2015-11-29 21:11:24 +0000 |
---|---|---|
committer | Markus Keller | 2015-12-01 01:50:38 +0000 |
commit | 64b34b614087b96e6cc92c72143768b98ae32602 (patch) | |
tree | 4f4f493fd8161f9a5885f11021cd14a923946e9f /org.eclipse.text/projection | |
parent | f01dd079500e382823d5d1767996cb9ef85233ee (diff) | |
download | eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.gz eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.tar.xz eclipse.platform.text-64b34b614087b96e6cc92c72143768b98ae32602.zip |
Bug 478673: added @Override/@Deprecated and removed non-Javadoc boilerplate
Diffstat (limited to 'org.eclipse.text/projection')
8 files changed, 45 insertions, 128 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; |