--- a/Tools__NewClassWizardDialog.st Wed Nov 11 22:29:24 2009 +0100
+++ b/Tools__NewClassWizardDialog.st Thu Nov 12 14:23:30 2009 +0100
@@ -376,7 +376,7 @@
layout: (LayoutFrame -22 1 179 0 -2 1 201 0)
activeHelpKey: chooseSuperclass
translateLabel: true
- model: openClassChooser
+ model: openSuperClassChooser
)
(LabelSpec
label: 'Package ID:'
@@ -797,16 +797,77 @@
self closeRequest.
!
-openClassChooser
-self halt.
+openCategoryChooser
+ |category|
+
+ category := Dialog
+ choose:'Select a Category'
+ fromList:(Smalltalk allClassCategories asSortedCollection)
+ lines:15.
+ category isNil ifTrue:[^ self].
+
+ self categoryHolder value:category.
!
openNamespaceChooser
-self halt.
+ |browser namespaceString existing|
+
+ (browser := masterApplication) isNil ifTrue:[
+ browser := Tools::NewSystemBrowser basicNew
+ ].
+
+ namespaceString := browser askForNameSpace:'Select or Enter a Namespace' title:'Namespace selection' initialText:'Smalltalk'.
+ namespaceString isNil ifTrue:[^ self].
+
+ existing := Smalltalk classNamed:namespaceString.
+ (existing notNil and:[existing isNamespace]) ifTrue:[
+ "/ exists
+ ] ifFalse:[
+ (existing notNil) ifTrue:[
+ Dialog warn:('"%1" is already defined, but not a namespace' bindWith:namespaceString).
+ ^ self
+ ].
+ ].
+ Class withoutUpdatingChangesDo:[
+ NameSpace name:namespaceString.
+ ].
+ self nameSpaceHolder value:namespaceString.
!
openPackageChooser
-self halt.
+ |browser package|
+
+ (browser := masterApplication) isNil ifTrue:[
+ browser := Tools::NewSystemBrowser basicNew
+ ].
+
+ package := browser askForProject:'Select or Enter a Package-ID'.
+ package isNil ifTrue:[^ self].
+
+ self packageHolder value:package.
+!
+
+openSuperClassChooser
+ |browser class classValid classNameOrNil|
+
+ (browser := masterApplication) isNil ifTrue:[
+ browser := Tools::NewSystemBrowser basicNew
+ ].
+
+ classValid := false.
+ [ classValid ] whileFalse:[
+ classNameOrNil := browser
+ askForClassToSearch:nil
+ single:true
+ msgTail:'Select a Class'
+ resources:nil
+ thenDo:nil.
+
+ classNameOrNil isNil ifTrue:[^ self].
+ class := Smalltalk classNamed:classNameOrNil.
+ classValid := class notNil
+ ].
+ self superclassNameHolder value:class name.
!
stereotypeChanged
@@ -1048,5 +1109,5 @@
!NewClassWizardDialog class methodsFor:'documentation'!
version_CVS
- ^ '$Header: /cvs/stx/stx/libtool/Tools__NewClassWizardDialog.st,v 1.8 2009-11-07 15:56:29 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/Tools__NewClassWizardDialog.st,v 1.9 2009-11-12 13:23:30 cg Exp $'
! !