initial checkin
authorps
Wed, 29 Dec 1999 15:53:21 +0100
changeset 2516 736908782aa1
parent 2515 eacfc080e08f
child 2517 69888372f495
initial checkin
ClassItem.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ClassItem.st	Wed Dec 29 15:53:21 1999 +0100
@@ -0,0 +1,96 @@
+AbstractVersionDiffBrowserItem subclass:#ClassItem
+	instanceVariableNames:'myClass childrensComputed'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Browsers'
+!
+
+
+!ClassItem methodsFor:'accessing'!
+
+myClass
+    "return the value of the instance variable 'myClass' (automatically generated)"
+
+    ^ myClass!
+
+myClass:something
+    "set the value of the instance variable 'myClass' (automatically generated)"
+
+    myClass := something.!
+
+setChildrensForRevisionInfo:aRevisionInfo
+
+    |theChildrens|
+
+    aRevisionInfo isNil
+        ifTrue: [theChildrens := Array with:(SourceRevisionItem newForRevision:nil)]
+        ifFalse:[theChildrens := (aRevisionInfo at:#revisions) collect:[:eachRevision|
+                    |theRevisionItem|
+                    theRevisionItem := VersionRevisionItem newForRevision:eachRevision.
+                    theRevisionItem].
+                self isMyClassChanged
+                    ifTrue:[theChildrens addFirst:(SourceRevisionItem newForRevision:myClass revisionInfo)]].
+    theChildrens do:[:aChild | aChild parent:self].
+    childrensComputed:=true.
+    self addAll:theChildrens
+! !
+
+!ClassItem methodsFor:'initialization'!
+
+initialize
+
+
+    childrensComputed := false
+! !
+
+!ClassItem methodsFor:'protocol'!
+
+children
+"returns list of children. The revision for the class myClass
+are computed via the sourcecode manager. Only when the childrens
+are needed, they are calculated.
+
+<return: nil|List>
+"  
+    childrensComputed ifFalse:[
+        self application getRevisionInfoForClassItem:self.
+    ].
+    ^children
+
+!
+
+hasChildren
+"a class items has always childs
+
+<return: Boolean>
+"
+
+     ^true
+!
+
+label
+
+   ^myClass name
+
+
+! !
+
+!ClassItem methodsFor:'testing'!
+
+isClassItem
+
+    ^true
+
+
+!
+
+isMyClassChanged
+
+    ^Project isClassChanged: myClass  
+! !
+
+!ClassItem class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libtool/ClassItem.st,v 1.1 1999-12-29 14:53:21 ps Exp $'
+! !