history in findClass/openForClass enter field.
authorClaus Gittinger <cg@exept.de>
Thu, 13 Jan 2000 18:14:35 +0100
changeset 2535 ad598fa2bf42
parent 2534 cd41c99e3b03
child 2536 a8c6a77c4151
history in findClass/openForClass enter field.
BrowserView.st
--- a/BrowserView.st	Thu Jan 13 15:04:46 2000 +0100
+++ b/BrowserView.st	Thu Jan 13 18:14:35 2000 +0100
@@ -1487,21 +1487,24 @@
 
     open := doOpen.
     open ifTrue:[
-	title := 'class to browse (Tab to complete or use matchPattern):'.
-	okText := 'open'.
-	okText2 := 'find here'.
+        title := 'class to browse (Tab to complete or use matchPattern):'.
+        okText := 'open'.
+        okText2 := 'find here'.
     ] ifFalse:[
-	title := 'class to find (Tab to complete or use matchPattern):'.
-	okText := 'find'.
-	okText2 := 'open new'.
-    ].
-    box := self enterBoxForCodeSelectionTitle:title okText:okText.
+        title := 'class to find (Tab to complete or use matchPattern):'.
+        okText := 'find'.
+        okText2 := 'open new'.
+    ].
+    box := self 
+                enterBoxForCodeSelectionTitle:title 
+                withList:(ClassHistory collect: [:clsName| clsName upTo: $ ])
+                okText:okText.
     box label:(resources string:'browse or search class').
     openButton := Button label:(resources string:okText2).
     (DialogBox styleSheet at:'dialogBox.okAtLeft' default:false) ifTrue:[
-	box addButton:openButton before:(box okButton).
+        box addButton:openButton before:(box okButton).
     ] ifFalse:[
-	box addButton:openButton after:(box okButton).
+        box addButton:openButton after:(box okButton).
     ].
 
     openButton action:[
@@ -1511,26 +1514,26 @@
     ].
 
     box entryCompletionBlock:[:contents |
-	|s what m|
-
-	s := contents withoutSpaces.
-	what := Smalltalk classnameCompletion:s.
-	box contents:what first.
-	(what at:2) size ~~ 1 ifTrue:[
-	    self beep
-	]
+        |s what m|
+
+        s := contents withoutSpaces.
+        what := Smalltalk classnameCompletion:s.
+        box contents:what first.
+        (what at:2) size ~~ 1 ifTrue:[
+            self beep
+        ]
     ].
     box action:[:aString | className := aString].
     box showAtPointer.
 
     className notNil ifTrue:[
-	open ifTrue:[
-	    brwsr := SystemBrowser open.
-	    "/ brwsr topView waitUntilVisible.
-	] ifFalse:[
-	    brwsr := self
-	].
-	brwsr switchToClassNameMatching:className.
+        open ifTrue:[
+            brwsr := SystemBrowser open.
+            "/ brwsr topView waitUntilVisible.
+        ] ifFalse:[
+            brwsr := self
+        ].
+        brwsr switchToClassNameMatching:className.
     ]
 
     "Created: / 1.6.1996 / 16:03:15 / cg"
@@ -11485,23 +11488,30 @@
 enterBoxForCodeSelectionTitle:title okText:okText
     "convenient method: setup enterBox with text from codeview"
 
+    ^ self enterBoxForCodeSelectionTitle:title withList:nil okText:okText
+!
+
+enterBoxForCodeSelectionTitle:title withList:listOrNil okText:okText
+    "convenient method: setup enterBox with text from codeview"
+
     |sel box initialText superclass|
 
     box := self 
-		enterBoxTitle:(resources string:title) 
-		okText:(resources string:okText).
+                enterBoxTitle:(resources string:title) 
+                withList:listOrNil
+                okText:(resources string:okText).
 
     sel := codeView selection.
     sel notNil ifTrue:[
-	initialText := sel asString withoutSeparators
+        initialText := sel asString withoutSeparators
     ] ifFalse:[
-	(currentClass notNil 
-	and:[(superclass := currentClass superclass) notNil]) ifTrue:[
-	    initialText := superclass name
-	]
+        (currentClass notNil 
+        and:[(superclass := currentClass superclass) notNil]) ifTrue:[
+            initialText := superclass name
+        ]
     ].
     initialText notNil ifTrue:[
-	box initialText:initialText
+        box initialText:initialText
     ].
     ^ box
 
@@ -11528,11 +11538,7 @@
 enterBoxTitle:title okText:okText
     "convenient method: setup enterBox"
 
-    |box|
-
-    box := EnterBox new.
-    box title:(resources string:title) okText:(resources string:okText).
-    ^ box
+    ^ self enterBoxTitle:title withList:nil okText:okText
 !
 
 enterBoxTitle:title okText:okText label:label
@@ -11587,6 +11593,21 @@
     "Modified: 16.1.1997 / 20:13:28 / cg"
 !
 
+enterBoxTitle:title withList:aListOrNil okText:okText
+    "convenient method: setup enterBox"
+
+    |box|
+
+    aListOrNil notNil ifTrue:[
+        box := EnterBoxWithList new.
+        box list:aListOrNil.
+    ] ifFalse:[
+        box := EnterBox new.
+    ].
+    box title:(resources string:title) okText:(resources string:okText).
+    ^ box
+!
+
 extractClassAndSelectorFromSelectionInto:aBlock
     "given a string which can be either 'class>>sel' or
      'class sel', extract className and selector, and call aBlock with
@@ -13628,6 +13649,6 @@
 !BrowserView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.585 2000-01-13 14:04:46 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.586 2000-01-13 17:14:35 cg Exp $'
 ! !
 BrowserView initialize!