Tools__TextDiffTool.st
changeset 13861 85705b58dba5
parent 12574 4b07dbee292f
child 14073 9fce54d27da9
--- a/Tools__TextDiffTool.st	Wed Feb 05 20:00:38 2014 +0100
+++ b/Tools__TextDiffTool.st	Wed Feb 05 20:02:13 2014 +0100
@@ -14,9 +14,10 @@
 "{ NameSpace: Tools }"
 
 ApplicationModel subclass:#TextDiffTool
-	instanceVariableNames:'titleHolder labelAHolder textAHolder labelBHolder textBHolder
-		classHolder languageHolder codeAspectHolder showDiffHolder
-		diffSpecHolder diffView textAChanged textBChanged codeView'
+	instanceVariableNames:'labelHolder labelAHolder textAHolder labelBHolder textBHolder
+		labelCHolder textCHolder languageHolder codeAspectHolder
+		textAChanged textBChanged textCChanged contentSpecHolder diffView
+		classHolder'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Diff'
@@ -36,6 +37,30 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
+!
+
+documentation
+"
+    documentation to be added.
+
+    [author:]
+        Jan Vrany <jan.vrany@fit.cvut.cz>
+
+    [instance variables:]
+
+    [class variables:]
+
+    [see also:]
+
+"
+!
+
+examples
+"
+    See
+        - TextDiff2Tool examples
+        - TextDiff3Tool examples
+"
 ! !
 
 !TextDiffTool class methodsFor:'image specs'!
@@ -59,243 +84,17 @@
     ^ToolbarIconLibrary versionBase24x24
 
     "Created: / 24-03-2010 / 20:50:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+versionMerged24x24
+
+    ^ToolbarIconLibrary versionMerged24x24
+
+    "Created: / 17-03-2012 / 12:18:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool class methodsFor:'interface specs'!
 
-diffSpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#diffSpec
-     Tools::TextDiffTool new openInterface:#diffSpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-     #(FullSpec
-        name: diffSpec
-        window: 
-       (WindowSpec
-          label: 'Text Diff Tool (for embedding)'
-          name: 'Text Diff Tool (for embedding)'
-          min: (Point 10 10)
-          bounds: (Rectangle 0 0 782 506)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (ViewSpec
-              name: '2Labels'
-              layout: (LayoutFrame 0 0 0 0 -16 1 30 0)
-              component: 
-             (SpecCollection
-                collection: (
-                 (UISubSpecification
-                    name: 'VersionA'
-                    layout: (LayoutFrame 0 0 0 0 0 0.5 30 0)
-                    minorKey: versionALabelSpec
-                  )
-                 (UISubSpecification
-                    name: 'VersionB'
-                    layout: (LayoutFrame 5 0.5 0 0 0 1 30 0)
-                    minorKey: versionBLabelSpec
-                  )
-                 )
-               
-              )
-            )
-           (ArbitraryComponentSpec
-              name: 'Diff2TextView'
-              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
-              hasHorizontalScrollBar: false
-              hasVerticalScrollBar: false
-              autoHideScrollBars: false
-              hasBorder: false
-              component: #'Tools::DiffCodeView2'
-              postBuildCallback: postBuildDiffView:
-            )
-           )
-         
-        )
-      )
-!
-
-nothingSpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#nothingSpec
-     Tools::TextDiffTool new openInterface:#nothingSpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-     #(FullSpec
-        name: nothingSpec
-        window: 
-       (WindowSpec
-          label: 'NewApplication'
-          name: 'NewApplication'
-          bounds: (Rectangle 0 0 300 300)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (LabelSpec
-              label: 'Nothing selected...'
-              name: 'Label1'
-              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
-              translateLabel: true
-            )
-           )
-         
-        )
-      )
-!
-
-textViewSpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#textViewSpec
-     Tools::TextDiffTool new openInterface:#textViewSpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-     #(FullSpec
-        name: 'textViewSpec'
-        window: 
-       (WindowSpec
-          label: 'Text Only'
-          name: 'Text Only'
-          min: (Point 10 10)
-          bounds: (Rectangle 0 0 782 506)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (ArbitraryComponentSpec
-              name: 'CodeView'
-              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
-              model: textAHolder
-              hasHorizontalScrollBar: false
-              hasVerticalScrollBar: false
-              autoHideScrollBars: false
-              hasBorder: false
-              component: #'Tools::CodeView2'
-              postBuildCallback: postBuildCodeView:
-            )
-           )
-         
-        )
-      )
-!
-
-versionAOnlySpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#versionAOnlySpec
-     Tools::TextDiffTool new openInterface:#versionAOnlySpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-     #(FullSpec
-        name: versionAOnlySpec
-        window: 
-       (WindowSpec
-          label: 'Version A Only'
-          name: 'Version A Only'
-          min: (Point 10 10)
-          bounds: (Rectangle 0 0 782 506)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (UISubSpecification
-              name: 'VersionA'
-              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
-              minorKey: versionALabelSpec
-            )
-           (UISubSpecification
-              name: 'Text'
-              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
-              minorKey: textViewSpec
-            )
-           )
-         
-        )
-      )
-!
-
-versionBOnlySpec
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this!! If it is corrupted,
-     the UIPainter may not be able to read the specification."
-
-    "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#versionBOnlySpec
-     Tools::TextDiffTool new openInterface:#versionBOnlySpec
-    "
-
-    <resource: #canvas>
-
-    ^ 
-     #(FullSpec
-        name: 'versionBOnlySpec'
-        window: 
-       (WindowSpec
-          label: 'Version B Only'
-          name: 'Version B Only'
-          min: (Point 10 10)
-          bounds: (Rectangle 0 0 782 506)
-        )
-        component: 
-       (SpecCollection
-          collection: (
-           (UISubSpecification
-              name: 'VersionB'
-              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
-              minorKey: versionBLabelSpec
-            )
-          (UISubSpecification
-              name: 'Text'
-              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
-              minorKey: textViewSpec
-            )
-           )
-         
-        )
-      )
-
-    "Created: / 19-07-2011 / 10:06:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 windowSpec
     "This resource specification was automatically generated
      by the UIPainter of ST/X."
@@ -304,9 +103,9 @@
      the UIPainter may not be able to read the specification."
 
     "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#windowSpec
-     Tools::TextDiffTool new openInterface:#windowSpec
-     Tools::TextDiffTool open
+     UIPainter new openOnClass:Tools::TextDiff2Tool andSelector:#windowSpec
+     Tools::TextDiff2Tool new openInterface:#windowSpec
+     Tools::TextDiff2Tool open
     "
 
     <resource: #canvas>
@@ -325,9 +124,16 @@
         component: 
        (SpecCollection
           collection: (
+           (LabelSpec
+              label: 'Label'
+              name: 'Label1'
+              layout: (LayoutFrame 0 0 0 0 0 1 30 0)
+              translateLabel: true
+              labelChannel: labelHolder
+            )
            (UISubSpecification
               name: 'Contents'
-              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+              layout: (LayoutFrame 0 0 30 0 0 1 0 1)
               minorKey: windowSpecForEmbedding
             )
            )
@@ -344,8 +150,8 @@
      the UIPainter may not be able to read the specification."
 
     "
-     UIPainter new openOnClass:Tools::TextDiffTool andSelector:#windowSpecForEmbedding
-     Tools::TextDiffTool new openInterface:#windowSpecForEmbedding
+     UIPainter new openOnClass:Tools::TextDiff2Tool andSelector:#windowSpecForEmbedding
+     Tools::TextDiff2Tool new openInterface:#windowSpecForEmbedding
     "
 
     <resource: #canvas>
@@ -368,7 +174,7 @@
               layout: (LayoutFrame 0 0 0 0 0 1 0 1)
               hasHorizontalScrollBar: false
               hasVerticalScrollBar: false
-              specHolder: diffSpecHolder
+              specHolder: contentSpecHolder
               createNewBuilder: false
             )
            )
@@ -483,7 +289,7 @@
     "Modified: / 30-06-2011 / 20:53:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-versionBaseLabelSpec
+versionCLabelSpec
     "This resource specification was automatically generated
      by the UIPainter of ST/X."
 
@@ -499,11 +305,11 @@
 
     ^ 
      #(FullSpec
-        name: versionBaseLabelSpec
+        name: versionCLabelSpec
         window: 
        (WindowSpec
-          label: 'Version Base'
-          name: 'Version Base'
+          label: 'Version C'
+          name: 'Version C'
           min: (Point 10 10)
           bounds: (Rectangle 0 0 300 30)
         )
@@ -518,11 +324,11 @@
               translateLabel: true
             )
            (LabelSpec
-              label: 'Version Base'
-              name: 'VersionBaseLabel'
+              label: 'Version C'
+              name: 'VersionCLabel'
               layout: (LayoutFrame 30 0 5 0 191 0 0 1)
               translateLabel: true
-              labelChannel: versionBaseLabelAspect
+              labelChannel: labelCHolder
               resizeForLabel: true
               adjust: left
               useDynamicPreferredWidth: true
@@ -533,43 +339,45 @@
         )
       )
 
-    "Modified: / 24-03-2010 / 20:51:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 16-03-2012 / 12:16:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool class methodsFor:'plugIn spec'!
 
 aspectSelectors
-    "This resource specification was automatically generated
-     by the UIPainter of ST/X."
-
-    "Do not manually edit this. If it is corrupted,
-     the UIPainter may not be able to read the specification."
 
-    "Return a description of exported aspects;
-     these can be connected to aspects of an embedding application
-     (if this app is embedded in a subCanvas)."
+    ^#( 
+        #labelHolder
 
-    ^ #(
-        #classHolder
-        #codeAspectHolder
         #labelAHolder
         #labelBHolder
-        #languageHolder
-        #showDiffHolder
+        #labelCHolder
+
         #textAHolder
         #textBHolder
-      ).
+        #textCHolder
 
+        #languageHolder
+        #codeAspectHolder
+    )
+
+    "Created: / 16-03-2012 / 12:18:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool methodsFor:'accessing'!
 
+label: aString
+
+    ^self labelHolder value: aString
+
+    "Created: / 16-03-2012 / 13:07:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 labelA: aString
+
     ^self labelAHolder value: aString
 
-    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Created: / 30-08-2011 / 09:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:10 / cg"
+    "Created: / 16-03-2012 / 13:05:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 labelB: aString
@@ -580,6 +388,21 @@
     "Modified (format): / 27-07-2012 / 21:57:15 / cg"
 !
 
+labelC: aString
+
+    ^self labelCHolder value: aString
+
+    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 16-03-2012 / 13:05:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+textA
+
+    ^self textAHolder value
+
+    "Created: / 19-03-2012 / 12:24:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 textA: aString
     ^self textAHolder value: aString
 
@@ -587,6 +410,13 @@
     "Modified (format): / 27-07-2012 / 21:57:37 / cg"
 !
 
+textB
+
+    ^self textBHolder value
+
+    "Created: / 19-03-2012 / 12:24:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 textB: aString
     ^self textBHolder value: aString
 
@@ -594,11 +424,25 @@
     "Modified (format): / 27-07-2012 / 21:57:41 / cg"
 !
 
-title: aString
+textC
+
+    ^self textCHolder value
+
+    "Created: / 19-03-2012 / 12:24:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+textC: aString
 
-    ^self titleHolder value: aString
+    ^self textCHolder value: aString
+
+    "Created: / 16-03-2012 / 13:05:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
 
-    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+title: aString
+    <resource: #obsolete>
+
+    ^self label: aString
+
     "Created: / 30-08-2011 / 09:45:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
@@ -615,7 +459,7 @@
 
 classHolder: aValueHolder
     classHolder := aValueHolder.
-    codeView notNil ifTrue:[codeView classHolder: aValueHolder].
+    "codeView notNil ifTrue:[codeView classHolder: aValueHolder]."
     diffView notNil ifTrue:[diffView classHolder: aValueHolder].
 
     "Modified: / 19-07-2011 / 12:54:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
@@ -649,37 +493,76 @@
     "Modified: / 27-07-2012 / 22:55:42 / cg"
 !
 
-diffSpecHolder
-    "return/create the 'diffSpecHolder' value holder (automatically generated)"
+contentSpecHolder
+    "return/create the 'contentSpecHolder' value holder (automatically generated)"
 
-    diffSpecHolder isNil ifTrue:[
-        diffSpecHolder := ValueHolder with: #diffSpec.
-        diffSpecHolder addDependent:self.
+    contentSpecHolder isNil ifTrue:[
+        contentSpecHolder := ValueHolder new.
+        contentSpecHolder addDependent:self.
     ].
-    ^ diffSpecHolder
-
-    "Modified: / 06-07-2011 / 11:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    ^ contentSpecHolder
 !
 
-diffSpecHolder:something
-    "set the 'diffSpecHolder' value holder (automatically generated)"
+contentSpecHolder:something
+    "set the 'contentSpecHolder' value holder (automatically generated)"
 
     |oldValue newValue|
 
-    diffSpecHolder notNil ifTrue:[
-        oldValue := diffSpecHolder value.
-        diffSpecHolder removeDependent:self.
+    contentSpecHolder notNil ifTrue:[
+        oldValue := contentSpecHolder value.
+        contentSpecHolder removeDependent:self.
     ].
-    diffSpecHolder := something.
-    diffSpecHolder notNil ifTrue:[
-        diffSpecHolder addDependent:self.
+    contentSpecHolder := something.
+    contentSpecHolder notNil ifTrue:[
+        contentSpecHolder addDependent:self.
     ].
-    newValue := diffSpecHolder value.
+    newValue := contentSpecHolder value.
     oldValue ~~ newValue ifTrue:[
-        self update:#value with:newValue from:diffSpecHolder.
+        self update:#value with:newValue from:contentSpecHolder.
     ].
 !
 
+diffView
+"/    diffView isNil ifTrue:[
+        diffView := self initializeDiffView.
+"/    ].
+    ^diffView
+
+    "Created: / 16-01-2013 / 09:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+labelHolder
+    "return/create the 'labelAHolder' value holder (automatically generated)"
+
+    labelHolder isNil ifTrue:[
+        labelHolder := ValueHolder with:'Text diff'.
+        "/titleHolder addDependent:self.
+    ].
+    ^ labelHolder
+
+    "Created: / 16-03-2012 / 13:06:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+languageHolder
+    "return/create the 'languageHolder' value holder (automatically generated)"
+
+    languageHolder isNil ifTrue:[
+        languageHolder := ValueHolder new.
+    ].
+    ^ languageHolder
+!
+
+languageHolder:aValueHolder
+
+    languageHolder := aValueHolder.
+    "codeView notNil ifTrue:[codeView languageHolder: aValueHolder]."
+    diffView notNil ifTrue:[diffView languageHolder: aValueHolder].
+
+    "Modified: / 19-07-2011 / 12:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!TextDiffTool methodsFor:'aspects-versions'!
+
 labelAHolder
     "return/create the 'labelAHolder' value holder (automatically generated)"
 
@@ -742,54 +625,37 @@
     ].
 !
 
-languageHolder
-    "return/create the 'languageHolder' value holder (automatically generated)"
+labelCHolder
+    "return/create the 'labelBHolder' value holder (automatically generated)"
 
-    languageHolder isNil ifTrue:[
-        languageHolder := ValueHolder new.
+    labelCHolder isNil ifTrue:[
+        labelCHolder := ValueHolder with:'Version Base'.
+        labelCHolder addDependent:self.
     ].
-    ^ languageHolder
+    ^ labelCHolder
+
+    "Created: / 16-03-2012 / 12:14:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-languageHolder:aValueHolder
-
-    languageHolder := aValueHolder.
-    codeView notNil ifTrue:[codeView languageHolder: aValueHolder].
-    diffView notNil ifTrue:[diffView languageHolder: aValueHolder].
-
-    "Modified: / 19-07-2011 / 12:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-showDiffHolder
-    "this holder controls if one or two code-text views are show in the lower area"
-
-    showDiffHolder isNil ifTrue:[
-        showDiffHolder := ValueHolder with: true.
-        showDiffHolder addDependent:self.
-    ].
-    ^ showDiffHolder
-
-    "Modified: / 30-06-2011 / 20:59:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
-showDiffHolder:something
-    "set the 'showDiffHolder' value holder (automatically generated).
-     this holder controls if one or two code-text views are show in the lower area"
+labelCHolder:something
+    "set the 'labelBHolder' value holder (automatically generated)"
 
     |oldValue newValue|
 
-    showDiffHolder notNil ifTrue:[
-        oldValue := showDiffHolder value.
-        showDiffHolder removeDependent:self.
+    labelCHolder notNil ifTrue:[
+        oldValue := labelCHolder value.
+        labelCHolder removeDependent:self.
     ].
-    showDiffHolder := something.
-    showDiffHolder notNil ifTrue:[
-        showDiffHolder addDependent:self.
+    labelCHolder := something.
+    labelCHolder notNil ifTrue:[
+        labelCHolder addDependent:self.
     ].
-    newValue := showDiffHolder value.
+    newValue := labelCHolder value.
     oldValue ~~ newValue ifTrue:[
-        self update:#value with:newValue from:showDiffHolder.
+        self update:#value with:newValue from:labelCHolder.
     ].
+
+    "Created: / 16-03-2012 / 12:15:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 textAHolder
@@ -850,27 +716,41 @@
     ].
 !
 
-titleHolder
-    "return/create the 'labelAHolder' value holder (automatically generated)"
+textCHolder
+    "return/create the 'textBHolder' value holder (automatically generated)"
+
+    textCHolder isNil ifTrue:[
+        textCHolder := ValueHolder new.
+        textCHolder addDependent:self.
+    ].
+    ^ textCHolder
+
+    "Created: / 16-03-2012 / 12:13:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+textCHolder:something
+    "set the 'textBHolder' value holder (automatically generated)"
 
-    titleHolder isNil ifTrue:[
-        titleHolder := ValueHolder with:'Text diff'.
-        "/titleHolder addDependent:self.
+    |oldValue newValue|
+
+    textCHolder notNil ifTrue:[
+        oldValue := textCHolder value.
+        textCHolder removeDependent:self.
     ].
-    ^ titleHolder
+    textCHolder := something.
+    textCHolder notNil ifTrue:[
+        textCHolder addDependent:self.
+    ].
+    newValue := textCHolder value.
+    oldValue ~~ newValue ifTrue:[
+        self update:#value with:newValue from:textCHolder.
+    ].
 
-    "Created: / 30-08-2011 / 09:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 16-03-2012 / 12:14:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool methodsFor:'change & update'!
 
-codeAspect
-    ^self codeAspectHolder value
-
-    "Created: / 19-07-2011 / 19:07:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:56:52 / cg"
-!
-
 codeAspect:aSymbol
     self codeAspectHolder value:aSymbol
 
@@ -881,169 +761,110 @@
 update:something with:aParameter from:changedObject
     "Invoked when an object that I depend upon sends a change notification."
 
+
     changedObject == textAHolder ifTrue:[
         textAChanged := true.
-        self updateAfterAorBChanged.
+        self updateAfterAorBorCChanged.
         ^ self.
     ].
     changedObject == textBHolder ifTrue:[
         textBChanged := true.
-        self updateAfterAorBChanged.
-        ^ self.
-    ].
-    changedObject == codeAspectHolder ifTrue:[
-        |v|
-
-        (codeView notNil and:[(v := codeView scrolledView) notNil ]) ifTrue:[v codeAspect: codeAspectHolder value].
-        (diffView notNil and:[(v := diffView scrolledView) notNil ]) ifTrue:[v codeAspect: codeAspectHolder value].
-        self updateViews.            
+        self updateAfterAorBorCChanged.
         ^ self.
     ].
-    (changedObject == showDiffHolder) ifTrue:[
-        self updateViews.            
-        ^self.
-    ].
-    super update:something with:aParameter from:changedObject
-
-    "Modified: / 19-07-2011 / 19:44:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-07-2012 / 23:44:32 / cg"
-!
-
-updateAfterAorBChanged
-    (textAChanged & textBChanged) ifTrue:[
-        textAChanged := textBChanged := false.
-        self updateViews
+    changedObject == textCHolder ifTrue:[
+        textCChanged := true.
+        self updateAfterAorBorCChanged.
+        ^ self.
     ].
 
-    "Created: / 06-07-2011 / 12:12:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 23:00:28 / cg"
+    ^super update:something with:aParameter from:changedObject
+
+    "Created: / 16-03-2012 / 12:36:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-updateViews
-    | a b |
-
-    a := self textAHolder value.
-    b := self textBHolder value.
-
-    self showDiffHolder value ifFalse:[
-        self showTextOnly.
-        ^ self
-    ].
+updateAfterAorBorCChanged
+    "Called whenever one of the texts changes"
 
-    (a notNil and:[b notNil]) ifTrue:[
-        self showDiff.
-        ^self
-    ].
-    a notNil ifTrue:[
-        self showVersionA.
-        ^self
-    ].
-    b notNil ifTrue:[
-        self showVersionB.
-        ^self
-    ].
+    ^ self subclassResponsibility
 
-   self showNothing.
-
-    "Created: / 19-07-2011 / 11:29:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 23:00:32 / cg"
+    "Modified (comment): / 16-03-2012 / 12:39:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool methodsFor:'hooks'!
 
-postBuildCodeView:aScrollableView
-    codeView := aScrollableView.
-    codeView notNil ifTrue:[codeView languageHolder: self languageHolder].
-    codeView notNil ifTrue:[codeView classHolder: self classHolder].
+postBuildDiffView:aScrollableView
 
-    "Created: / 19-07-2011 / 10:17:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:23 / cg"
+    diffView := aScrollableView.
+    self setupCodeView: aScrollableView.
+
+    "Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-postBuildDiffView:aScrollableView
-    diffView := aScrollableView.
-    diffView notNil ifTrue:[
-        diffView languageHolder: self languageHolder.
-        diffView classHolder: self classHolder.
-
-        (self textAHolder value notNil and:[self textBHolder value notNil]) ifTrue:[
-            diffView scrolledView
-                text1: self textAHolder value
-                text2: self textBHolder value
-        ]
+setupCodeView: codeView2
+    codeView2 notNil ifTrue:[
+        codeView2
+            languageHolder: self languageHolder;
+            classHolder: self classHolder;
+            modeHolder: self codeAspectHolder
     ].
 
-    "Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:21 / cg"
+    "Created: / 26-07-2012 / 19:13:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool methodsFor:'initialization'!
 
 initialize
-    super initialize.
-    textAChanged := textBChanged := false.
-
-    "Modified: / 19-07-2011 / 19:43:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:08 / cg"
-! !
-
-!TextDiffTool methodsFor:'private'!
-
-showDiff
-    |scrolledView|
 
-    self diffSpecHolder value: #diffSpec.
-    
-    diffView isNil ifTrue:[^self].
-    (scrolledView := diffView scrolledView) isNil ifTrue:[^self].
-    scrolledView codeAspect: codeAspectHolder value.
-    scrolledView
-        text1: self textAHolder value
-        text2: self textBHolder value
+    super initialize.
+    textAChanged := textBChanged := textBChanged := false.
 
-    "Created: / 19-07-2011 / 10:22:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 27-07-2012 / 23:31:04 / cg"
+    "Modified: / 16-03-2012 / 12:40:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-showNothing
-    self diffSpecHolder value: #nothingSpec
+initializeDiffView
+
+    self subclassResponsibility
+
+    "Created: / 16-01-2013 / 09:45:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
-    "Created: / 19-07-2011 / 19:34:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:28 / cg"
+!TextDiffTool methodsFor:'testing'!
+
+isDiff2
+    ^false
+
+    "Created: / 16-03-2012 / 15:21:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-showTextOnly
-    self diffSpecHolder value: #textViewSpec
+isDiff3
+    ^false
 
-    "Created: / 19-07-2011 / 11:39:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:30 / cg"
+    "Created: / 16-03-2012 / 15:21:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-showVersionA
-    self diffSpecHolder value: #versionAOnlySpec
+isMerge
+    ^false
 
-    "Created: / 19-07-2011 / 10:22:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:33 / cg"
-!
-
-showVersionB
-    self diffSpecHolder value: #versionBOnlySpec
-
-    "Created: / 19-07-2011 / 10:22:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified (format): / 27-07-2012 / 21:57:35 / cg"
+    "Created: / 19-03-2012 / 11:53:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TextDiffTool class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.9 2013-03-29 07:27:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.10 2014-02-05 19:02:13 vrany Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.9 2013-03-29 07:27:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.10 2014-02-05 19:02:13 vrany Exp $'
+!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
 !
 
 version_SVN
-    ^ '§Id§'
+    ^ '$Id: Tools__TextDiffTool.st,v 1.10 2014-02-05 19:02:13 vrany Exp $'
 ! !