Tools__LintAnnotation.st
author Claus Gittinger <cg@exept.de>
Fri, 28 Aug 2015 09:53:22 +0200
changeset 15814 2817c7c730c2
parent 15524 c317a60d78b5
child 15566 184cea584be5
child 16298 d2b0b69d8bc7
permissions -rw-r--r--
applied changeset 15810:9e6f3799b239 jv Fixed couple stupid bugs in MethodRewriter Namely: * When rewriting, operate only on methods which matches the search pattern * Correctly interpret \"method pattern\" checkbox (there was inverted condition). Both bugs rendered rewriter unusable. Now it works again.

"{ Encoding: utf8 }"

"
 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:'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'!

line
    ^ line
!

line:anInteger
    line := anInteger.
!

rule
    ^ rule
!

rule:anRBLintRule
    rule := anRBLintRule.

    "Modified: / 15-12-2014 / 13:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!LintAnnotation methodsFor:'help'!

helpTextFor:aView
    |info|

    rule notNil ifTrue:[
        rule isComposite ifTrue:[
            info := rule rules 
                        collect:[:each | (aView resources string:each infoInToolTip)] as:Set.
            info size > 1 ifTrue:[
                info := info collect:[:each | '- ',each].
            ].
            info := info asStringCollection asStringWith:Character cr. 
        ] ifFalse:[
            info := aView resources string:rule infoInToolTip
        ].

        ^ aView resources 
                stringWithCRs:'Lint says:\%1' "/ 'Lint says: %1\Click for more info.' 
                with:info.
    ].
    ^ nil
! !

!LintAnnotation methodsFor:'printing & storing'!

printOn:aStream
    "append a user printed representation of the receiver to aStream.
    The format is suitable for a human - not meant to be read back."

    self basicPrintOn: aStream.
    aStream nextPut: $(.
    line printOn: aStream.
    aStream nextPut: $).

    "Modified: / 15-12-2014 / 13:41:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!LintAnnotation class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintAnnotation.st,v 1.6 2015-03-19 11:04:03 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/Tools__LintAnnotation.st,v 1.6 2015-03-19 11:04:03 cg Exp $'
! !