649 ] |
649 ] |
650 ] |
650 ] |
651 ] |
651 ] |
652 ]. |
652 ]. |
653 |
653 |
654 protoSpec := treeView canvasSpec. |
|
655 |
|
656 (menuSelector := protoSpec menu) notNil ifTrue:[ |
|
657 (menuSelector isArray not) ifTrue:[ |
|
658 thisCode := self generateMenuMethodFor:menuSelector spec:protoSpec inClass:cls. |
|
659 thisCode size ~~ 0 ifTrue:[ |
|
660 code := code , thisCode |
|
661 ] |
|
662 ] |
|
663 ]. |
|
664 |
|
665 ^ code |
654 ^ code |
666 |
|
667 "Modified: / 31.10.1997 / 14:22:30 / cg" |
|
668 ! |
655 ! |
669 |
656 |
670 generateHookMethodFor:selectorSpec comment:commentWhen note:noteOrNil defaultCode:defaultCode inClass:targetClass |
657 generateHookMethodFor:selectorSpec comment:commentWhen note:noteOrNil defaultCode:defaultCode inClass:targetClass |
671 ^ ('!!' , targetClass name , ' methodsFor:''hooks''!!\\' , |
658 ^ ('!!' , targetClass name , ' methodsFor:''hooks''!!\\' , |
672 selectorSpec , '\' , |
659 selectorSpec , '\' , |
742 ]. |
729 ]. |
743 ^ code |
730 ^ code |
744 |
731 |
745 "Modified: / 31.10.1997 / 17:30:34 / cg" |
732 "Modified: / 31.10.1997 / 17:30:34 / cg" |
746 "Created: / 31.10.1997 / 17:32:49 / cg" |
733 "Created: / 31.10.1997 / 17:32:49 / cg" |
747 ! |
|
748 |
|
749 generateMenuMethodFor:aspect spec:protoSpec inClass:aClass |
|
750 |code cperf performer category| |
|
751 |
|
752 (aClass implements:aspect asSymbol) ifFalse:[ |
|
753 code := MenuEditor generateCodeFor:aClass menuSelector:(aspect asSymbol). |
|
754 ] ifTrue:[ |
|
755 code := '' |
|
756 ]. |
|
757 |
|
758 (protoSpec respondsTo:#menuPerformer) ifTrue:[ |
|
759 performer := protoSpec menuPerformer. |
|
760 ]. |
|
761 performer notNil ifTrue:[ |
|
762 performer := performer asSymbol. |
|
763 |
|
764 (aClass implements:performer) ifFalse:[ |
|
765 category := MenuEditor sourceCategory. |
|
766 |
|
767 cperf := Character excla asString |
|
768 , aClass name , ' methodsFor:' , category storeString |
|
769 , Character excla asString , '\\' |
|
770 , performer , '\' |
|
771 , ' "this menu spec was automatically generated by the UI MenuBuilder"\\' |
|
772 , ' ^ self\\' |
|
773 , '\' |
|
774 , Character excla asString |
|
775 , ' ' |
|
776 , Character excla asString |
|
777 , '\\'. |
|
778 |
|
779 code := code, cperf. |
|
780 ] |
|
781 ]. |
|
782 |
|
783 code size == 0 ifTrue:[ |
|
784 ^ nil |
|
785 ]. |
|
786 ^ code withCRs |
|
787 |
|
788 "Modified: / 26.10.1997 / 14:44:20 / cg" |
|
789 ! |
734 ! |
790 |
735 |
791 generateValueMethodFor:aspect spec:protoSpec inClass:targetClass |
736 generateValueMethodFor:aspect spec:protoSpec inClass:targetClass |
792 ^ ('!!' , targetClass name , ' methodsFor:''values''!!\\' , |
737 ^ ('!!' , targetClass name , ' methodsFor:''values''!!\\' , |
793 aspect , '\' , |
738 aspect , '\' , |