Tools__ChangeList.st
branchjv
changeset 12271 bc7b5cfd0460
parent 12269 79f87eee62e5
child 12272 13be62c15611
--- a/Tools__ChangeList.st	Thu Jul 26 20:10:32 2012 +0100
+++ b/Tools__ChangeList.st	Fri Jul 27 15:56:44 2012 +0100
@@ -142,7 +142,7 @@
           collection: (
            (InputFieldSpec
               name: 'Filter'
-              layout: (LayoutFrame 0 0 0 0 0 1 19 0)
+              layout: (LayoutFrame 0 0 0 0 0 1 25 0)
               initiallyInvisible: true
               model: filterPatternHolder
               immediateAccept: true
@@ -151,8 +151,6 @@
               acceptOnTab: false
               acceptOnPointerLeave: false
               emptyFieldReplacementText: 'Search Filter...'
-              usePreferredHeight: true
-              useDynamicPreferredHeight: true
               postBuildCallback: postBuildFilterView:
             )
            (DataSetSpec
@@ -227,8 +225,8 @@
          id: change
          labelAlignment: left
          labelButtonType: Button
-         model: string
          menuFromApplication: false
+         printSelector: label
          canSelect: false
          showRowSeparator: false
          showColSeparator: false
@@ -431,13 +429,12 @@
         #menuHolder
         #outGeneratorHolder
         #selectionHolder
-        #showTimestampHolder
         #showFilterHolder
         #showRemovedHolder
         #showSameHolder
+        #showTimestampHolder
       ).
 
-    "Modified: / 26-07-2012 / 18:45:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeList methodsFor:'accessing'!
@@ -1078,7 +1075,7 @@
             self selection: { newList last }
         ] ifFalse:[
             oldSel notEmptyOrNil ifTrue:[
-                newSel := oldSel species new: oldSel size.
+                newSel := OrderedCollection new: oldSel size.
                 oldSel := oldSel reject:[:e|e isNil].
                 oldSel := oldSel collect:[:e|e change].
                 newList do:[:e|(oldSel includes:e change) ifTrue:[newSel add:e]].
@@ -1093,7 +1090,7 @@
     ]
 
     "Modified: / 28-12-2011 / 15:46:15 / cg"
-    "Modified: / 26-07-2012 / 18:03:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-07-2012 / 15:12:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !ChangeList methodsFor:'queries'!
@@ -1271,12 +1268,29 @@
 
     | label |
     label := change displayString.
+
+    "Hack: if the printString contains multiple lines, then
+     if there are just 2 lines, then merge them, otherwise add
+     ... to the first line"
+    (label includes: Character cr) ifTrue:[
+        | firstCR secondCR |
+        firstCR := label indexOf: Character cr.
+        firstCR ~~ label size ifTrue:[
+            secondCR := label indexOf: Character cr startingAt: firstCR + 1.
+        ].
+        secondCR isNil ifTrue:[
+            "/2 lines only
+            label := label copy at: firstCR put: Character space.
+        ] ifFalse:[
+            label := (label copyTo: firstCR - 1) , '...'
+        ].
+    ].
     self removed ifTrue:[label := label asText colorizeAllWith: Color gray].
     ^label
 
     "Created: / 05-11-2008 / 08:20:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 25-07-2009 / 23:43:23 / Jan Vrany <vranyj1@fel.cvut.cz>"
-    "Modified: / 05-12-2009 / 14:46:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 27-07-2012 / 15:11:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 notRemoved
@@ -1376,7 +1390,7 @@
 !ChangeList class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Tools__ChangeList.st 8027 2012-07-26 18:46:57Z vranyj1 $'
+    ^ '$Id: Tools__ChangeList.st 8029 2012-07-27 14:56:44Z vranyj1 $'
 !
 
 version_CVS
@@ -1384,5 +1398,5 @@
 !
 
 version_SVN
-    ^ '$Id: Tools__ChangeList.st 8027 2012-07-26 18:46:57Z vranyj1 $'
+    ^ '$Id: Tools__ChangeList.st 8029 2012-07-27 14:56:44Z vranyj1 $'
 ! !