SmallSenseResultItem.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 06 Sep 2012 17:38:47 +0100
changeset 28 f516772ba2b8
parent 0 893cc7b0ed1d
child 29 fe650a6e5704
permissions -rw-r--r--
- SmallSenseChecker class definition added: #initialize #new changed: #checkMethodsForClass: - extensions ...

"{ Package: 'stx:libtool/smallsense' }"

Object subclass:#SmallSenseResultItem
	instanceVariableNames:'subject icon label name description'
	classVariableNames:''
	poolDictionaries:''
	category:'SmallSense-Core'
!


!SmallSenseResultItem class methodsFor:'Instance Creation'!

name: name description:description

    ^ self new name:name; description:description.

    "Created: / 04-04-2011 / 13:46:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseResultItem class methodsFor:'Instance creation'!

subject: anObject

    ^self new subject: anObject

    "Created: / 06-04-2011 / 21:01:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseResultItem methodsFor:'accessing'!

cursorColumnAfterComplete

    "Answers a cursor column after completion. The number returned
     is relative to the start of the text being replaced"

    ^name size + 1

    "Created: / 05-04-2011 / 17:05:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

description
    ^ description
!

description:something
    description := something.
!

icon

    ^nil

    "Created: / 04-04-2011 / 17:25:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

label

    label ifNil:[label := name].
    ^label

    "Created: / 07-04-2011 / 09:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

name
    ^ name
!

name:something
    name := something.
!

stringToComplete

    "Answers a string to complete"

    ^name

    "Created: / 05-04-2011 / 16:48:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

subject
    ^ subject
!

subject:something
    subject := something.
! !

!SmallSenseResultItem methodsFor:'displaying'!

displayOn:aGc x:x y:y opaque:opaque

    | icon |
    icon := self icon.
    icon ifNotNil:[icon displayOn:aGc x:x y:y - icon height opaque:opaque].
    self label displayOn:aGc x:x + 16 y:y opaque:opaque

    "Created: / 04-04-2011 / 17:25:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 08-04-2011 / 22:36:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseResultItem methodsFor:'new'!

name:nam description:desc 
    name := nam.
    description := desc.

    "Created: / 16-03-2011 / 16:31:13 / Jakub <zelenja7@fel.cvut.cz>"
! !

!SmallSenseResultItem methodsFor:'printing & storing'!

printOn:aStream
    "append a printed representation if the receiver to the argument, aStream"

    super printOn:aStream.
    aStream nextPut:$(.
    name printOn:aStream.
    aStream nextPut:$).

    "Modified: / 04-04-2011 / 12:02:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseResultItem methodsFor:'queries'!

startsWith: prefix

    ^self stringToComplete startsWith: prefix

    "Created: / 26-11-2011 / 19:25:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseResultItem methodsFor:'testing'!

isSmallSenseClass
    ^ false
!

isSmallSenseConstant
    ^ false
!

isSmallSenseMethod
    ^ false
!

isSmallSenseSnippet
    ^ false
!

isSmallSenseVariable
    ^ false
! !

!SmallSenseResultItem class methodsFor:'documentation'!

version_SVN
    ^ '$Id: SmallSenseResultItem.st 7825 2011-11-26 18:32:31Z vranyj1 $'
! !