Tools__NewClassWizardDialog.st
changeset 9218 86ad5ddea7b5
parent 9216 cc5c43784db2
child 9222 1d6e1f6086f1
equal deleted inserted replaced
9217:23dc587f16b1 9218:86ad5ddea7b5
    12 "{ Package: 'stx:libtool' }"
    12 "{ Package: 'stx:libtool' }"
    13 
    13 
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 SimpleDialog subclass:#NewClassWizardDialog
    16 SimpleDialog subclass:#NewClassWizardDialog
    17         instanceVariableNames:'compilerProviderBlock createdClass languageHolder indexType
    17 	instanceVariableNames:'compilerProviderBlock createdClass languageHolder indexType
    18                 packageHolder classNameHolder instVarNamesHolder openClassChooser
    18 		packageHolder classNameHolder instVarNamesHolder openClassChooser
    19                 superclassNameHolder createRequiredMethodsHolder
    19 		superclassNameHolder createRequiredMethodsHolder
    20                 createPrintMethodHolder createAccessorsHolder
    20 		createPrintMethodHolder createAccessorsHolder
    21                 createUpdateMethodHolder createInitializerHolder
    21 		createUpdateMethodHolder createInitializerHolder
    22                 createInitialGUICodeHolder classInstVarNamesHolder
    22 		createInitialGUICodeHolder classInstVarNamesHolder
    23                 classVarNamesHolder nameSpaceHolder categoryHolder'
    23 		classVarNamesHolder nameSpaceHolder categoryHolder
    24         classVariableNames:'LastLanguage LastSuperclass LastPackage LastNamespace
    24 		stereotypeHolder'
    25                 LastCategory'
    25 	classVariableNames:'LastLanguage LastSuperclass LastPackage LastNamespace
    26         poolDictionaries:''
    26 		LastCategory'
    27         category:'Interface-Browsers-New'
    27 	poolDictionaries:''
       
    28 	category:'Interface-Browsers-New'
    28 !
    29 !
    29 
    30 
    30 !NewClassWizardDialog class methodsFor:'documentation'!
    31 !NewClassWizardDialog class methodsFor:'documentation'!
    31 
    32 
    32 copyright
    33 copyright
   270        (WindowSpec
   271        (WindowSpec
   271           label: 'Tools::NewClassDialog'
   272           label: 'Tools::NewClassDialog'
   272           name: 'Tools::NewClassDialog'
   273           name: 'Tools::NewClassDialog'
   273           min: (Point 10 10)
   274           min: (Point 10 10)
   274           max: (Point 1024 768)
   275           max: (Point 1024 768)
   275           bounds: (Rectangle 0 0 492 566)
   276           bounds: (Rectangle 0 0 506 600)
   276         )
   277         )
   277         component: 
   278         component: 
   278        (SpecCollection
   279        (SpecCollection
   279           collection: (
   280           collection: (
   280            (LabelSpec
   281            (LabelSpec
   307               useIndex: true
   308               useIndex: true
   308             )
   309             )
   309            (LabelSpec
   310            (LabelSpec
   310               label: 'Class Name:'
   311               label: 'Class Name:'
   311               name: 'Label1'
   312               name: 'Label1'
   312               layout: (LayoutFrame 10 0 120 0 180 0 142 0)
   313               layout: (LayoutFrame 10 0 149 0 180 0 171 0)
   313               activeHelpKey: className
   314               activeHelpKey: className
   314               translateLabel: true
   315               translateLabel: true
   315               adjust: right
   316               adjust: right
   316             )
   317             )
   317            (InputFieldSpec
   318            (InputFieldSpec
   318               name: 'EntryField1'
   319               name: 'EntryField1'
   319               layout: (LayoutFrame 190 0 120 0 -32 1 142 0)
   320               layout: (LayoutFrame 190 0 149 0 -32 1 171 0)
   320               activeHelpKey: className
   321               activeHelpKey: className
   321               model: classNameHolder
   322               model: classNameHolder
   322               acceptOnReturn: true
   323               acceptOnReturn: true
   323               acceptOnTab: true
   324               acceptOnTab: true
   324               acceptOnLostFocus: true
   325               acceptOnLostFocus: true
   325               acceptOnPointerLeave: true
   326               acceptOnPointerLeave: true
   326             )
   327             )
   327            (LabelSpec
   328            (LabelSpec
   328               label: 'Superclass:'
   329               label: 'Superclass:'
   329               name: 'Label2'
   330               name: 'Label2'
   330               layout: (LayoutFrame 10 0 150 0 180 0 172 0)
   331               layout: (LayoutFrame 10 0 179 0 180 0 201 0)
   331               activeHelpKey: superclass
   332               activeHelpKey: superclass
   332               translateLabel: true
   333               translateLabel: true
   333               adjust: right
   334               adjust: right
   334             )
   335             )
   335            (ComboBoxSpec
   336            (ComboBoxSpec
   336               name: 'ComboBox1'
   337               name: 'ComboBox1'
   337               layout: (LayoutFrame 190 0 150 0 -32 1 172 0)
   338               layout: (LayoutFrame 190 0 179 0 -32 1 201 0)
   338               activeHelpKey: superclass
   339               activeHelpKey: superclass
   339               model: superclassNameHolder
   340               model: superclassNameHolder
   340               acceptOnLostFocus: true
   341               acceptOnLostFocus: true
   341               comboList: recentlyVisitedClasses
   342               comboList: recentlyVisitedClasses
   342               useIndex: false
   343               useIndex: false
   343             )
   344             )
   344            (ActionButtonSpec
   345            (ActionButtonSpec
   345               label: '...'
   346               label: '...'
   346               name: 'Button1'
   347               name: 'Button1'
   347               layout: (LayoutFrame -22 1 150 0 -2 1 172 0)
   348               layout: (LayoutFrame -22 1 179 0 -2 1 201 0)
   348               activeHelpKey: chooseSuperclass
   349               activeHelpKey: chooseSuperclass
   349               translateLabel: true
   350               translateLabel: true
   350               model: openClassChooser
   351               model: openClassChooser
   351             )
   352             )
   352            (LabelSpec
   353            (LabelSpec
   353               label: 'Package ID:'
   354               label: 'Package ID:'
   354               name: 'Label3'
   355               name: 'Label3'
   355               layout: (LayoutFrame 10 0 190 0 180 0 212 0)
   356               layout: (LayoutFrame 10 0 220 0 180 0 242 0)
   356               activeHelpKey: package
   357               activeHelpKey: package
   357               translateLabel: true
   358               translateLabel: true
   358               adjust: right
   359               adjust: right
   359             )
   360             )
   360            (ComboBoxSpec
   361            (ComboBoxSpec
   361               name: 'ComboBox2'
   362               name: 'ComboBox2'
   362               layout: (LayoutFrame 190 0 190 0 -32 1 212 0)
   363               layout: (LayoutFrame 190 0 219 0 -32 1 241 0)
   363               activeHelpKey: package
   364               activeHelpKey: package
   364               model: packageHolder
   365               model: packageHolder
   365               acceptOnReturn: true
   366               acceptOnReturn: true
   366               acceptOnTab: true
   367               acceptOnTab: true
   367               acceptOnLostFocus: true
   368               acceptOnLostFocus: true
   369               comboList: listOfPackages
   370               comboList: listOfPackages
   370             )
   371             )
   371            (ActionButtonSpec
   372            (ActionButtonSpec
   372               label: '...'
   373               label: '...'
   373               name: 'Button4'
   374               name: 'Button4'
   374               layout: (LayoutFrame -22 1 190 0 -2 1 212 0)
   375               layout: (LayoutFrame -22 1 219 0 -2 1 241 0)
   375               activeHelpKey: packageChooser
   376               activeHelpKey: packageChooser
   376               translateLabel: true
   377               translateLabel: true
   377               model: openPackageChooser
   378               model: openPackageChooser
   378             )
   379             )
   379            (LabelSpec
   380            (LabelSpec
   380               label: 'Namespace:'
   381               label: 'Namespace:'
   381               name: 'Label4'
   382               name: 'Label4'
   382               layout: (LayoutFrame 10 0 220 0 180 0 242 0)
   383               layout: (LayoutFrame 10 0 249 0 180 0 271 0)
   383               activeHelpKey: namespace
   384               activeHelpKey: namespace
   384               translateLabel: true
   385               translateLabel: true
   385               adjust: right
   386               adjust: right
   386             )
   387             )
   387            (ComboListSpec
   388            (ComboListSpec
   388               name: 'ComboList2'
   389               name: 'ComboList2'
   389               layout: (LayoutFrame 190 0 220 0 -32 1 242 0)
   390               layout: (LayoutFrame 190 0 249 0 -32 1 271 0)
   390               activeHelpKey: namespace
   391               activeHelpKey: namespace
   391               model: nameSpaceHolder
   392               model: nameSpaceHolder
   392               comboList: listOfNamespaces
   393               comboList: listOfNamespaces
   393             )
   394             )
   394            (ActionButtonSpec
   395            (ActionButtonSpec
   395               label: '...'
   396               label: '...'
   396               name: 'Button5'
   397               name: 'Button5'
   397               layout: (LayoutFrame -22 1 220 0 -2 1 242 0)
   398               layout: (LayoutFrame -22 1 249 0 -2 1 271 0)
   398               activeHelpKey: namespaceChooser
   399               activeHelpKey: namespaceChooser
   399               translateLabel: true
   400               translateLabel: true
   400               model: openNamespaceChooser
   401               model: openNamespaceChooser
   401             )
   402             )
   402            (LabelSpec
   403            (LabelSpec
   403               label: 'Category:'
   404               label: 'Category:'
   404               name: 'Label12'
   405               name: 'Label12'
   405               layout: (LayoutFrame 10 0 249 0 180 0 271 0)
   406               layout: (LayoutFrame 10 0 279 0 180 0 301 0)
   406               translateLabel: true
   407               translateLabel: true
   407               adjust: right
   408               adjust: right
   408             )
   409             )
   409            (ComboBoxSpec
   410            (ComboBoxSpec
   410               name: 'ComboBox3'
   411               name: 'ComboBox3'
   411               layout: (LayoutFrame 190 0 250 0 -32 1 272 0)
   412               layout: (LayoutFrame 190 0 279 0 -32 1 301 0)
   412               activeHelpKey: namespace
   413               activeHelpKey: namespace
   413               model: categoryHolder
   414               model: categoryHolder
   414               acceptOnLostFocus: true
   415               acceptOnLostFocus: true
   415               comboList: listOfCategories
   416               comboList: listOfCategories
   416             )
   417             )
   417            (ActionButtonSpec
   418            (ActionButtonSpec
   418               label: '...'
   419               label: '...'
   419               name: 'Button6'
   420               name: 'Button6'
   420               layout: (LayoutFrame -22 1 249 0 -2 1 271 0)
   421               layout: (LayoutFrame -22 1 279 0 -2 1 301 0)
   421               activeHelpKey: namespaceChooser
   422               activeHelpKey: namespaceChooser
   422               translateLabel: true
   423               translateLabel: true
   423               model: openCategoryChooser
   424               model: openCategoryChooser
   424             )
   425             )
   425            (LabelSpec
   426            (LabelSpec
   426               label: 'Instance Variables:'
   427               label: 'Instance Variables:'
   427               name: 'Label5'
   428               name: 'Label5'
   428               layout: (LayoutFrame 10 0 289 0 180 0 311 0)
   429               layout: (LayoutFrame 10 0 319 0 180 0 341 0)
   429               activeHelpKey: instanceVariableNames
   430               activeHelpKey: instanceVariableNames
   430               translateLabel: true
   431               translateLabel: true
   431               adjust: right
   432               adjust: right
   432             )
   433             )
   433            (InputFieldSpec
   434            (InputFieldSpec
   434               name: 'EntryField4'
   435               name: 'EntryField4'
   435               layout: (LayoutFrame 190 0 289 0 -32 1 311 0)
   436               layout: (LayoutFrame 190 0 319 0 -32 1 341 0)
   436               activeHelpKey: instanceVariableNames
   437               activeHelpKey: instanceVariableNames
   437               model: instVarNamesHolder
   438               model: instVarNamesHolder
   438               acceptOnReturn: true
   439               acceptOnReturn: true
   439               acceptOnTab: true
   440               acceptOnTab: true
   440               acceptOnLostFocus: true
   441               acceptOnLostFocus: true
   441               acceptOnPointerLeave: true
   442               acceptOnPointerLeave: true
   442             )
   443             )
   443            (LabelSpec
   444            (LabelSpec
   444               label: 'Class Variables:'
   445               label: 'Class Variables:'
   445               name: 'Label6'
   446               name: 'Label6'
   446               layout: (LayoutFrame 10 0 319 0 180 0 341 0)
   447               layout: (LayoutFrame 10 0 349 0 180 0 371 0)
   447               activeHelpKey: classVariableNames
   448               activeHelpKey: classVariableNames
   448               translateLabel: true
   449               translateLabel: true
   449               adjust: right
   450               adjust: right
   450             )
   451             )
   451            (InputFieldSpec
   452            (InputFieldSpec
   452               name: 'EntryField5'
   453               name: 'EntryField5'
   453               layout: (LayoutFrame 190 0 319 0 -32 1 341 0)
   454               layout: (LayoutFrame 190 0 349 0 -32 1 371 0)
   454               activeHelpKey: classVariableNames
   455               activeHelpKey: classVariableNames
   455               model: classVarNamesHolder
   456               model: classVarNamesHolder
   456               acceptOnReturn: true
   457               acceptOnReturn: true
   457               acceptOnTab: true
   458               acceptOnTab: true
   458               acceptOnLostFocus: true
   459               acceptOnLostFocus: true
   459               acceptOnPointerLeave: true
   460               acceptOnPointerLeave: true
   460             )
   461             )
   461            (LabelSpec
   462            (LabelSpec
   462               label: 'Class Instance Variables:'
   463               label: 'Class Instance Variables:'
   463               name: 'Label7'
   464               name: 'Label7'
   464               layout: (LayoutFrame 10 0 349 0 180 0 371 0)
   465               layout: (LayoutFrame 10 0 379 0 180 0 401 0)
   465               activeHelpKey: classInstVariableNames
   466               activeHelpKey: classInstVariableNames
   466               translateLabel: true
   467               translateLabel: true
   467               adjust: right
   468               adjust: right
   468             )
   469             )
   469            (InputFieldSpec
   470            (InputFieldSpec
   470               name: 'EntryField6'
   471               name: 'EntryField6'
   471               layout: (LayoutFrame 190 0 349 0 -32 1 371 0)
   472               layout: (LayoutFrame 190 0 379 0 -32 1 401 0)
   472               activeHelpKey: classInstVariableNames
   473               activeHelpKey: classInstVariableNames
   473               model: classInstVarNamesHolder
   474               model: classInstVarNamesHolder
   474               acceptOnReturn: true
   475               acceptOnReturn: true
   475               acceptOnTab: true
   476               acceptOnTab: true
   476               acceptOnLostFocus: true
   477               acceptOnLostFocus: true
   477               acceptOnPointerLeave: true
   478               acceptOnPointerLeave: true
   478             )
   479             )
   479            (LabelSpec
   480            (LabelSpec
   480               label: 'Create:'
   481               label: 'Create:'
   481               name: 'Label8'
   482               name: 'Label8'
   482               layout: (LayoutFrame 10 0 389 0 110 0 411 0)
   483               layout: (LayoutFrame 10 0 419 0 110 0 441 0)
   483               translateLabel: true
   484               translateLabel: true
   484               adjust: right
   485               adjust: right
   485             )
   486             )
   486            (CheckBoxSpec
   487            (CheckBoxSpec
   487               label: 'Accessors'
   488               label: 'Accessors'
   488               name: 'CheckBox1'
   489               name: 'CheckBox1'
   489               layout: (LayoutFrame 120 0 389 0 280 0 411 0)
   490               layout: (LayoutFrame 120 0 419 0 280 0 441 0)
   490               activeHelpKey: createAccessors
   491               activeHelpKey: createAccessors
   491               model: createAccessorsHolder
   492               model: createAccessorsHolder
   492               translateLabel: true
   493               translateLabel: true
   493             )
   494             )
   494            (CheckBoxSpec
   495            (CheckBoxSpec
   495               label: 'Initial GUI Code'
   496               label: 'Initial Template Code'
   496               name: 'CheckBox6'
   497               name: 'CheckBox6'
   497               layout: (LayoutFrame 310 0 390 0 470 0 412 0)
   498               layout: (LayoutFrame 310 0 419 0 470 0 441 0)
   498               model: createInitialGUICodeHolder
   499               model: createInitialGUICodeHolder
   499               translateLabel: true
   500               translateLabel: true
   500             )
   501             )
   501            (CheckBoxSpec
   502            (CheckBoxSpec
   502               label: 'Initializer'
   503               label: 'Initializer'
   503               name: 'CheckBox2'
   504               name: 'CheckBox2'
   504               layout: (LayoutFrame 120 0 419 0 280 0 441 0)
   505               layout: (LayoutFrame 120 0 449 0 280 0 471 0)
   505               activeHelpKey: createInitializer
   506               activeHelpKey: createInitializer
   506               model: createInitializerHolder
   507               model: createInitializerHolder
   507               translateLabel: true
   508               translateLabel: true
   508             )
   509             )
   509            (CheckBoxSpec
   510            (CheckBoxSpec
   510               label: 'Update Method'
   511               label: 'Update Method'
   511               name: 'CheckBox5'
   512               name: 'CheckBox5'
   512               layout: (LayoutFrame 120 0 449 0 280 0 471 0)
   513               layout: (LayoutFrame 120 0 479 0 280 0 501 0)
   513               activeHelpKey: createUpdateMethod
   514               activeHelpKey: createUpdateMethod
   514               model: createUpdateMethodHolder
   515               model: createUpdateMethodHolder
   515               translateLabel: true
   516               translateLabel: true
   516             )
   517             )
   517            (CheckBoxSpec
   518            (CheckBoxSpec
   518               label: 'Required Methods (Subclass responsibilities)'
   519               label: 'Required Methods (Subclass responsibilities)'
   519               name: 'CheckBox3'
   520               name: 'CheckBox3'
   520               layout: (LayoutFrame 120 0 480 0 400 0 502 0)
   521               layout: (LayoutFrame 120 0 509 0 400 0 531 0)
   521               activeHelpKey: createRequiredMethods
   522               activeHelpKey: createRequiredMethods
   522               model: createRequiredMethodsHolder
   523               model: createRequiredMethodsHolder
   523               translateLabel: true
   524               translateLabel: true
   524             )
   525             )
   525            (CheckBoxSpec
   526            (CheckBoxSpec
   526               label: 'Print Method'
   527               label: 'Print Method'
   527               name: 'CheckBox4'
   528               name: 'CheckBox4'
   528               layout: (LayoutFrame 120 0 509 0 280 0 531 0)
   529               layout: (LayoutFrame 120 0 539 0 280 0 561 0)
   529               activeHelpKey: createPrintMethod
   530               activeHelpKey: createPrintMethod
   530               visibilityChannel: false
   531               visibilityChannel: false
   531               model: createPrintMethodHolder
   532               model: createPrintMethodHolder
   532               translateLabel: true
   533               translateLabel: true
   533             )
   534             )
   557                     extent: (Point 125 22)
   558                     extent: (Point 125 22)
   558                   )
   559                   )
   559                  )
   560                  )
   560                
   561                
   561               )
   562               )
       
   563             )
       
   564            (LabelSpec
       
   565               label: 'Stereotype:'
       
   566               name: 'Label13'
       
   567               layout: (LayoutFrame 10 0 120 0 180 0 142 0)
       
   568               activeHelpKey: className
       
   569               translateLabel: true
       
   570               adjust: right
       
   571             )
       
   572            (ComboListSpec
       
   573               name: 'ComboList3'
       
   574               layout: (LayoutFrame 190 0 119 0 -32 1 141 0)
       
   575               activeHelpKey: programmingLanguage
       
   576               model: stereotypeHolder
       
   577               comboList: listOfStereotypes
       
   578               useIndex: true
   562             )
   579             )
   563            )
   580            )
   564          
   581          
   565         )
   582         )
   566       )
   583       )
   776 self halt.
   793 self halt.
   777 !
   794 !
   778 
   795 
   779 openPackageChooser
   796 openPackageChooser
   780 self halt.
   797 self halt.
       
   798 !
       
   799 
       
   800 stereotypeChanged
       
   801     |stereoType|
       
   802 
       
   803     stereoType := self listOfStereotypes at:(self stereotypeHolder value).
       
   804 
       
   805     stereoType = 'GUIApplication' ifTrue:[
       
   806         self superclassNameHolder value:'ApplicationModel'
       
   807     ].
       
   808     stereoType = 'Widget' ifTrue:[
       
   809         self superclassNameHolder value:'View'
       
   810     ].
       
   811     stereoType = 'WebService' ifTrue:[
       
   812         self superclassNameHolder value:'HTTPService'
       
   813     ].
       
   814     stereoType = 'TestCase' ifTrue:[
       
   815         self superclassNameHolder value:'TestCase'
       
   816     ].
   781 ! !
   817 ! !
   782 
   818 
   783 !NewClassWizardDialog methodsFor:'aspects'!
   819 !NewClassWizardDialog methodsFor:'aspects'!
   784 
   820 
   785 categoryHolder
   821 categoryHolder
   939 
   975 
   940 listOfPackages
   976 listOfPackages
   941     ^ Smalltalk allProjectIDs copy sort
   977     ^ Smalltalk allProjectIDs copy sort
   942 !
   978 !
   943 
   979 
       
   980 listOfStereotypes
       
   981     ^ #(
       
   982         ''
       
   983         GUIApplication
       
   984         Widget
       
   985         WebService
       
   986         TestCase
       
   987         "/ Enumeration
       
   988     )
       
   989 !
       
   990 
   944 nameSpaceHolder
   991 nameSpaceHolder
   945     <resource: #uiAspect>
   992     <resource: #uiAspect>
   946 
   993 
   947     nameSpaceHolder isNil ifTrue:[
   994     nameSpaceHolder isNil ifTrue:[
   948         nameSpaceHolder := ValueHolder new.
   995         nameSpaceHolder := ValueHolder new.
   965     <resource: #uiAspect>
  1012     <resource: #uiAspect>
   966 
  1013 
   967     ^ SystemBrowser visitedClassNamesHistory
  1014     ^ SystemBrowser visitedClassNamesHistory
   968 !
  1015 !
   969 
  1016 
       
  1017 stereotypeHolder
       
  1018     <resource: #uiAspect>
       
  1019 
       
  1020     stereotypeHolder isNil ifTrue:[
       
  1021         stereotypeHolder := ValueHolder new.
       
  1022         stereotypeHolder onChangeSend:#stereotypeChanged to:self.
       
  1023     ].
       
  1024     ^ stereotypeHolder.
       
  1025 !
       
  1026 
   970 superclassNameHolder
  1027 superclassNameHolder
   971     <resource: #uiAspect>
  1028     <resource: #uiAspect>
   972 
  1029 
   973     superclassNameHolder isNil ifTrue:[
  1030     superclassNameHolder isNil ifTrue:[
   974         superclassNameHolder := (LastSuperclass ? 'Object') asValue.
  1031         superclassNameHolder := (LastSuperclass ? 'Object') asValue.
   977 ! !
  1034 ! !
   978 
  1035 
   979 !NewClassWizardDialog class methodsFor:'documentation'!
  1036 !NewClassWizardDialog class methodsFor:'documentation'!
   980 
  1037 
   981 version_CVS
  1038 version_CVS
   982     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewClassWizardDialog.st,v 1.5 2009-11-06 19:04:51 cg Exp $'
  1039     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewClassWizardDialog.st,v 1.6 2009-11-07 03:44:53 cg Exp $'
   983 ! !
  1040 ! !