SmallSense__ClassSearchDialog.st
changeset 331 eaf776286738
parent 330 055633bb5ceb
child 333 d0698eecaea4
--- a/SmallSense__ClassSearchDialog.st	Tue Apr 29 00:11:40 2014 +0100
+++ b/SmallSense__ClassSearchDialog.st	Wed Apr 30 11:59:10 2014 +0100
@@ -124,46 +124,52 @@
 
 !ClassSearchDialog methodsFor:'searching'!
 
-computeMatchingObjectsForPattern: pattern inEnvironment: environment
-    |  matching root matchFullyQualifiedClassName |
+matchingObjectPOsFor: objects
+    | matchFullyQualifiedClassName |
+
+    matchFullyQualifiedClassName := self matchFullyQualifiedClassNameHolder value.
+    matchFullyQualifiedClassName ifTrue:[
+        objects sort:[:a :b | a displayString < b displayString ].
+    ] ifFalse:[
+        objects sort:[:a :b | a nameWithoutPrefix < b nameWithoutPrefix ].
+    ].
+
+    ^ objects collect:[:each | 
+        (ClassPO new)
+            klass:each;
+            showPrefix:matchFullyQualifiedClassName
+    ].
+
+    "Created: / 30-04-2014 / 09:50:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+matchingObjectsForPattern:pattern inEnvironment:environment 
+    | matching matchFullyQualifiedClassName |
 
     matching := OrderedCollection new.
-    root := self matchingObjectsTree root.
-    matchFullyQualifiedClassName := self matchFullyQualifiedClassNameHolder value.
-
+    matchFullyQualifiedClassName := self matchFullyQualifiedClassNameHolder 
+            value.
     self matchPatternHolder value notEmptyOrNil ifTrue:[
         matchFullyQualifiedClassName ifFalse:[
-            environment allClassesDo:[:cls|
-                (pattern match: cls nameWithoutPrefix) ifTrue:[ 
-                    matching add: cls.
+            environment 
+                allClassesDo:[:cls | 
+                    (pattern match:cls nameWithoutPrefix) ifTrue:[
+                        matching add:cls.
+                    ].
                 ].
-            ].
         ] ifTrue:[
-            environment allClassesDo:[:cls|
-                (pattern match: cls displayString) ifTrue:[
-                    matching add: cls
-                ]
-            ].
+            environment 
+                allClassesDo:[:cls | 
+                    (pattern match:cls displayString) ifTrue:[
+                        matching add:cls
+                    ]
+                ].
         ]
     ].
 
-"/    matching isEmpty ifTrue:[
-"/        self updateNoResults: root.
-"/        ^self
-"/    ].
-
-    matchFullyQualifiedClassName ifTrue:[ 
-        matching sort: [ :a :b | a displayString < b displayString ].
-    ] ifFalse:[ 
-        matching sort: [ :a :b | a nameWithoutPrefix < b nameWithoutPrefix ].
-    ].
-    matching := matching collect: [:each | ClassPO new klass: each; showPrefix: matchFullyQualifiedClassName ].
-
-    root children: matching; expand.
-    matching size == 1 ifTrue:[
-        self matchingObjectsSelectionHolder value: matching anElement
-    ]
+    ^ matching
 
     "Created: / 28-04-2014 / 23:20:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 30-04-2014 / 09:48:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !