class definition
authorvrany
Tue, 30 Aug 2011 10:56:43 +0200
changeset 10654 b6a976a399ab
parent 10653 0f30edd43161
child 10655 788f21d925ce
class definition added:6 methods changed: #aspectSelectors #postBuildDiffView: #windowSpec category of:
Tools__TextDiffTool.st
--- a/Tools__TextDiffTool.st	Thu Aug 25 16:11:08 2011 +0200
+++ b/Tools__TextDiffTool.st	Tue Aug 30 10:56:43 2011 +0200
@@ -14,9 +14,9 @@
 "{ NameSpace: Tools }"
 
 ApplicationModel subclass:#TextDiffTool
-	instanceVariableNames:'labelAHolder textAHolder labelBHolder textBHolder classHolder
-		languageHolder codeAspectHolder showDiffHolder diffSpecHolder
-		diffView textAChanged textBChanged codeView'
+	instanceVariableNames:'titleHolder labelAHolder textAHolder labelBHolder textBHolder
+		classHolder languageHolder codeAspectHolder showDiffHolder
+		diffSpecHolder diffView textAChanged textBChanged codeView'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-Diff'
@@ -318,6 +318,7 @@
        (WindowSpec
           label: 'Text Diff Tool'
           name: 'Text Diff Tool'
+          labelChannel: titleHolder
           min: (Point 10 10)
           bounds: (Rectangle 0 0 640 480)
         )
@@ -333,8 +334,6 @@
          
         )
       )
-
-    "Modified: / 30-06-2011 / 20:45:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 windowSpecForEmbedding
@@ -551,20 +550,56 @@
      (if this app is embedded in a subCanvas)."
 
     ^ #(
+        #classHolder
+        #codeAspectHolder
         #labelAHolder
         #labelBHolder
-
+        #languageHolder
+        #showDiffHolder
         #textAHolder
         #textBHolder
-
-        #showDiffHolder
-
-        #classHolder
-        #languageHolder
-        #codeAspectHolder
       ).
 
-    "Modified: / 19-07-2011 / 19:07:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!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>"
+!
+
+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>"
+!
+
+textA: aString
+
+    ^self textAHolder value: aString
+
+    "Created: / 30-08-2011 / 09:43:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+textB: aString
+
+    ^self textBHolder value: aString
+
+    "Created: / 30-08-2011 / 09:43:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+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'!
@@ -802,6 +837,18 @@
     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'!
@@ -890,8 +937,16 @@
 postBuildDiffView:aScrollableView
 
     diffView := aScrollableView.
-    diffView notNil ifTrue:[diffView languageHolder: self languageHolder].
-    diffView notNil ifTrue:[diffView classHolder: self classHolder].
+    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>"
 ! !
@@ -952,7 +1007,7 @@
 !TextDiffTool class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.3 2011-07-19 19:25:25 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__TextDiffTool.st,v 1.4 2011-08-30 08:56:43 vrany Exp $'
 !
 
 version_SVN