HierarchicalVersionDiffBrowser.st
changeset 2614 6358729321c5
parent 2549 68695c53b707
child 2626 4ee750caddab
--- a/HierarchicalVersionDiffBrowser.st	Tue Feb 15 17:49:32 2000 +0100
+++ b/HierarchicalVersionDiffBrowser.st	Tue Feb 15 17:50:37 2000 +0100
@@ -273,6 +273,41 @@
 
 !HierarchicalVersionDiffBrowser class methodsFor:'startup'!
 
+openOnClassRevisionInfo:aClassRevisionInfoColl
+    |theBrowser theTree|
+
+    SourceCodeManager isNil ifTrue:[
+        self warn:'SourceCodeManagement is disabled.\\I will not be able to show old versions.' withCRs.
+    ].
+    theBrowser := self new.
+    theTree := self tree new.
+    theTree classItemClass: ClassNameItem.
+    theTree setUpClassItemBlock:[
+        |theClassRevisionInfoColl root theClassItemColl |
+        self halt.
+        root := ClassItemRoot new.
+        (theClassRevisionInfoColl := self classHolder value) notNil ifTrue:[
+            theClassItemColl := theClassRevisionInfoColl collect:[:eachClass |
+                |theClassItem theClass|
+                theClassItem := ClassNameItem new.
+               theClassItem myClass:(eachClass at:1).
+                theClassItem].
+           root addAll: theClassItemColl.
+        ].  
+        self listModel root:root.
+    ].
+    theBrowser classTree:theTree.
+    theBrowser allButOpen.
+    theTree classHolder:(theBrowser classHolder value:aClassRevisionInfoColl).
+    "theTree selectionHolder:theBrowser treeSelectionHolder."
+    "theTree menuBlock:theBrowser menuBlock."
+    theBrowser openWindow.
+    ^theBrowser
+"
+self openOnClassRevisionInfo:#(#(VersionDiffBrowser 1.1 1.2) #(FileBrowser 1.1 1.2) #(Array 1.1 1.2)).
+"
+!
+
 openOnClasses:aClassColl
     |theBrowser theTree|
 
@@ -356,6 +391,33 @@
     ^ holder.
 ! !
 
+!HierarchicalVersionDiffBrowser methodsFor:'change & update'!
+
+delayedUpdate
+
+    self halt.
+
+!
+
+update:something with:someArgument from:changedObject
+    |sensor|
+
+    "/ delayed update
+    "/ if such an update is already in the queue, ignore it.
+    "/ Otherwise push it as an event, to be handled when I am back
+
+    (sensor := self window sensor) isNil 
+        ifTrue:[^ self delayedUpdate].
+
+    (sensor hasEvent:#delayedUpdate for:self ) 
+        ifTrue:[^ self].
+
+    sensor pushUserEvent:#delayedUpdate for:self
+
+
+
+! !
+
 !HierarchicalVersionDiffBrowser methodsFor:'menu'!
 
 menuForClassItemSelected
@@ -467,7 +529,10 @@
     |theItemColl theItem|
 
     theItemColl := self treeSelectionHolder value.
-    ^(theItemColl size == 1) and:[(theItem := theItemColl first) isRevisionItem and:[theItem hasSourceStream]]
+    ^(theItemColl size == 1) and:
+        [(theItem := theItemColl first) isRevisionItem and:
+        [theItem isSourceRevisionItem not and:
+        [theItem hasSourceStream]]]
 !
 
 checkIfTwoRevisionItemsSelected
@@ -544,5 +609,5 @@
 !HierarchicalVersionDiffBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/HierarchicalVersionDiffBrowser.st,v 1.7 2000-01-14 17:21:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/HierarchicalVersionDiffBrowser.st,v 1.8 2000-02-15 16:50:37 ps Exp $'
 ! !