Tools__TextDiffTool.st
author Claus Gittinger <cg@exept.de>
Fri, 27 Jul 2012 23:48:04 +0200
changeset 11703 100f3c5ed545
parent 11700 0040c834b1cc
child 12401 4714b9640528
child 12405 76f9a872362b
child 12574 4b07dbee292f
permissions -rw-r--r--
fixed some (but not all) missing codeAspect settings

"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

ApplicationModel subclass:#TextDiffTool
	instanceVariableNames:'titleHolder labelAHolder textAHolder labelBHolder textBHolder
		classHolder languageHolder codeAspectHolder showDiffHolder
		diffSpecHolder diffView textAChanged textBChanged codeView'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Diff'
!

!TextDiffTool class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!TextDiffTool class methodsFor:'image specs'!

versionA24x24

    ^ToolbarIconLibrary versionA24x24

    "Created: / 24-03-2010 / 20:49:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionB24x24

    ^ToolbarIconLibrary versionB24x24

    "Created: / 24-03-2010 / 20:50:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBase24x24

    ^ToolbarIconLibrary versionBase24x24

    "Created: / 24-03-2010 / 20:50:42 / 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."

    "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:#windowSpec
     Tools::TextDiffTool new openInterface:#windowSpec
     Tools::TextDiffTool open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'Text Diff Tool'
          name: 'Text Diff Tool'
          labelChannel: titleHolder
          min: (Point 10 10)
          bounds: (Rectangle 0 0 640 480)
        )
        component: 
       (SpecCollection
          collection: (
           (UISubSpecification
              name: 'Contents'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
              minorKey: windowSpecForEmbedding
            )
           )
         
        )
      )
!

windowSpecForEmbedding
    "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:#windowSpecForEmbedding
     Tools::TextDiffTool new openInterface:#windowSpecForEmbedding
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpecForEmbedding
        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: (
           (SubCanvasSpec
              name: 'Contents'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
              hasHorizontalScrollBar: false
              hasVerticalScrollBar: false
              specHolder: diffSpecHolder
              createNewBuilder: false
            )
           )
         
        )
      )
! !

!TextDiffTool class methodsFor:'interface specs - labels'!

versionALabelSpec
    "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:SVN::DiffViewApp andSelector:#versionALabelSpec
     SVN::DiffViewApp new openInterface:#versionALabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionALabelSpec
        window: 
       (WindowSpec
          label: 'Version A'
          name: 'Version A'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionA24x24'
              name: 'VersionAIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version A'
              name: 'VersionALabel'
              layout: (LayoutFrame 30 0 0 0 0 1 0 1)
              translateLabel: true
              labelChannel: labelAHolder
              resizeForLabel: true
              adjust: left
            )
           )
         
        )
      )

    "Modified: / 30-06-2011 / 20:53:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBLabelSpec
    "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:SVN::DiffViewApp andSelector:#versionBLabelSpec
     SVN::DiffViewApp new openInterface:#versionBLabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionBLabelSpec
        window: 
       (WindowSpec
          label: 'Version B'
          name: 'Version B'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionB24x24'
              name: 'VersionBIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version B'
              name: 'VersionBLabel'
              layout: (LayoutFrame 30 0 0 0 0 1 0 1)
              translateLabel: true
              labelChannel: labelBHolder
              resizeForLabel: true
              adjust: left
              useDynamicPreferredWidth: true
              usePreferredWidth: true
            )
           )
         
        )
      )

    "Modified: / 30-06-2011 / 20:53:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBaseLabelSpec
    "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:SVN::DiffViewApp andSelector:#versionBaseLabelSpec
     SVN::DiffViewApp new openInterface:#versionBaseLabelSpec
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: versionBaseLabelSpec
        window: 
       (WindowSpec
          label: 'Version Base'
          name: 'Version Base'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 300 30)
        )
        component: 
       (SpecCollection
          collection: (
           (LabelSpec
              label: 'versionBase24x24'
              name: 'VersionBaseIcon'
              layout: (LayoutFrame 0 0 -12 0.5 27 0 12 0.5)
              hasCharacterOrientedLabel: false
              translateLabel: true
            )
           (LabelSpec
              label: 'Version Base'
              name: 'VersionBaseLabel'
              layout: (LayoutFrame 30 0 5 0 191 0 0 1)
              translateLabel: true
              labelChannel: versionBaseLabelAspect
              resizeForLabel: true
              adjust: left
              useDynamicPreferredWidth: true
              usePreferredWidth: true
            )
           )
         
        )
      )

    "Modified: / 24-03-2010 / 20:51:21 / 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)."

    ^ #(
        #classHolder
        #codeAspectHolder
        #labelAHolder
        #labelBHolder
        #languageHolder
        #showDiffHolder
        #textAHolder
        #textBHolder
      ).

! !

!TextDiffTool methodsFor:'accessing'!

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"
!

labelB: aString
    ^self labelBHolder value: aString

    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 30-08-2011 / 09:42:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:15 / cg"
!

textA: aString
    ^self textAHolder value: aString

    "Created: / 30-08-2011 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:37 / cg"
!

textB: aString
    ^self textBHolder value: aString

    "Created: / 30-08-2011 / 09:43:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:41 / cg"
!

title: aString

    ^self titleHolder value: aString

    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 30-08-2011 / 09:45:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!TextDiffTool methodsFor:'aspects'!

classHolder
    "return/create the 'classHolder' value holder (automatically generated)"

    classHolder isNil ifTrue:[
        classHolder := ValueHolder new.
    ].
    ^ classHolder
!

classHolder: aValueHolder
    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>"
    "Modified (format): / 27-07-2012 / 21:57:00 / cg"
!

codeAspectHolder
    "return/create the 'codeAspectHolder' value holder (automatically generated)"

    codeAspectHolder isNil ifTrue:[
        codeAspectHolder := ValueHolder with: (SyntaxHighlighter codeAspectExpression).
        codeAspectHolder addDependent:self
    ].
    ^ codeAspectHolder

    "Modified: / 19-07-2011 / 19:07:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 27-07-2012 / 23:46:11 / cg"
!

codeAspectHolder:something
    "set the 'codeAspectHolder' value holder (automatically generated)"

    codeAspectHolder notNil ifTrue:[
        codeAspectHolder removeDependent:self
    ].
    codeAspectHolder := something.
    codeAspectHolder notNil ifTrue:[
        codeAspectHolder addDependent:self
    ].

    "Modified: / 27-07-2012 / 22:55:42 / cg"
!

diffSpecHolder
    "return/create the 'diffSpecHolder' value holder (automatically generated)"

    diffSpecHolder isNil ifTrue:[
        diffSpecHolder := ValueHolder with: #diffSpec.
        diffSpecHolder addDependent:self.
    ].
    ^ diffSpecHolder

    "Modified: / 06-07-2011 / 11:57:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

diffSpecHolder:something
    "set the 'diffSpecHolder' value holder (automatically generated)"

    |oldValue newValue|

    diffSpecHolder notNil ifTrue:[
        oldValue := diffSpecHolder value.
        diffSpecHolder removeDependent:self.
    ].
    diffSpecHolder := something.
    diffSpecHolder notNil ifTrue:[
        diffSpecHolder addDependent:self.
    ].
    newValue := diffSpecHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:diffSpecHolder.
    ].
!

labelAHolder
    "return/create the 'labelAHolder' value holder (automatically generated)"

    labelAHolder isNil ifTrue:[
        labelAHolder := ValueHolder with:'Version A'.
        labelAHolder addDependent:self.
    ].
    ^ labelAHolder

    "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

labelAHolder:something
    "set the 'labelAHolder' value holder (automatically generated)"

    |oldValue newValue|

    labelAHolder notNil ifTrue:[
        oldValue := labelAHolder value.
        labelAHolder removeDependent:self.
    ].
    labelAHolder := something.
    labelAHolder notNil ifTrue:[
        labelAHolder addDependent:self.
    ].
    newValue := labelAHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:labelAHolder.
    ].
!

labelBHolder
    "return/create the 'labelBHolder' value holder (automatically generated)"

    labelBHolder isNil ifTrue:[
        labelBHolder := ValueHolder with:'Version B'.
        labelBHolder addDependent:self.
    ].
    ^ labelBHolder

    "Modified: / 19-07-2011 / 11:42:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

labelBHolder:something
    "set the 'labelBHolder' value holder (automatically generated)"

    |oldValue newValue|

    labelBHolder notNil ifTrue:[
        oldValue := labelBHolder value.
        labelBHolder removeDependent:self.
    ].
    labelBHolder := something.
    labelBHolder notNil ifTrue:[
        labelBHolder addDependent:self.
    ].
    newValue := labelBHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:labelBHolder.
    ].
!

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>"
!

showDiffHolder
    "return/create the 'showDiffHolder' value holder (automatically generated)"

    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)"

    |oldValue newValue|

    showDiffHolder notNil ifTrue:[
        oldValue := showDiffHolder value.
        showDiffHolder removeDependent:self.
    ].
    showDiffHolder := something.
    showDiffHolder notNil ifTrue:[
        showDiffHolder addDependent:self.
    ].
    newValue := showDiffHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:showDiffHolder.
    ].
!

textAHolder
    "return/create the 'textAHolder' value holder (automatically generated)"

    textAHolder isNil ifTrue:[
        textAHolder := ValueHolder new.
        textAHolder addDependent:self.
    ].
    ^ textAHolder
!

textAHolder:something
    "set the 'textAHolder' value holder (automatically generated)"

    |oldValue newValue|

    textAHolder notNil ifTrue:[
        oldValue := textAHolder value.
        textAHolder removeDependent:self.
    ].
    textAHolder := something.
    textAHolder notNil ifTrue:[
        textAHolder addDependent:self.
    ].
    newValue := textAHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:textAHolder.
    ].
!

textBHolder
    "return/create the 'textBHolder' value holder (automatically generated)"

    textBHolder isNil ifTrue:[
        textBHolder := ValueHolder new.
        textBHolder addDependent:self.
    ].
    ^ textBHolder
!

textBHolder:something
    "set the 'textBHolder' value holder (automatically generated)"

    |oldValue newValue|

    textBHolder notNil ifTrue:[
        oldValue := textBHolder value.
        textBHolder removeDependent:self.
    ].
    textBHolder := something.
    textBHolder notNil ifTrue:[
        textBHolder addDependent:self.
    ].
    newValue := textBHolder value.
    oldValue ~~ newValue ifTrue:[
        self update:#value with:newValue from:textBHolder.
    ].
!

titleHolder
    "return/create the 'labelAHolder' value holder (automatically generated)"

    titleHolder isNil ifTrue:[
        titleHolder := ValueHolder with:'Text diff'.
        "/titleHolder addDependent:self.
    ].
    ^ titleHolder

    "Created: / 30-08-2011 / 09:45:10 / 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

    "Created: / 19-07-2011 / 19:07:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 27-07-2012 / 21:56:48 / cg"
!

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.
    ].
    changedObject == textBHolder ifTrue:[
        textBChanged := true.
        self updateAfterAorBChanged.
        ^ self.
    ].
    changedObject == codeAspectHolder ifTrue:[
        (codeView notNil and:[codeView scrolledView notNil ]) ifTrue:[codeView scrolledView codeAspect: codeAspectHolder value].
        (diffView notNil and:[diffView scrolledView notNil ]) ifTrue:[diffView scrolledView codeAspect: codeAspectHolder value].
        self updateViews.            
        ^ 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
    ].

    "Created: / 06-07-2011 / 12:12:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 23:00:28 / cg"
!

updateViews
    | a b |

    a := self textAHolder value.
    b := self textBHolder value.

    self showDiffHolder value ifFalse:[
        self showTextOnly.
        ^ self
    ].

    (a notNil and:[b notNil]) ifTrue:[
        self showDiff.
        ^self
    ].
    a notNil ifTrue:[
        self showVersionA.
        ^self
    ].
    b notNil ifTrue:[
        self showVersionB.
        ^self
    ].

   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"
! !

!TextDiffTool methodsFor:'hooks'!

postBuildCodeView:aScrollableView
    codeView := aScrollableView.
    codeView notNil ifTrue:[codeView languageHolder: self languageHolder].
    codeView notNil ifTrue:[codeView classHolder: self classHolder].

    "Created: / 19-07-2011 / 10:17:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:23 / cg"
!

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
        ]
    ].

    "Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:21 / cg"
! !

!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

    "Created: / 19-07-2011 / 10:22:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 27-07-2012 / 23:31:04 / cg"
!

showNothing
    self diffSpecHolder value: #nothingSpec

    "Created: / 19-07-2011 / 19:34:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:28 / cg"
!

showTextOnly
    self diffSpecHolder value: #textViewSpec

    "Created: / 19-07-2011 / 11:39:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified (format): / 27-07-2012 / 21:57:30 / cg"
!

showVersionA
    self diffSpecHolder value: #versionAOnlySpec

    "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"
! !

!TextDiffTool class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.8 2012-07-27 21:48:04 cg Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.8 2012-07-27 21:48:04 cg Exp $'
!

version_SVN
    ^ '§Id§'
! !