Tools__TextDiffTool.st
changeset 10654 b6a976a399ab
parent 10344 956791655804
child 10868 d6063f9a6ebd
equal deleted inserted replaced
10653:0f30edd43161 10654:b6a976a399ab
    12 "{ Package: 'stx:libtool' }"
    12 "{ Package: 'stx:libtool' }"
    13 
    13 
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 ApplicationModel subclass:#TextDiffTool
    16 ApplicationModel subclass:#TextDiffTool
    17 	instanceVariableNames:'labelAHolder textAHolder labelBHolder textBHolder classHolder
    17 	instanceVariableNames:'titleHolder labelAHolder textAHolder labelBHolder textBHolder
    18 		languageHolder codeAspectHolder showDiffHolder diffSpecHolder
    18 		classHolder languageHolder codeAspectHolder showDiffHolder
    19 		diffView textAChanged textBChanged codeView'
    19 		diffSpecHolder diffView textAChanged textBChanged codeView'
    20 	classVariableNames:''
    20 	classVariableNames:''
    21 	poolDictionaries:''
    21 	poolDictionaries:''
    22 	category:'Interface-Diff'
    22 	category:'Interface-Diff'
    23 !
    23 !
    24 
    24 
   316         name: windowSpec
   316         name: windowSpec
   317         window: 
   317         window: 
   318        (WindowSpec
   318        (WindowSpec
   319           label: 'Text Diff Tool'
   319           label: 'Text Diff Tool'
   320           name: 'Text Diff Tool'
   320           name: 'Text Diff Tool'
       
   321           labelChannel: titleHolder
   321           min: (Point 10 10)
   322           min: (Point 10 10)
   322           bounds: (Rectangle 0 0 640 480)
   323           bounds: (Rectangle 0 0 640 480)
   323         )
   324         )
   324         component: 
   325         component: 
   325        (SpecCollection
   326        (SpecCollection
   331             )
   332             )
   332            )
   333            )
   333          
   334          
   334         )
   335         )
   335       )
   336       )
   336 
       
   337     "Modified: / 30-06-2011 / 20:45:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   338 !
   337 !
   339 
   338 
   340 windowSpecForEmbedding
   339 windowSpecForEmbedding
   341     "This resource specification was automatically generated
   340     "This resource specification was automatically generated
   342      by the UIPainter of ST/X."
   341      by the UIPainter of ST/X."
   549     "Return a description of exported aspects;
   548     "Return a description of exported aspects;
   550      these can be connected to aspects of an embedding application
   549      these can be connected to aspects of an embedding application
   551      (if this app is embedded in a subCanvas)."
   550      (if this app is embedded in a subCanvas)."
   552 
   551 
   553     ^ #(
   552     ^ #(
       
   553         #classHolder
       
   554         #codeAspectHolder
   554         #labelAHolder
   555         #labelAHolder
   555         #labelBHolder
   556         #labelBHolder
   556 
   557         #languageHolder
       
   558         #showDiffHolder
   557         #textAHolder
   559         #textAHolder
   558         #textBHolder
   560         #textBHolder
   559 
       
   560         #showDiffHolder
       
   561 
       
   562         #classHolder
       
   563         #languageHolder
       
   564         #codeAspectHolder
       
   565       ).
   561       ).
   566 
   562 
   567     "Modified: / 19-07-2011 / 19:07:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   563 ! !
       
   564 
       
   565 !TextDiffTool methodsFor:'accessing'!
       
   566 
       
   567 labelA: aString
       
   568 
       
   569     ^self labelAHolder value: aString
       
   570 
       
   571     "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   572     "Created: / 30-08-2011 / 09:42:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   573 !
       
   574 
       
   575 labelB: aString
       
   576 
       
   577     ^self labelBHolder value: aString
       
   578 
       
   579     "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   580     "Created: / 30-08-2011 / 09:42:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   581 !
       
   582 
       
   583 textA: aString
       
   584 
       
   585     ^self textAHolder value: aString
       
   586 
       
   587     "Created: / 30-08-2011 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   588 !
       
   589 
       
   590 textB: aString
       
   591 
       
   592     ^self textBHolder value: aString
       
   593 
       
   594     "Created: / 30-08-2011 / 09:43:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   595 !
       
   596 
       
   597 title: aString
       
   598 
       
   599     ^self titleHolder value: aString
       
   600 
       
   601     "Modified: / 19-07-2011 / 11:41:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   602     "Created: / 30-08-2011 / 09:45:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   568 ! !
   603 ! !
   569 
   604 
   570 !TextDiffTool methodsFor:'aspects'!
   605 !TextDiffTool methodsFor:'aspects'!
   571 
   606 
   572 classHolder
   607 classHolder
   800     ].
   835     ].
   801     newValue := textBHolder value.
   836     newValue := textBHolder value.
   802     oldValue ~~ newValue ifTrue:[
   837     oldValue ~~ newValue ifTrue:[
   803         self update:#value with:newValue from:textBHolder.
   838         self update:#value with:newValue from:textBHolder.
   804     ].
   839     ].
       
   840 !
       
   841 
       
   842 titleHolder
       
   843     "return/create the 'labelAHolder' value holder (automatically generated)"
       
   844 
       
   845     titleHolder isNil ifTrue:[
       
   846         titleHolder := ValueHolder with:'Text diff'.
       
   847         "/titleHolder addDependent:self.
       
   848     ].
       
   849     ^ titleHolder
       
   850 
       
   851     "Created: / 30-08-2011 / 09:45:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   805 ! !
   852 ! !
   806 
   853 
   807 !TextDiffTool methodsFor:'change & update'!
   854 !TextDiffTool methodsFor:'change & update'!
   808 
   855 
   809 codeAspect
   856 codeAspect
   888 !
   935 !
   889 
   936 
   890 postBuildDiffView:aScrollableView
   937 postBuildDiffView:aScrollableView
   891 
   938 
   892     diffView := aScrollableView.
   939     diffView := aScrollableView.
   893     diffView notNil ifTrue:[diffView languageHolder: self languageHolder].
   940     diffView notNil ifTrue:[
   894     diffView notNil ifTrue:[diffView classHolder: self classHolder].
   941         diffView languageHolder: self languageHolder.
       
   942         diffView classHolder: self classHolder.
       
   943 
       
   944         (self textAHolder value notNil and:[self textBHolder value notNil]) ifTrue:[
       
   945             diffView scrolledView
       
   946                 text1: self textAHolder value
       
   947                 text2: self textBHolder value
       
   948         ]
       
   949     ].
   895 
   950 
   896     "Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   951     "Created: / 30-06-2011 / 20:55:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   897 ! !
   952 ! !
   898 
   953 
   899 !TextDiffTool methodsFor:'initialization'!
   954 !TextDiffTool methodsFor:'initialization'!
   950 ! !
  1005 ! !
   951 
  1006 
   952 !TextDiffTool class methodsFor:'documentation'!
  1007 !TextDiffTool class methodsFor:'documentation'!
   953 
  1008 
   954 version_CVS
  1009 version_CVS
   955     ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.3 2011-07-19 19:25:25 vrany Exp $'
  1010     ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.4 2011-08-30 08:56:43 vrany Exp $'
   956 !
  1011 !
   957 
  1012 
   958 version_SVN
  1013 version_SVN
   959     ^ '§Id§'
  1014     ^ '§Id§'
   960 ! !
  1015 ! !