extensions.st
changeset 368 a94d9afd766b
parent 367 bd7749edb1c6
child 369 b268b5cfa98c
--- a/extensions.st	Sat Dec 13 09:02:13 2014 +0000
+++ b/extensions.st	Fri Jan 09 16:22:48 2015 +0000
@@ -684,6 +684,33 @@
     "Modified: / 07-08-2014 / 13:10:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!Tools::NewSystemBrowser methodsFor:'private-dialogs-SmallSense'!
+
+stx_goodies_smallsense_askForMethodCategory:question title:boxTitle okLabel:okLabel list:someCategories recentList:recentListOrNil initialAnswer:initialText
+    "convenient helper method: setup a box asking for a method category"
+
+    <swizzle: #askForMethodCategory:title:okLabel:list:recentList:initialAnswer:>
+
+    | dialog |
+
+    UserPreferences current smallSenseNewDialogsEnabled ifFalse:[ 
+        ^ self stx_libtool_askForMethodCategory:question title:boxTitle okLabel:okLabel list:someCategories recentList:recentListOrNil initialAnswer:initialText     
+    ].
+    dialog := SmallSense::ProtocolSelectDialog new.   
+    dialog title: question.
+    dialog updateMatching.   
+    initialText notNil ifTrue:[ 
+        dialog pattern: initialText.
+        dialog selection: initialText. 
+    ].
+    ^ dialog open
+    "
+    stx_goodies_smallsense swizzle: (Tools::NewSystemBrowser >> #stx_goodies_smallsense_askForMethodCategory:title:okLabel:list:recentList:initialAnswer:)
+    "
+
+    "Created: / 09-01-2015 / 10:44:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !Tools::NewSystemBrowser class methodsFor:'utilities'!
 
 stx_goodies_smallsense_askForClassToSearch:doWhatByDefault single:singleClass msgTail:msgTail resources:resourcesOrNil filter:filterOrNil forBrowser:aBrowserOrNil thenDo:aBlock