diff options
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/source')
16 files changed, 122 insertions, 122 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java index 3b96efa606a..cddb1370434 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationBarHoverManager.java @@ -664,7 +664,7 @@ public class AnnotationBarHoverManager extends AbstractHoverInformationControlMa } return super.computeInformationControlLocation(subjectArea, controlSize); } - + @Override protected Point computeLocation(Rectangle subjectArea, Point controlSize, Anchor anchor) { MouseEvent event= getHoverEvent(); diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java index ef1addf1982..93a20c2f4fa 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationPainter.java @@ -1100,7 +1100,7 @@ public class AnnotationPainter implements IPainter, PaintListener, IAnnotationMo * Adds the given annotation type to the list of annotation types whose annotations should be * painted by this painter using squiggly drawing. If the annotation type is already in this * list, this method is without effect. - * + * * @param annotationType the annotation type * @deprecated As of 3.4 replaced by * {@link #addTextStyleStrategy(Object, AnnotationPainter.ITextStyleStrategy)} and @@ -1115,7 +1115,7 @@ public class AnnotationPainter implements IPainter, PaintListener, IAnnotationMo * Adds the given annotation type to the list of annotation types whose annotations should be * painted by this painter using the given strategy. If the annotation type is already in this * list, the old strategy gets replaced. - * + * * @param annotationType the annotation type * @param strategyID the id of the drawing or text style strategy that should be used for this * annotation type @@ -1517,7 +1517,7 @@ public class AnnotationPainter implements IPainter, PaintListener, IAnnotationMo /** * Returns the widget region that corresponds to the * given offset and length in the viewer's document. - * + * * The returned object can be the fReusableRegion and may used * only to read the return values and must not used to store * the region. diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java index 8954752f27f..8000691121e 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/AnnotationRulerColumn.java @@ -700,7 +700,7 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul int lines= endLine - startLine; if (startLine != endLine || !isWrapActive || length <= 0) { - // line height for different lines includes wrapped line info already, + // line height for different lines includes wrapped line info already, // end we show annotations without offset info at very first line anyway r.height= JFaceTextUtil.computeLineHeight(fCachedTextWidget, startLine, endLine + 1, lines + 1); r.y= JFaceTextUtil.computeLineHeight(fCachedTextWidget, 0, startLine, startLine) - fScrollPos; @@ -809,7 +809,7 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul int lines= endLine - startLine; if(startLine != endLine || !isWrapActive || length <= 0){ - // line height for different lines includes wrapped line info already, + // line height for different lines includes wrapped line info already, // end we show annotations without offset info at very first line anyway r.height= JFaceTextUtil.computeLineHeight(fCachedTextWidget, startLine, endLine + 1, lines + 1); r.y= JFaceTextUtil.computeLineHeight(fCachedTextWidget, 0, startLine, startLine) - fScrollPos; @@ -819,7 +819,7 @@ public class AnnotationRulerColumn implements IVerticalRulerColumn, IVerticalRul r.height= textBounds.height; r.y = textBounds.y; } - + if (r.y < dimension.y && fAnnotationAccessExtension != null) // annotation within visible area fAnnotationAccessExtension.paint(annotation, gc, fCanvas, r); } diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java index d4a4c57337e..51f3d83102e 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/DefaultCharacterPairMatcher.java @@ -38,12 +38,12 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar * specified partitioning. The specified list of characters must have the form <blockquote>{ * <i>start</i>, <i>end</i>, <i>start</i>, <i>end</i>, ..., <i>start</i>, <i>end</i> * }</blockquote> For instance: - * + * * <pre> * char[] chars = new char[] {'(', ')', '{', '}', '[', ']'}; * new DefaultCharacterPairMatcher(chars, ...); * </pre> - * + * * @param chars a list of characters * @param partitioning the partitioning to match within */ @@ -56,12 +56,12 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar * specified partitioning. The specified list of characters must have the form <blockquote>{ * <i>start</i>, <i>end</i>, <i>start</i>, <i>end</i>, ..., <i>start</i>, <i>end</i> * }</blockquote> For instance: - * + * * <pre> * char[] chars = new char[] {'(', ')', '{', '}', '[', ']'}; * new DefaultCharacterPairMatcher(chars, ...); * </pre> - * + * * @param chars a list of characters * @param partitioning the partitioning to match within * @param caretEitherSideOfBracket controls the matching behavior. When <code>true</code>, the @@ -82,12 +82,12 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar * Creates a new character pair matcher that matches characters within the default partitioning. * The specified list of characters must have the form <blockquote>{ <i>start</i>, <i>end</i>, * <i>start</i>, <i>end</i>, ..., <i>start</i>, <i>end</i> }</blockquote> For instance: - * + * * <pre> * char[] chars= new char[] { '(', ')', '{', '}', '[', ']' }; * new DefaultCharacterPairMatcher(chars); * </pre> - * + * * @param chars a list of characters */ public DefaultCharacterPairMatcher(char[] chars) { @@ -197,12 +197,12 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar String currEndContentType= TextUtilities.getContentType(document, fPartitioning, currentEndOffset, false); if (!prevEndContentType.equals(currEndContentType)) return true; - + String prevStartContentType= TextUtilities.getContentType(document, fPartitioning, previousStartOffset, true); String currStartContentType= TextUtilities.getContentType(document, fPartitioning, currentStartOffset, true); if (!prevStartContentType.equals(currStartContentType)) return true; - + int start; int end; if (currentEndOffset > previousEndOffset) { @@ -217,7 +217,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar return true; } } - + if (currentStartOffset > previousStartOffset) { start= previousStartOffset; end= currentStartOffset; @@ -239,7 +239,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Computes the adjustment in the start offset for the purpose of finding a matching peer. This * is required as the direction of selection can be right-to-left or left-to-right. - * + * * @param document the document to work on * @param offset the start offset * @param length the selection length @@ -347,7 +347,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar */ private IRegion findEnclosingPeers(IDocument document, DocumentPartitionAccessor doc, int offset, int length, int lowerBoundary, int upperBoundary) throws BadLocationException { char[] pairs= fPairs.fPairs; - + int start; int end; if (length >= 0) { @@ -357,7 +357,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar end= offset; start= offset + length; } - + boolean lowerFound= false; boolean upperFound= false; int[][] counts= new int[pairs.length][2]; @@ -371,12 +371,12 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar pos1= start; pos2= doc.getNextPosition(start, true); } - + while ((pos1 >= lowerBoundary && !lowerFound) || (pos2 < upperBoundary && !upperFound)) { for (int i= 0; i < counts.length; i++) { counts[i][0]= counts[i][1]= 0; } - + outer1: while (pos1 >= lowerBoundary && !lowerFound) { final char c= doc.getChar(pos1); int i= getCharacterIndex(c, document, pos1); @@ -395,7 +395,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar } pos1= doc.getNextPosition(pos1, false); } - + outer2: while (pos2 < upperBoundary && !upperFound) { final char c= doc.getChar(pos2); int i= getCharacterIndex(c, document, pos2); @@ -414,7 +414,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar } pos2= doc.getNextPosition(pos2, true); } - + if (pos1 > start || pos2 < end - 1) { //match inside selection => discard pos1= doc.getNextPosition(pos1, false); @@ -432,7 +432,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Determines the index of the character in the char array passed to the constructor of the pair * matcher. - * + * * @param ch the character * @param document the document * @param offset the offset in document @@ -582,7 +582,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Returns true if the specified character occurs in one of the character pairs. - * + * * @param c a character * @return true exactly if the character occurs in one of the pairs */ @@ -613,7 +613,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Returns true if the specified character is a start character. - * + * * @param c a character * @return true exactly if the character is a start character */ @@ -623,7 +623,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Returns true if the specified character is an end character. - * + * * @param c a character * @return true exactly if the character is an end character * @since 3.8 @@ -634,7 +634,7 @@ public class DefaultCharacterPairMatcher implements ICharacterPairMatcher, IChar /** * Returns the matching character for the specified character. - * + * * @param c a character occurring in a character pair * @return the matching character */ diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcher.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcher.java index d916eb9997c..d89ef7d0491 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcher.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcher.java @@ -21,7 +21,7 @@ import org.eclipse.jface.text.IRegion; * of the initial offset. The matcher then searches for the matching peer character of the chosen * character and if it finds one, delivers the minimal region of the document that contains both * characters. - * + * * <p> * In order to provide backward compatibility for clients of <code>ICharacterPairMatcher</code>, * extension interfaces are used to provide a means of evolution. The following extension interface @@ -36,7 +36,7 @@ import org.eclipse.jface.text.IRegion; * Clients may implement this interface and its extension interface or use the default * implementation provided by <code>DefaultCharacterPairMatcher</code>. * </p> - * + * * @see org.eclipse.jface.text.source.ICharacterPairMatcherExtension * @since 2.1 */ @@ -68,13 +68,13 @@ public interface ICharacterPairMatcher { * Starting at the given offset, the matcher chooses a character close to this offset. The * matcher then searches for the matching peer character of the chosen character and if it finds * one, returns the minimal region of the document that contains both characters. - * + * * <p> * Since version 3.8 the recommended way for finding matching peers is to use * {@link org.eclipse.jface.text.source.ICharacterPairMatcherExtension#match(IDocument, int, int)} * . * </p> - * + * * @param document the document to work on * @param offset the start offset * @return the minimal region containing the peer characters or <code>null</code> if there is no @@ -86,7 +86,7 @@ public interface ICharacterPairMatcher { * Returns the anchor for the region of the matching peer characters. The anchor says whether * the character that has been chosen to search for its peer character has been the left or the * right character of the pair. - * + * * @return <code>RIGHT</code> or <code>LEFT</code> */ int getAnchor(); diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java index 9d01713f698..bfb7fb88b8e 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ICharacterPairMatcherExtension.java @@ -18,7 +18,7 @@ import org.eclipse.jface.text.IRegion; * <p> * Extends the character pair matcher with the concept of matching peer character and enclosing peer * characters for a given selection. - * + * * @see org.eclipse.jface.text.source.ICharacterPairMatcher * @since 3.8 */ @@ -28,7 +28,7 @@ public interface ICharacterPairMatcherExtension { * Starting at the given offset (i.e. length 0) or the selected character, the matcher searches * for the matching peer character and if it finds one, returns the minimal region of the * document that contains both characters. - * + * * @param document the document to work on * @param offset the start offset * @param length the selection length which can be negative indicating right-to-left selection @@ -41,7 +41,7 @@ public interface ICharacterPairMatcherExtension { /** * Starting at the given selection, the matcher searches for a pair of enclosing peer characters * and if it finds one, returns the minimal region of the document that contains the pair. - * + * * @param document the document to work on * @param offset the start offset * @param length the selection length which can be negative indicating right-to-left selection @@ -52,7 +52,7 @@ public interface ICharacterPairMatcherExtension { /** * Checks whether the character is one of the characters matched by the pair matcher. - * + * * @param ch the character * @return <code>true</code> if the the character is one of the characters matched by the pair * matcher, and <code>false</code> otherwise @@ -61,12 +61,12 @@ public interface ICharacterPairMatcherExtension { /** * Checks whether the character is one of the characters matched by the pair matcher. - * + * * <p> * Clients can use this method to handle characters which may have special meaning in some * situations. E.g. in Java, '<' is used as an angular bracket and as well as less-than operator. * </p> - * + * * @param ch the character * @param document the document * @param offset the offset in document @@ -78,14 +78,14 @@ public interface ICharacterPairMatcherExtension { /** * Computes whether a client needs to recompute the enclosing pair after a selection change in * the document. - * + * * <p> * This is intended to be a quick test to determine whether a re-computation of the enclosing pair is * required, as the re-computation after each selection change via a * {@link #findEnclosingPeerCharacters(IDocument, int, int)} call can be expensive for some * clients. * </p> - * + * * @param document the document to work on * @param currentSelection the current selection in the document * @param previousSelection the previous selection in the document diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.java index 2248b1a2e4c..44168fc4557 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRuler.java @@ -40,7 +40,7 @@ import org.eclipse.swt.widgets.Control; * Clients may implement this interface or use the default implementation provided by * <code>OverviewRuler</code>. * </p> - * + * * @see org.eclipse.jface.text.ITextViewer * @see org.eclipse.jface.text.source.IOverviewRulerExtension * @since 2.1 diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRulerExtension.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRulerExtension.java index 82fcc0a63c2..341bd20880a 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRulerExtension.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/IOverviewRulerExtension.java @@ -16,7 +16,7 @@ package org.eclipse.jface.text.source; * <p> * Allows to set whether to use saturated colors in the overview ruler. * </p> - * + * * @see org.eclipse.jface.text.source.IOverviewRuler * @since 3.8 */ @@ -27,7 +27,7 @@ public interface IOverviewRulerExtension { * <p> * The initial value is defined by the ruler implementation. * </p> - * + * * @param useSaturatedColors <code>true</code> if saturated colors should be used, * <code>false</code> otherwise */ diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewer.java index caa4ce9b66a..d8f4c2373b4 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewer.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/ISourceViewer.java @@ -93,7 +93,7 @@ public interface ISourceViewer extends ITextViewer { * @since 3.2 */ int QUICK_ASSIST= ITextOperationTarget.STRIP_PREFIX + 10; - + /* * XXX: Next free number is HyperlinkManager.OPEN_HYPERLINK + 1 */ @@ -170,7 +170,7 @@ public interface ISourceViewer extends ITextViewer { /** * Sets the viewers's range indication to the specified range. It is indicated whether the * cursor should also be moved to the beginning of the specified range. - * + * * @param offset the offset of the range * @param length the length of the range * @param moveCursor indicates whether the cursor should be moved to the given offset diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineChangeHover.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineChangeHover.java index 4b1bc516477..fe1912ae89d 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineChangeHover.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineChangeHover.java @@ -139,7 +139,7 @@ public class LineChangeHover implements IAnnotationHover, IAnnotationHoverExtens return trimTrailing(text.toString()); } } - + text = new StringBuffer(text.toString().trim()); if (text.length() == 0 && added-- > 0 && maxLines-- > 0) { text.append("+ ");//$NON-NLS-1$ diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberChangeRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberChangeRulerColumn.java index daf6e4c4c96..5a41b5db854 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberChangeRulerColumn.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberChangeRulerColumn.java @@ -30,7 +30,7 @@ import org.eclipse.jface.text.revisions.RevisionInformation; /** * A vertical ruler column displaying line numbers and serving as a UI for quick diff. Clients * usually instantiate and configure object of this class. - * + * * @since 3.0 * @noextend This class is not intended to be subclassed by clients. */ @@ -328,7 +328,7 @@ public class LineNumberChangeRulerColumn extends LineNumberRulerColumn implement fDiffPainter.setModel(null); super.handleDispose(); } - + @Override void handleMouseScrolled(MouseEvent e) { if (fRevisionPainter.isWheelHandlerInstalled()) { diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java index 2d944d157de..d0671754d82 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/LineNumberRulerColumn.java @@ -917,7 +917,7 @@ public class LineNumberRulerColumn implements IVerticalRulerColumn { /** * Handles mouse scrolled events on the ruler by forwarding them to the text widget. - * + * * @param e the mouse event * @since 3.10 */ diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java index d1d6670ef97..f7afc6b1767 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/MatchingCharacterPainter.java @@ -38,7 +38,7 @@ import org.eclipse.jface.text.TextEvent; * <p> * Clients instantiate and configure an object of this class. * </p> - * + * * @since 2.1 */ public final class MatchingCharacterPainter implements IPainter, PaintListener { @@ -62,42 +62,42 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Whether to highlight enclosing peer characters or not. - * + * * @since 3.8 */ private boolean fHighlightEnclosingPeerCharacters; /** * Whether to highlight the character at caret location or not. - * + * * @since 3.8 */ private boolean fHighlightCharacterAtCaretLocation; /** * Whether a character is present at caret location or not. - * + * * @since 3.8 */ private boolean fCharacterPresentAtCaretLocation; /** * The previous selection, used to determine the need for computing enclosing brackets. - * + * * @since 3.8 */ private IRegion fPreviousSelection; /** * Previous length of the document this painter is associated with. - * + * * @since 3.8 */ private int fPreviousLengthOfDocument; /** * The text viewer change listener. - * + * * @since 3.8 */ private TextListener fTextListener; @@ -118,7 +118,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Sets whether to highlight the character at caret location or not. - * + * * @param highlightCharacterAtCaretLocation whether to highlight the character at caret location * or not * @since 3.8 @@ -130,7 +130,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Sets whether to highlight enclosing peer characters or not. - * + * * @param highlightEnclosingPeerCharcters whether to highlight enclosing peer characters or not * @since 3.8 */ @@ -185,7 +185,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Handles a redraw request. * - * @param gc the GC to draw into or <code>null</code> to send a redraw request if necessary + * @param gc the GC to draw into or <code>null</code> to send a redraw request if necessary */ private void handleDrawRequest(GC gc) { @@ -272,7 +272,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { * <p> * The selection offset is model based. * </p> - * + * * @param sourceViewer the source viewer * @return a region denoting the current signed selection, for a resulting RtoL selections * length is < 0 @@ -398,15 +398,15 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Installs or uninstalls the text listener depending on the boolean parameter. - * + * * @param install <code>true</code> to install the text listener, <code>false</code> to uninstall - * + * * @since 3.8 */ private void installUninstallTextListener(boolean install) { if (!(fMatcher instanceof ICharacterPairMatcherExtension)) return; - + if (install) { fTextListener= new TextListener(); fSourceViewer.addTextListener(fTextListener); @@ -421,7 +421,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Listens to document changes and if required by those document changes causes a re-computation * of matching characters. - * + * * @since 3.8 */ private class TextListener implements ITextListener { @@ -446,7 +446,7 @@ public final class MatchingCharacterPainter implements IPainter, PaintListener { /** * Searches for matched characters in the given string. - * + * * @param text the string to search * @param matcher the pair matcher * @return <code>true</code> if a matched character is found, <code>false</code> otherwise diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java index 64b492046c3..763054ef53f 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/OverviewRuler.java @@ -67,7 +67,7 @@ import org.eclipse.jface.text.source.projection.AnnotationBag; * <p> * Clients usually instantiate and configure objects of this class. * </p> - * + * * @since 2.1 */ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { @@ -272,7 +272,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { Point s= fHeader.getSize(); e.gc.setBackground(fIndicatorColor); - + Rectangle headerBounds= fHeader.getBounds(); boolean isOnTop= headerBounds.y + headerBounds.height <= fCanvas.getLocation().y; boolean isTall= s.y > s.x + 2*ANNOTATION_HEIGHT; @@ -306,7 +306,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { /** * Container for cached widget infos. - * + * * @since 3.7 */ static class WidgetInfos { @@ -334,10 +334,10 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { * the writable area in the text widget (height of all lines in pixels) */ int writable; - + /** * Initializes the widget infos. - * + * * @param textWidget the text widget * @param canvas the overview ruler canvas */ @@ -345,7 +345,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { maxLines= textWidget.getLineCount(); bounds= canvas.getBounds(); writable= JFaceTextUtil.computeLineHeight(textWidget, 0, maxLines, maxLines); - + ScrollBar verticalBar= textWidget.getVerticalBar(); if (verticalBar != null && !verticalBar.getVisible()) { // Note: when the vertical bar is invisible, the thumbHeight is not reliable, @@ -364,17 +364,17 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { } else { thumbHeight= verticalBar != null ? Math.max(Math.min(bounds.height, verticalBar.getThumbBounds().height), 0) : 0; } - + int partialTopIndex= JFaceTextUtil.getPartialTopIndex(textWidget); int topLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialTopIndex)); int topLinePixel= textWidget.getLinePixel(partialTopIndex); double topIndex= partialTopIndex - (double) topLinePixel / topLineHeight; - + int partialBottomIndex= JFaceTextUtil.getPartialBottomIndex(textWidget); int bottomLineHeight= textWidget.getLineHeight(textWidget.getOffsetAtLine(partialBottomIndex)); int bottomLinePixel= textWidget.getLinePixel(partialBottomIndex); double bottomIndex= partialBottomIndex - ((double) bottomLinePixel - textWidget.getClientArea().height) / bottomLineHeight; - + visibleLines= bottomIndex - topIndex; invisibleLines= maxLines - visibleLines; } @@ -383,7 +383,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { private static final boolean DEBUG_DRAW= false; private static final boolean DEBUG_COMPUTE_Y= false; private static final boolean DEBUG_TO_DOCUMENT_LINE_NUMBER= false; - + private static final int INSET= 2; private static final int ANNOTATION_HEIGHT= 4; private static boolean ANNOTATION_HEIGHT_SCALABLE= true; @@ -493,10 +493,10 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { * @since 3.4 */ private boolean fIsTemporaryAnnotationDiscolored; - + /** * Tells whether saturated colors are used in the overview ruler. - * + * * @since 3.8 */ private boolean fUseSaturatedColors= false; @@ -620,7 +620,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { handleMouseScrolled(e); } }); - + if (fTextViewer != null) { fTextViewer.addTextListener(fInternalListener); // on word wrap toggle a "resized" ControlEvent is fired: suggest a redraw of the ruler @@ -746,7 +746,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { visible= fTextViewer.getVisibleRegion(); // legacy support WidgetInfos infos= null; - + for (Iterator<Object> iterator= fAnnotationsSortedByLayer.iterator(); iterator.hasNext();) { Object annotationType= iterator.next(); @@ -781,7 +781,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { if (widgetRegion == null) continue; } - + if (infos == null) { infos= new WidgetInfos(textWidget, fCanvas); r.x= INSET; @@ -791,9 +791,9 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { try { int startOffset= visible != null ? annotationOffset - visible.getOffset() : widgetRegion.getOffset(); int startLine= textWidget.getLineAtOffset(startOffset); - + yy= computeY(startLine, infos); - + if (ANNOTATION_HEIGHT_SCALABLE) { int numberOfLines= document.getNumberOfLines(annotationOffset, annotationLength); // don't count empty trailing line @@ -809,7 +809,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { } } fAnnotationHeight= hh; - + if (!areColorsComputed) { stroke= getStrokeColor(annotationType, style[t] == FilterIterator.TEMPORARY); fill= fUseSaturatedColors ? stroke : getFillColor(annotationType, style[t] == FilterIterator.TEMPORARY); @@ -835,7 +835,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { } } } - + if (DEBUG_DRAW) { // draw debugging guides (boundaries): if (infos == null) @@ -845,7 +845,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { gc.drawLine(0, yy, infos.bounds.x/2, yy); yy= infos.bounds.height - infos.thumbHeight / 2; gc.drawLine(0, yy, infos.bounds.x/2, yy); - + gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_BLUE)); yy= 0; gc.drawLine(0, yy, infos.bounds.x/2, yy); @@ -856,7 +856,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { /** * Computes and returns the y location of the given startLine. - * + * * @param startLine the start line * @param infos the cached widget infos * @return the vertical position of the given startLine in the overview ruler @@ -864,23 +864,23 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { */ private int computeY(int startLine, WidgetInfos infos) { // this is the inverse of #toLineNumbers(int) - + int yy; if (infos.bounds.height > infos.writable || infos.invisibleLines <= 0) { // too few lines for relative positions: align annotations with textWidget lines yy = Math.max(0, (2 * startLine + 1) * infos.writable / (infos.maxLines * 2) - infos.bounds.y); if (DEBUG_COMPUTE_Y) System.out.println("static: " + yy); //$NON-NLS-1$ - + } else if (startLine + 1 < infos.visibleLines / 2) { // before middle of first page: map to area from 0 to thumbHeight/2 yy= (int) (startLine * infos.thumbHeight / infos.visibleLines); // == startLine * (thumbHeight / 2) / (visibleLines / 2); if (DEBUG_COMPUTE_Y) System.out.println("start: " + yy); //$NON-NLS-1$ - + } else if (infos.maxLines - infos.visibleLines / 2 <= startLine) { // after middle of last page: map to area from canvasHeight-1 - thumbHeight/2 to canvasHeight-1 yy= (int) (infos.bounds.height-1 - (double)infos.thumbHeight / 2 + (startLine - (infos.maxLines - infos.visibleLines / 2) + 1) * infos.thumbHeight / infos.visibleLines); if (DEBUG_COMPUTE_Y) System.out.println("end: " + yy); //$NON-NLS-1$ - + } else { // middle of text: map to area from thumbHeight/2 to (canvasHeight-1 - thumbHeight/2) yy= (int) ((double)infos.thumbHeight/2 + (startLine + 1 - infos.visibleLines / 2) * (infos.bounds.height-1 - infos.thumbHeight) / infos.invisibleLines); if (DEBUG_COMPUTE_Y) @@ -940,15 +940,15 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { */ private int[] toLineNumbers(int y_coordinate, boolean annotationRect) { // this is the inverse of #computeY(int, WidgetInfos) - + WidgetInfos infos= new WidgetInfos(fTextViewer.getTextWidget(), fCanvas); - + if (y_coordinate >= infos.writable || y_coordinate >= infos.bounds.height || y_coordinate < 0) return new int[] {-1, -1}; - + if (annotationRect && ANNOTATION_HEIGHT >= infos.bounds.height / infos.maxLines) annotationRect= false; - + int[] lines= new int[2]; int[] pixels; @@ -959,28 +959,28 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { int pixelStart= Math.max(y_coordinate - ANNOTATION_HEIGHT / 2 + 1, 0); pixels= new int[] { pixelStart, pixelEnd }; } - + if (infos.bounds.height > infos.writable || infos.invisibleLines <= 0) { // too few lines for relative positions: align annotations with textWidget lines // yy = Math.max(0, (2 * startLine + 1) * infos.writable / (infos.maxLines * 2) - infos.bounds.y); for (int i= 0; i < pixels.length; i++) lines[i]= (int) ((pixels[i] + infos.bounds.y) * infos.maxLines / (double)infos.writable); if (DEBUG_TO_DOCUMENT_LINE_NUMBER) System.out.println("static y: " + y_coordinate + " => [" + lines[0] + ", " + lines[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - + } else if (y_coordinate < infos.thumbHeight / 2) { // before middle of first page: map to area from 0 to thumbHeight/2 // yy= (int) (startLine * infos.thumbHeight / infos.visibleLines); for (int i= 0; i < pixels.length; i++) lines[i] = (int) (pixels[i] * infos.visibleLines / infos.thumbHeight); if (DEBUG_TO_DOCUMENT_LINE_NUMBER) System.out.println("start y: " + y_coordinate + " => [" + lines[0] + ", " + lines[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - + } else if (infos.bounds.height - 1 - infos.thumbHeight / 2 < y_coordinate) { // after middle of last page: map to area from canvasHeight-1 - thumbHeight/2 to canvasHeight-1 // yy= (int) (infos.bounds.height-1 - (double)infos.thumbHeight / 2 + (startLine - (infos.maxLines - infos.visibleLines / 2) + 1) * infos.thumbHeight / infos.visibleLines); for (int i= 0; i < pixels.length; i++) lines[i] = (int) ((pixels[i] - (infos.bounds.height-1) + (double)infos.thumbHeight / 2) * infos.visibleLines / infos.thumbHeight - 1 + (infos.maxLines - infos.visibleLines / 2)); if (DEBUG_TO_DOCUMENT_LINE_NUMBER) System.out.println("end y: " + y_coordinate + " => [" + lines[0] + ", " + lines[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - + } else { // middle of text: map to area from thumbHeight/2 to (canvasHeight-1 - thumbHeight/2) // yy= (int) ((double)infos.thumbHeight/2 + (startLine + 1 - infos.visibleLines / 2) * (infos.bounds.height-1 - infos.thumbHeight) / infos.invisibleLines); for (int i= 0; i < pixels.length; i++) @@ -988,12 +988,12 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { if (DEBUG_TO_DOCUMENT_LINE_NUMBER) System.out.println("middle y: " + y_coordinate + " => [" + lines[0] + ", " + lines[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } - + if (y_coordinate < ANNOTATION_HEIGHT && y_coordinate < infos.bounds.y) lines[0]= 0; else if (lines[0] < 0) lines[0]= 0; - + if (annotationRect) { int y0= computeY(lines[0], infos); if (y_coordinate < y0 || y0 + ANNOTATION_HEIGHT < y_coordinate) { @@ -1004,10 +1004,10 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { lines[1]= lines[0]; } } - + if (lines[1] > infos.maxLines) lines[1]= infos.maxLines; - + if (fTextViewer instanceof ITextViewerExtension5) { ITextViewerExtension5 extension= (ITextViewerExtension5) fTextViewer; lines[0]= extension.widgetLine2ModelLine(lines[0]); @@ -1021,7 +1021,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { } catch (BadLocationException x) { } } - + if (DEBUG_TO_DOCUMENT_LINE_NUMBER) System.out.println("result: [" + lines[0] + ", " + lines[1] + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return lines; @@ -1250,7 +1250,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { Boolean cached= allowed.get(annotationType); if (cached != null) return cached.booleanValue(); - + covered = isCovered(annotationType, configured); allowed.put(annotationType, covered ? Boolean.TRUE : Boolean.FALSE); } @@ -1505,7 +1505,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { if (fHeader.getToolTipText() != null) return; - StringBuffer overview = new StringBuffer(); + StringBuffer overview = new StringBuffer(); for (int i= fAnnotationsSortedByLayer.size() -1; i >= 0; i--) { @@ -1541,7 +1541,7 @@ public class OverviewRuler implements IOverviewRulerExtension, IOverviewRuler { /** * {@inheritDoc} - * + * * @since 3.8 */ @Override diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java index 959293a59e1..b091fbd6c4f 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/SourceViewer.java @@ -92,7 +92,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** The gap between the text viewer and the vertical ruler. */ protected int fGap; - + /** * Cached arrow heights of the vertical scroll bar: An array containing {topArrowHeight, bottomArrowHeight}. * @since 3.6 @@ -158,16 +158,16 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi if (overviewRulerWidth != -1) { if (scrollbarHeight <= 0) scrollbarHeight= overviewRulerWidth; - + int bottomOffset= clArea.y + clArea.height - scrollbarHeight; int[] arrowHeights= getVerticalScrollArrowHeights(textWidget, bottomOffset); - + int overviewRulerX= clArea.x + clArea.width - overviewRulerWidth - 1; boolean noSpaceForHeader= (arrowHeights[0] <= 0 && arrowHeights[1] <= 0 && !hScrollVisible); Control headerControl= fOverviewRuler.getHeaderControl(); Control rulerControl= fOverviewRuler.getControl(); if (noSpaceForHeader) { - // If we don't have space to draw because we don't have arrows and the horizontal scroll is invisible, + // If we don't have space to draw because we don't have arrows and the horizontal scroll is invisible, // use the whole space for the ruler and leave the headerControl without any space (will actually be invisible). rulerControl.setBounds(overviewRulerX, clArea.y, overviewRulerWidth, clArea.height); headerControl.setBounds(0, 0, 0, 0); @@ -188,18 +188,18 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** * Computes and caches the arrow heights of the vertical scroll bar. - * + * * @param textWidget the StyledText * @param bottomOffset y-coordinate of the bottom of the overview ruler area * @return an array containing {topArrowHeight, bottomArrowHeight} - * + * * @since 3.6 */ private int[] getVerticalScrollArrowHeights(StyledText textWidget, int bottomOffset) { ScrollBar verticalBar= textWidget.getVerticalBar(); if (verticalBar == null || !verticalBar.getVisible()) return new int[] { 0, 0 }; - + int[] arrowHeights= computeScrollArrowHeights(textWidget, bottomOffset); if (arrowHeights[0] > 0 || arrowHeights[1] > 0) { fScrollArrowHeights= arrowHeights; @@ -224,11 +224,11 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** * Computes the arrow heights of the vertical scroll bar. - * + * * @param textWidget the StyledText * @param bottomOffset y-coordinate of the bottom of the overview ruler area * @return an array containing {topArrowHeight, bottomArrowHeight} - * + * * @since 3.6 */ private int[] computeScrollArrowHeights(StyledText textWidget, int bottomOffset) { @@ -239,7 +239,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi // SWT returns bogus values on Windows when the control is too small, see https://bugs.eclipse.org/485540 return new int[] { 0, 0 }; } - + int topArrowHeight= thumbTrackBounds.y; int bottomArrowHeight= bottomOffset - (thumbTrackBounds.y + thumbTrackBounds.height); return new int[] { topArrowHeight, bottomArrowHeight }; @@ -826,7 +826,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** * Position storing block selection information in order to maintain a column selection. - * + * * @since 3.5 */ private static final class ColumnPosition extends Position { @@ -1177,7 +1177,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** * Adds the give column as last column to this viewer's vertical ruler. - * + * * @param column the column to be added * @since 3.8 */ @@ -1191,7 +1191,7 @@ public class SourceViewer extends TextViewer implements ISourceViewer, ISourceVi /** * Removes the give column from this viewer's vertical ruler. - * + * * @param column the column to be removed * @since 3.8 */ diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRulerEvent.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRulerEvent.java index 73481fbea0b..2efa88bf76e 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRulerEvent.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/source/VerticalRulerEvent.java @@ -58,9 +58,9 @@ public class VerticalRulerEvent { public void setSelectedAnnotation(Annotation annotation) { fAnnotation= annotation; } - + /** - * @return the SWT event that triggered this vertical ruler event, or <code>null</code>. + * @return the SWT event that triggered this vertical ruler event, or <code>null</code>. * @since 3.8 */ public Event getEvent() { |