864 code := (t definition) , '!!\' withCRs , code. |
864 code := (t definition) , '!!\' withCRs , code. |
865 ]. |
865 ]. |
866 ^ code |
866 ^ code |
867 |
867 |
868 "Modified: / 29.7.1998 / 12:21:19 / cg" |
868 "Modified: / 29.7.1998 / 12:21:19 / cg" |
|
869 ! |
|
870 |
|
871 generateAspectSelectorsMethod |
|
872 "generate aspectSelectors method. |
|
873 Return a string ready to compile into the application class." |
|
874 |
|
875 |cls code spec| |
|
876 |
|
877 className isNil ifTrue:[ |
|
878 self warn:'Set first the class!!'. |
|
879 ^ nil |
|
880 ]. |
|
881 |
|
882 (cls := self resolveName:className) isNil ifTrue:[ |
|
883 self warn:'Class ', className asString, ' does not exist!!'. |
|
884 ^ nil |
|
885 ]. |
|
886 spec := treeView exportedAspects. |
|
887 spec size == 0 ifTrue:[^ nil]. |
|
888 |
|
889 "/ make it an array ... |
|
890 spec := spec collect:[:entry | |
|
891 entry type isNil ifTrue:[ |
|
892 entry subAspect |
|
893 ] ifFalse:[ |
|
894 Array with:entry subAspect with:entry type |
|
895 ]. |
|
896 ]. |
|
897 spec := spec asArray. |
|
898 |
|
899 code := '!!' , cls name , ' class methodsFor:''plugIn spec''!!\\' . |
|
900 |
|
901 code := code , 'aspectSelectors |
|
902 "This resource specification was automatically generated |
|
903 by the UIPainter of ST/X." |
|
904 |
|
905 "Do not manually edit this. If it is corrupted, |
|
906 the UIPainter may not be able to read the specification." |
|
907 |
|
908 "Return a description of exported aspects; |
|
909 these can be connected to aspects of an embedding application |
|
910 (if this app is embedded in a subCanvas)." |
|
911 |
|
912 ^ ' , spec storeString , '\!!\'. |
|
913 code := code withCRs. |
|
914 ^ code |
|
915 |
869 ! |
916 ! |
870 |
917 |
871 generateCodeFrom:aListOfSelectors in:aClass do:aBlock |
918 generateCodeFrom:aListOfSelectors in:aClass do:aBlock |
872 |
919 |
873 self class redefineAspectMethods ifTrue:[ |
920 self class redefineAspectMethods ifTrue:[ |