UIPainterView.st
changeset 1069 7196ca547f5d
parent 1060 0332a41de5c5
child 1084 5b46f277b3e1
equal deleted inserted replaced
1068:dcb2cba5787f 1069:7196ca547f5d
   697 generateAspectMethods
   697 generateAspectMethods
   698     "generate aspect, action & menu methods
   698     "generate aspect, action & menu methods
   699      - but do not overwrite existing ones.
   699      - but do not overwrite existing ones.
   700      Return a string ready to compile into the application class."
   700      Return a string ready to compile into the application class."
   701 
   701 
   702     |cls code skip menuSelector protoSpec thisCode
   702     |cls code skip protoSpec thisCode
   703      definedMethodSelectors iVars t|
   703      definedMethodSelectors iVars t|
   704 
   704 
   705     definedMethodSelectors := IdentitySet new.
   705     definedMethodSelectors := IdentitySet new.
   706 
   706 
   707     code := ''.
   707     code := ''.
   715         self warn:'Class ', className asString, ' does not exist!!'.
   715         self warn:'Class ', className asString, ' does not exist!!'.
   716         ^ code
   716         ^ code
   717     ].
   717     ].
   718 
   718 
   719     treeView propertiesDo:[:aProp|
   719     treeView propertiesDo:[:aProp|
   720         |modelSelector menuSelector|
   720         |modelSelector|
   721 
   721 
   722         protoSpec := aProp spec.
   722         protoSpec := aProp spec.
   723 
   723 
   724         (modelSelector := aProp model) notNil ifTrue:[
   724         (modelSelector := aProp model) notNil ifTrue:[
   725             self generateCodeFrom:(Array with:modelSelector) in:cls
   725             self generateCodeFrom:(Array with:modelSelector) in:cls
   854 generateHookMethods
   854 generateHookMethods
   855     "generate hook methods
   855     "generate hook methods
   856      - but do not overwrite existing ones.
   856      - but do not overwrite existing ones.
   857      Return a string ready to compile into the application class."
   857      Return a string ready to compile into the application class."
   858 
   858 
   859     |cls code skip menuSelector protoSpec thisCode|
   859     |cls code|
   860 
   860 
   861     code := ''.
   861     code := ''.
   862 
   862 
   863     className isNil ifTrue:[
   863     className isNil ifTrue:[
   864         self warn:'set the class first'.
   864         self warn:'set the class first'.
  1033 generateMenuMethods
  1033 generateMenuMethods
  1034     "generate menu methods
  1034     "generate menu methods
  1035      - but do not overwrite existing ones.
  1035      - but do not overwrite existing ones.
  1036      Return a string ready to compile into the application class."
  1036      Return a string ready to compile into the application class."
  1037 
  1037 
  1038     |cls code skip menuSelector protoSpec thisCode
  1038     |cls code menuSelector thisCode
  1039      definedMethodSelectors iVars t 
  1039      definedMethodSelectors
  1040      specArray fullSpec winSpec menuSpec
  1040      specArray fullSpec winSpec menuSpec
  1041      |
  1041      |
  1042 
  1042 
  1043     className isNil ifTrue:[
  1043     className isNil ifTrue:[
  1044         self warn:'Set first the class!!'.
  1044         self warn:'Define the class first !!'.
  1045         ^ code
  1045         ^ nil
  1046     ].
  1046     ].
  1047 
  1047 
  1048     (cls := self resolveName:className) isNil ifTrue:[
  1048     (cls := self resolveName:className) isNil ifTrue:[
  1049         self warn:'Class ', className asString, ' does not exist!!'.
  1049         self warn:'Class ', className asString, ' does not exist!!'.
  1050         ^ code
  1050         ^ nil
  1051     ].
  1051     ].
  1052 
  1052 
  1053     specArray := treeView generateFullSpecForComponents:#() named:nil.
  1053     specArray := treeView generateFullSpecForComponents:#() named:nil.
  1054     fullSpec := specArray decodeAsLiteralArray.
  1054     fullSpec := specArray decodeAsLiteralArray.
  1055     winSpec := fullSpec window.
  1055     winSpec := fullSpec window.
  1056     menuSelector := winSpec menu.
  1056     menuSelector := winSpec menu.
  1057 
  1057 
  1058     menuSelector isNil ifTrue:[
  1058     (menuSelector notNil 
       
  1059     and:[ (cls respondsTo:menuSelector) ]) ifFalse:[
  1059         self warn:'No menu defined (yet)'.
  1060         self warn:'No menu defined (yet)'.
  1060         ^ code
  1061         ^ nil.
  1061     ].
       
  1062     (cls respondsTo:menuSelector) ifFalse:[
       
  1063         self warn:'No menu defined (yet)'.
       
  1064         ^ code.
       
  1065     ].
  1062     ].
  1066     menuSpec := cls perform:menuSelector.
  1063     menuSpec := cls perform:menuSelector.
  1067     menuSpec := menuSpec decodeAsLiteralArray.
  1064     menuSpec := menuSpec decodeAsLiteralArray.
  1068 
  1065 
  1069     definedMethodSelectors := IdentitySet new.
  1066     definedMethodSelectors := IdentitySet new.