SmallSense__AbstractSearchDialog.st
changeset 362 b34840b66447
parent 358 c53e9ee72f71
child 363 4fb5823ae8bf
--- a/SmallSense__AbstractSearchDialog.st	Tue Nov 25 08:00:39 2014 +0000
+++ b/SmallSense__AbstractSearchDialog.st	Tue Nov 25 14:08:22 2014 +0000
@@ -37,11 +37,11 @@
 "
  The following class instance variables are inherited by this class:
 
-	SmallSense::AbstractDIalog -
-	SimpleDialog -
+	SmallSense::AbstractDIalog - 
+	SimpleDialog - 
 	ApplicationModel - ClassResources
-	Model -
-	Object -
+	Model - 
+	Object - 
 "
 !
 
@@ -241,10 +241,11 @@
 !
 
 matchingObjectsSelection: selection
-    self matchingObjectsSelectionHolder value: selection.
+    self matchingObjectsSelectionHolder value: selection withoutNotifying:self.
+    self updateAcceptEnabled.
 
     "Created: / 02-05-2014 / 12:26:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 10-05-2014 / 11:41:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-11-2014 / 13:59:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 multiselect
@@ -447,7 +448,7 @@
     ].
     ^ matchPatternHolder.
 
-    "Modified: / 10-05-2014 / 01:06:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-11-2014 / 13:52:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 matchingObjectsLabelHolder
@@ -592,24 +593,27 @@
     "/ Do not update pattern if it contains match characters
     pattern := matchPatternHolder value.
     pattern notEmptyOrNil ifTrue:[
-	(pattern first isSeparator or:[pattern includesAny: '*?']) ifTrue:[
-	    ^self
+        (pattern first isSeparator or:[pattern includesAny: '*?']) ifTrue:[
+            ^self
         ]
     ].
     selection := matchingObjectsSelectionHolder value.
     selection isSequenceable ifTrue:[
-    	selection size == 1 ifTrue:[
-	    selection := selection anElement.
-    	] ifFalse:[
-	    selection := nil.
-    	]
+        selection size == 1 ifTrue:[
+            selection := selection anElement.
+        ] ifFalse:[
+            selection := nil.
+        ]
     ].
     selection notNil ifTrue:[
         matchPatternHolder value: selection label withoutNotifying: self.
-        matchPatternView selectAll.
+        matchPatternView notNil ifTrue:[
+            matchPatternView selectAll.
+        ]
     ].
 
     "Created: / 06-10-2014 / 23:59:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 25-11-2014 / 13:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateMatchingLabelToNormal
@@ -735,21 +739,18 @@
 
 !AbstractSearchDialog methodsFor:'hooks'!
 
-commonPostOpen
+commonPostBuild
 
-"/    recentlySearchedPatterns notEmptyOrNil ifTrue:[
-"/        matchPatternView contents: self recentlySearchedPatterns last.
-"/        matchPatternView selectAll.
-"/    ].
     matchPatternHolder addDependent:self.
     matchPatternView selectAll.
     matchingObjects isNil ifTrue:[
         self updateMatchingObjectsIgnorePattern.
     ].
     self updateAcceptEnabled.
+    self updateMatchPatternHolderFromSelection.
+    super commonPostBuild
 
-    "Created: / 06-05-2014 / 00:13:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-    "Modified: / 10-05-2014 / 01:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Created: / 25-11-2014 / 13:23:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 postBuildMatchPatternView:aView