some common startup protocol between DiffViewer and VersionDiffBrowser
authorClaus Gittinger <cg@exept.de>
Fri, 18 Aug 2000 00:51:40 +0200
changeset 2716 8451e7057f00
parent 2715 a7bcbf85f2ea
child 2717 dc997032a34e
some common startup protocol between DiffViewer and VersionDiffBrowser
BrowserView.st
DiffTextView.st
VersionDiffBrowser.st
--- a/BrowserView.st	Fri Aug 18 00:24:18 2000 +0200
+++ b/BrowserView.st	Fri Aug 18 00:51:40 2000 +0200
@@ -4474,19 +4474,13 @@
 
                 self busyLabel:'comparing  ...' with:nil.
 
-                (UserPreferences current useNewVersionDiffBrowser) ifTrue:[
-                    VersionDiffBrowser 
-                          openOnClass:currentClass
-                          labelA:'current: (based on: ' , thisRevString , ')'
-                          sourceA:currentSource
-                          labelB:('repository: ' , revString)
-                          sourceB:comparedSource.
-                ] ifFalse:[
-                    v := DiffTextView 
-                        openOn:currentSource label:'current: (based on: ' , thisRevString , ')'
-                        and:comparedSource label:'repository: ' , revString.      
-                    v label:'comparing ' , nm.
-                ]
+                UserPreferences current versionDiffViewerClass
+                  openOnClass:currentClass
+                  labelA:('current: (based on: ' , thisRevString , ')')
+                  sourceA:currentSource
+                  labelB:('repository: ' , revString)
+                  sourceB:comparedSource
+                  title:('comparing ' , currentClass name).
             ].
             self normalLabel.
         ]
@@ -14144,6 +14138,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.629 2000-08-05 16:37:48 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.630 2000-08-17 22:51:40 cg Exp $'
 ! !
 BrowserView initialize!
--- a/DiffTextView.st	Fri Aug 18 00:24:18 2000 +0200
+++ b/DiffTextView.st	Fri Aug 18 00:51:40 2000 +0200
@@ -10,6 +10,8 @@
  hereby transferred.
 "
 
+"{ Package: 'stx:libtool' }"
+
 TwoColumnTextView subclass:#DiffTextView
 	instanceVariableNames:'useColors showSeparators addedColor addedBgColor removedColor
 		removedBgColor changedColor changedBgColor changedSpacesOnlyColor
@@ -99,6 +101,29 @@
 "
 ! !
 
+!DiffTextView class methodsFor:'instance creation'!
+
+openOnClass:someClass labelA:lblA sourceA:sourceA labelB:lblB sourceB:sourceB
+    "provided for protocol compatibility with the VersionDiffBrowser;
+     actually, the class is ignored here"
+
+    ^ self openOnClass:someClass labelA:lblA sourceA:sourceA labelB:lblB sourceB:sourceB 
+           title:'comparing ' , someClass name.
+!
+
+openOnClass:someClass labelA:lblA sourceA:sourceA labelB:lblB sourceB:sourceB title:title
+    "provided for protocol compatibility with the VersionDiffBrowser;
+     actually, the class is ignored here"
+
+    |v|
+
+    v := self DiffTextView 
+                openOn:sourceA label:lblA
+                and:sourceB label:lblB.      
+    v label:title.
+    ^ v
+! !
+
 !DiffTextView class methodsFor:'defaults'!
 
 diffCommand
@@ -562,5 +587,5 @@
 !DiffTextView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.28 1999-07-16 00:03:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/DiffTextView.st,v 1.29 2000-08-17 22:51:21 cg Exp $'
 ! !
--- a/VersionDiffBrowser.st	Fri Aug 18 00:24:18 2000 +0200
+++ b/VersionDiffBrowser.st	Fri Aug 18 00:51:40 2000 +0200
@@ -508,6 +508,18 @@
 
 <return: VersionDiffBrowser>
 "
+    ^ self
+        openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB 
+        title:nil
+!
+
+openOnClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB title:ignoredTitle
+"
+create an VersionDiffBrowser instance and set the class change set of the
+browser. The class diff set is generated from two source files.
+
+<return: VersionDiffBrowser>
+"
     |theBrowser|
 
     theBrowser := self new.
@@ -515,8 +527,6 @@
     theBrowser setupForClass:aClass labelA:aLabelA sourceA:aSourceA labelB:aLabelB sourceB:aSourceB.
     theBrowser openWindow.
     ^ theBrowser.
-
-
 !
 
 openOnClass:aClass versionA:aVersionA versionB:aVersionB
@@ -1678,5 +1688,5 @@
 !VersionDiffBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.27 2000-08-17 22:23:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/VersionDiffBrowser.st,v 1.28 2000-08-17 22:51:13 cg Exp $'
 ! !