SmallSenseClassInfo.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 06 Aug 2013 02:55:01 +0100
changeset 53 84e9840dd522
parent 32 658f47bc231e
permissions -rw-r--r--
Inprovement in code completion: close completion list after Tab pressed if there are no more alternatives.

"{ Package: 'jv:smallsense' }"

SmallSenseInfo subclass:#SmallSenseClassInfo
	instanceVariableNames:'className methods instvars'
	classVariableNames:''
	poolDictionaries:''
	category:'SmallSense-Model'
!


!SmallSenseClassInfo class methodsFor:'instance creation'!

new
    "return an initialized instance"

    ^ self basicNew initialize.
! !

!SmallSenseClassInfo methodsFor:'accessing'!

className
    ^ className
!

infoForInstvar: ivarName

    ^instvars at: ivarName ifAbsentPut:[
        SmallSenseType default.
    ]

    "Created: / 27-11-2011 / 16:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

infoForInstvarOrNil: ivarName

    ^instvars at: ivarName ifAbsent: nil

    "Created: / 27-11-2011 / 17:15:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

infoForSelector: selector

    ^methods at: selector ifAbsentPut:[
        SmallSenseMethodInfo new setManager: manager classInfo: self selector: selector.

    ]

    "Created: / 27-11-2011 / 16:26:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

infoForSelectorOrNil: selector

    ^methods at: selector ifAbsent:nil

    "Created: / 27-11-2011 / 17:15:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

superclassInfo

    | nm meta cls |

    (className endsWith:' class') ifTrue:[
        nm := (className copyTo: className size - 6) asSymbol.
        meta := true.
    ] ifFalse:[
        nm := className asSymbol.
        meta := false.
    ].
    cls := Smalltalk at: nm.
    cls isNil ifTrue:[ ^ nil ].
    meta ifTrue:[cls := cls theMetaclass].

    ^ manager infoForClass: cls superclass

    "Modified: / 29-11-2011 / 16:02:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseClassInfo methodsFor:'initialization'!

initialize
    "Invoked when a new instance is created."

    "/ please change as required (and remove this comment)
    "/ superclassInfo := nil.
    "/ className := nil.
    methods := Dictionary new.
    instvars := Dictionary new.

    "/ super initialize.   -- commented since inherited method does nothing

    "Modified: / 27-11-2011 / 16:53:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

setManager: mgr className: nm

    manager := mgr.
    className := nm

    "Created: / 29-11-2011 / 15:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SmallSenseClassInfo class methodsFor:'documentation'!

version_HG

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

version_SVN
    ^ '$Id: SmallSenseClassInfo.st 7840 2011-12-16 08:48:11Z vranyj1 $'
! !