Tools__LintAnnotation.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 28 Aug 2013 12:52:38 +0100
branchjv
changeset 13465 1f1e8b6710c8
parent 12431 9f0c59c742d5
child 15566 184cea584be5
permissions -rw-r--r--
Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown. This actually fixes DNU when CodeView2 is used in diff view. Then the second gutter is not shown and #yOfTextViewLine: returns nil (bad) which leads to DNU.

"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

Object subclass:#LintAnnotation
	instanceVariableNames:'startPosition endPosition line rule'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Lint'
!

!LintAnnotation class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!LintAnnotation class methodsFor:'instance creation'!

from: start to: end rule: rule

    ^self new
        startPosition: start;
        endPosition: end;
        rule: rule;
        yourself.

    "Created: / 30-01-2012 / 15:23:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!LintAnnotation methodsFor:'accessing'!

endPosition
    ^ endPosition
!

endPosition:anInteger
    endPosition := anInteger.
!

line
    ^ line
!

line:anInteger
    line := anInteger.
!

rule
    ^ rule
!

rule:anRBLintRule
    self assert: anRBLintRule isComposite not.
    rule := anRBLintRule.

    "Modified: / 30-01-2012 / 15:22:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

startPosition
    ^ startPosition
!

startPosition:anInteger
    startPosition := anInteger.
! !

!LintAnnotation methodsFor:'comparing'!

< anObject

    anObject isNumber ifTrue:[^startPosition < anObject].
    anObject class == self class ifFalse:[^false].

    ^endPosition < anObject startPosition

    "Created: / 14-02-2010 / 13:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

<= aMagnitude
    "return true, if the argument is greater or equal than the receiver"

    ^ (aMagnitude < self) not
!

= anObject

    anObject class == self class ifFalse:[^false].

    ^startPosition == (anObject startPosition) and:
        [endPosition == (anObject endPosition) and:
            [rule = anObject rule]]

    "Created: / 14-02-2010 / 13:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

> aMagnitude
    "return true, if the argument is less than the receiver"

    ^ aMagnitude < self
!

>= aMagnitude
    "return true, if the argument is less or equal than the receiver"

    ^ (self < aMagnitude) not
! !

!LintAnnotation class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
!

version_SVN
    ^ '$Id: Tools__LintAnnotation.st 7854 2012-01-30 17:49:41Z vranyj1 $'
! !