628 |
628 |
629 <resource: #menu> |
629 <resource: #menu> |
630 |
630 |
631 ^ |
631 ^ |
632 #(Menu |
632 #(Menu |
633 ( |
633 ( |
634 (MenuItem |
634 (MenuItem |
635 activeHelpKey: addMenuSeparator |
635 activeHelpKey: addMenuSeparator |
636 label: 'Separator' |
636 label: 'Separator' |
637 itemValue: doCreateSep |
637 itemValue: doCreateSep |
638 translateLabel: true |
638 translateLabel: true |
639 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '') |
639 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSeparator '') |
640 ) |
640 ) |
641 (MenuItem |
641 (MenuItem |
642 activeHelpKey: addMenuItem |
642 activeHelpKey: addMenuItem |
643 label: 'Item' |
643 label: 'Item' |
644 itemValue: doCreateItem |
644 itemValue: doCreateItem |
645 translateLabel: true |
645 translateLabel: true |
646 labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '') |
646 labelImage: (ResourceRetriever #'MenuEditor::Item' iconItem '') |
647 ) |
647 ) |
648 (MenuItem |
648 (MenuItem |
649 activeHelpKey: addMenuSliceItem |
649 activeHelpKey: addMenuSliceItem |
650 label: 'Menu Slice' |
650 label: 'Menu Slice' |
651 itemValue: doCreateMenuSliceItem |
651 itemValue: doCreateMenuSliceItem |
652 translateLabel: true |
652 translateLabel: true |
653 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '') |
653 labelImage: (ResourceRetriever #'MenuEditor::Item' iconSliceMenu '') |
654 ) |
654 ) |
655 (MenuItem |
655 (MenuItem |
656 activeHelpKey: addMenuItem |
656 activeHelpKey: addMenuItem |
657 label: 'Menu' |
657 label: 'Menu' |
658 itemValue: doCreateMenu |
658 itemValue: doCreateMenu |
659 translateLabel: true |
659 translateLabel: true |
660 labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '') |
660 labelImage: (ResourceRetriever #'MenuEditor::Item' iconMenu '') |
661 ) |
661 ) |
662 (MenuItem |
662 (MenuItem |
663 activeHelpKey: addSubMenuLink |
663 activeHelpKey: addSubMenuLink |
664 label: 'Linked Menu' |
664 label: 'Linked Menu' |
665 itemValue: doCreateLinkedMenu |
665 itemValue: doCreateLinkedMenu |
666 translateLabel: true |
666 translateLabel: true |
667 labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '') |
667 labelImage: (ResourceRetriever #'MenuEditor::Item' iconLinkedMenu '') |
668 ) |
668 ) |
669 (MenuItem |
669 (MenuItem |
670 label: '-' |
670 label: '-' |
671 ) |
671 ) |
672 (MenuItem |
672 (MenuItem |
673 activeHelpKey: addDelayedMenu |
673 activeHelpKey: addDelayedMenu |
674 enabled: canCreateDelayedMenuChannel |
674 enabled: canCreateDelayedMenuChannel |
675 label: 'Delayed Menu' |
675 label: 'Delayed Menu' |
676 itemValue: doCreateDelayedMenu: |
676 itemValue: doCreateDelayedMenu: |
677 translateLabel: true |
677 translateLabel: true |
678 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '') |
678 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedMenu '') |
679 argument: menu |
679 argument: menu |
680 ) |
680 ) |
681 (MenuItem |
681 (MenuItem |
682 activeHelpKey: addDelayedSubMenuLink |
682 activeHelpKey: addDelayedSubMenuLink |
683 enabled: canCreateDelayedMenuChannel |
683 enabled: canCreateDelayedMenuChannel |
684 label: 'Delayed Linked Menu' |
684 label: 'Delayed Linked Menu' |
685 itemValue: doCreateDelayedMenu: |
685 itemValue: doCreateDelayedMenu: |
686 translateLabel: true |
686 translateLabel: true |
687 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '') |
687 labelImage: (ResourceRetriever #'MenuEditor::Item' iconDelayedLinkedMenu '') |
688 argument: linkedMenu |
688 argument: linkedMenu |
689 ) |
689 ) |
690 (MenuItem |
690 (MenuItem |
691 label: '-' |
691 label: '-' |
692 ) |
692 ) |
693 (MenuItem |
693 (MenuItem |
694 label: 'Standard Menus' |
694 label: 'Standard Menus' |
695 translateLabel: true |
695 translateLabel: true |
696 submenuChannel: standardMenus |
696 submenuChannel: standardMenus |
697 keepLinkedMenu: true |
697 keepLinkedMenu: true |
698 ) |
698 ) |
699 ) |
699 ) |
700 nil |
700 "/ nil |
701 nil |
701 "/ nil |
702 ) |
702 ) |
703 ! |
703 ! |
704 |
704 |
705 editMenu |
705 editMenu |
706 "This resource specification was automatically generated |
706 "This resource specification was automatically generated |
714 (Menu new fromLiteralArrayEncoding:(MenuEditor editMenu)) startUp |
714 (Menu new fromLiteralArrayEncoding:(MenuEditor editMenu)) startUp |
715 " |
715 " |
716 |
716 |
717 <resource: #menu> |
717 <resource: #menu> |
718 |
718 |
719 ^ |
719 ^ |
720 #(Menu |
720 #(Menu |
721 ( |
721 ( |
722 (MenuItem |
722 (MenuItem |
723 activeHelpKey: editCut |
723 activeHelpKey: editCut |
724 enabled: hasSelectionChannel |
724 enabled: hasSelectionChannel |
725 label: 'Cut' |
725 label: 'Cut' |
726 itemValue: doCut |
726 itemValue: doCut |
727 translateLabel: true |
727 translateLabel: true |
728 shortcutKey: Cut |
728 shortcutKey: Cut |
729 ) |
729 ) |
730 (MenuItem |
730 (MenuItem |
731 activeHelpKey: editCopy |
731 activeHelpKey: editCopy |
732 enabled: hasSelectionChannel |
732 enabled: hasSelectionChannel |
733 label: 'Copy' |
733 label: 'Copy' |
734 itemValue: doCopy |
734 itemValue: doCopy |
735 translateLabel: true |
735 translateLabel: true |
736 shortcutKey: Copy |
736 shortcutKey: Copy |
737 ) |
737 ) |
738 (MenuItem |
738 (MenuItem |
739 activeHelpKey: editPaste |
739 activeHelpKey: editPaste |
740 enabled: canPasteHolder |
740 enabled: canPasteHolder |
741 label: 'Paste' |
741 label: 'Paste' |
742 itemValue: doPaste |
742 itemValue: doPaste |
743 translateLabel: true |
743 translateLabel: true |
744 shortcutKey: Paste |
744 shortcutKey: Paste |
745 ) |
745 ) |
746 (MenuItem |
746 (MenuItem |
747 activeHelpKey: editDelete |
747 activeHelpKey: editDelete |
748 enabled: hasSelectionChannel |
748 enabled: hasSelectionChannel |
749 label: 'Delete' |
749 label: 'Delete' |
750 itemValue: doDelete |
750 itemValue: doDelete |
751 translateLabel: true |
751 translateLabel: true |
752 isVisible: false |
752 isVisible: false |
753 ) |
753 ) |
754 (MenuItem |
754 (MenuItem |
755 label: '-' |
755 label: '-' |
756 ) |
756 ) |
757 (MenuItem |
757 (MenuItem |
758 activeHelpKey: editMoveUp |
758 activeHelpKey: editMoveUp |
759 enabled: enableMovingUpOrDownHolder |
759 enabled: enableMovingUpOrDownHolder |
760 label: 'Move Up' |
760 label: 'Move Up' |
761 itemValue: doMoveUpOrDown: |
761 itemValue: doMoveUpOrDown: |
762 translateLabel: true |
762 translateLabel: true |
763 startGroup: right |
763 startGroup: right |
764 argument: up |
764 shortcutKey: CtrlCursorUp |
765 shortcutKey: CtrlCursorUp |
765 labelImage: (ResourceRetriever Icon upIcon 'Move Up') |
766 labelImage: (ResourceRetriever Icon upIcon 'Move Up') |
766 argument: up |
767 "/ labelImage: (ResourceRetriever ToolbarIconLibrary up16x16Icon 'Move Up') |
767 ) |
768 ) |
768 (MenuItem |
769 (MenuItem |
769 activeHelpKey: editMoveDown |
770 activeHelpKey: editMoveDown |
770 enabled: enableMovingUpOrDownHolder |
771 enabled: enableMovingUpOrDownHolder |
771 label: 'Move Down' |
772 label: 'Move Down' |
772 itemValue: doMoveUpOrDown: |
773 itemValue: doMoveUpOrDown: |
773 translateLabel: true |
774 translateLabel: true |
774 shortcutKey: CtrlCursorDown |
775 shortcutKey: CtrlCursorDown |
775 labelImage: (ResourceRetriever Icon downIcon 'Move Down') |
776 labelImage: (ResourceRetriever Icon downIcon 'Move Down') |
776 argument: down |
777 argument: down |
777 ) |
778 ) |
778 (MenuItem |
779 (MenuItem |
779 activeHelpKey: editMoveIn |
780 activeHelpKey: editMoveIn |
780 enabled: enableMovingInHolder |
781 enabled: enableMovingInHolder |
781 label: 'Move Into Next' |
782 label: 'Move Into Next' |
782 itemValue: doMoveIn: |
783 itemValue: doMoveIn: |
783 translateLabel: true |
784 translateLabel: true |
784 shortcutKey: CtrlCursorRight |
785 shortcutKey: CtrlCursorRight |
785 labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next') |
786 labelImage: (ResourceRetriever Icon downRightIcon 'Move Into Next') |
786 argument: inNext |
787 argument: inNext |
787 ) |
788 ) |
788 (MenuItem |
789 (MenuItem |
789 activeHelpKey: editMoveInAbove |
790 activeHelpKey: editMoveInAbove |
790 enabled: enableMovingInAboveHolder |
791 enabled: enableMovingInAboveHolder |
791 label: 'Move Into Previous' |
792 label: 'Move Into Previous' |
792 itemValue: doMoveIn: |
793 itemValue: doMoveIn: |
793 translateLabel: true |
794 translateLabel: true |
794 labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous' ) |
795 labelImage: (ResourceRetriever Icon upRightIcon 'Move Into Previous') |
795 argument: inPrev |
796 argument: inPrev |
796 ) |
797 ) |
797 (MenuItem |
798 (MenuItem |
798 activeHelpKey: editMoveOut |
799 activeHelpKey: editMoveOut |
799 enabled: enableMovingOutHolder |
800 enabled: enableMovingOutHolder |
800 label: 'Move Out' |
801 label: 'Move Out' |
801 itemValue: doMoveOut |
802 itemValue: doMoveOut |
802 translateLabel: true |
803 translateLabel: true |
803 shortcutKey: CtrlCursorLeft |
804 shortcutKey: CtrlCursorLeft |
804 labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out' ) |
805 labelImage: (ResourceRetriever Icon leftDownIcon 'Move Out') |
805 ) |
806 ) |
806 ) |
807 ) |
807 nil |
808 nil |
808 nil |
809 nil |
|
810 ) |
809 ) |
811 ! |
810 ! |
812 |
811 |
813 editMenuForMainMenuWithoutAccelerators |
812 editMenuForMainMenuWithoutAccelerators |
814 "This resource specification was automatically generated |
813 "This resource specification was automatically generated |
1975 self enableMovingInAboveHolder value:(selectedItem canMoveInAbove). |
1974 self enableMovingInAboveHolder value:(selectedItem canMoveInAbove). |
1976 self canCreateDelayedMenuChannel value:(selectedItem canAddDelayedMenu). |
1975 self canCreateDelayedMenuChannel value:(selectedItem canAddDelayedMenu). |
1977 ]. |
1976 ]. |
1978 ! ! |
1977 ! ! |
1979 |
1978 |
1980 !MenuEditor methodsFor:'code generation'! |
|
1981 |
|
1982 createActionMethodFor:aSelector in:aClass category:aCategory redefine:redefine |
|
1983 |alreadyInSuperclass numArgs method code| |
|
1984 |
|
1985 (aClass includesSelector:aSelector) ifTrue:[ |
|
1986 ^ nil |
|
1987 ]. |
|
1988 |
|
1989 alreadyInSuperclass := aClass superclass canUnderstand:aSelector. |
|
1990 |
|
1991 (alreadyInSuperclass and:[redefine not]) ifTrue:[ |
|
1992 ^ nil |
|
1993 ]. |
|
1994 |
|
1995 numArgs := aSelector numArgs. |
|
1996 |
|
1997 numArgs == 1 ifTrue:[ |
|
1998 method := aSelector, 'anArgument'. |
|
1999 ] ifFalse:[ |
|
2000 numArgs == 0 ifTrue:[ |
|
2001 method := aSelector |
|
2002 ] ifFalse:[ |
|
2003 method := ''. |
|
2004 aSelector keywords keysAndValuesDo:[:i :key| |
|
2005 method := method, key, 'arg', i printString, ' '. |
|
2006 ]. |
|
2007 ] |
|
2008 ]. |
|
2009 |
|
2010 code := '%1 |
|
2011 "automatically generated by UIEditor ..." |
|
2012 |
|
2013 "*** the code below performs no action" |
|
2014 "*** (except for some feedback on the Transcript)" |
|
2015 "*** Please change as required and accept in the browser." |
|
2016 "*** (and replace this comment by something more useful ;-)" |
|
2017 |
|
2018 "action to be added ..." |
|
2019 |
|
2020 Transcript showCR:self class name, '': action for #%2 ...''. |
|
2021 ' bindWith:method with:aSelector. |
|
2022 |
|
2023 alreadyInSuperclass ifTrue:[ |
|
2024 code := code, (('\ super %1\' bindWith:method) withCRs). |
|
2025 ]. |
|
2026 CodeGeneratorTool compile:code forClass:aClass inCategory:(aCategory ? 'actions'). |
|
2027 ^ code |
|
2028 ! |
|
2029 |
|
2030 createAspectMethodFor:anAspect in:aClass category:aCategory redefine:redefine |
|
2031 |alreadyInSuperclass numArgs method code text| |
|
2032 |
|
2033 (aClass includesSelector:anAspect) ifTrue:[ |
|
2034 ^ nil |
|
2035 ]. |
|
2036 |
|
2037 alreadyInSuperclass := aClass superclass canUnderstand:anAspect. |
|
2038 |
|
2039 (alreadyInSuperclass and:[redefine not]) ifTrue:[ |
|
2040 ^ nil |
|
2041 ]. |
|
2042 |
|
2043 numArgs := anAspect numArgs. |
|
2044 |
|
2045 numArgs == 1 ifTrue:[ |
|
2046 method := anAspect, 'anArgument'. |
|
2047 ] ifFalse:[ |
|
2048 numArgs == 0 ifTrue:[ |
|
2049 method := anAspect |
|
2050 ] ifFalse:[ |
|
2051 method := ''. |
|
2052 anAspect keywords keysAndValuesDo:[:i :key| |
|
2053 method := method, key, 'arg', i printString, ' '. |
|
2054 ]. |
|
2055 ] |
|
2056 ]. |
|
2057 |
|
2058 code := '%1 |
|
2059 "automatically generated by UIEditor ..." |
|
2060 |
|
2061 "*** the code below creates a default model when invoked" |
|
2062 "*** (which may not be the one you wanted)" |
|
2063 "*** Please change as required and accept in the browser." |
|
2064 "*** (and replace this comment by something more useful ;-)" |
|
2065 |
|
2066 "aspect to be added ..." |
|
2067 |
|
2068 Transcript showCR:self class name, '': aspect for #%2 ...''. |
|
2069 |
|
2070 ' bindWith:method with:anAspect. |
|
2071 |
|
2072 alreadyInSuperclass ifTrue:[ |
|
2073 text := ' ^ super %1\' bindWith:method. |
|
2074 ] ifFalse:[ |
|
2075 text := ' ^ builder valueAspectFor:#''%1'' initialValue:true\' bindWith:anAspect. |
|
2076 ]. |
|
2077 code := code, (text withCRs). |
|
2078 CodeGeneratorTool compile:code forClass:aClass inCategory:(aCategory ? 'actions'). |
|
2079 ^ code |
|
2080 ! ! |
|
2081 |
|
2082 !MenuEditor methodsFor:'defaults'! |
1979 !MenuEditor methodsFor:'defaults'! |
2083 |
1980 |
2084 aboutImage |
1981 aboutImage |
2085 "the image to be displayed in my about-box; |
1982 "the image to be displayed in my about-box; |
2086 If nil is returned, the ST/X default image is used. |
1983 If nil is returned, the ST/X default image is used. |
2239 |
2136 |
2240 processEvent:anEvent |
2137 processEvent:anEvent |
2241 "filter keyboard edit-events typed into the listOfItemsView. |
2138 "filter keyboard edit-events typed into the listOfItemsView. |
2242 Return true, if I have eaten the event" |
2139 Return true, if I have eaten the event" |
2243 |
2140 |
2244 |evView inView rawKey key| |
2141 |evView rawKey key| |
2245 |
2142 |
2246 anEvent isKeyPressEvent ifFalse:[^ false]. |
2143 anEvent isKeyPressEvent ifFalse:[^ false]. |
2247 |
2144 |
2248 evView := anEvent targetView. |
2145 evView := anEvent targetView. |
2249 evView isNil ifTrue:[ ^ false ]. |
2146 evView isNil ifTrue:[ ^ false ]. |
2250 |
2147 |
2251 "/ only handle keyboard events for the left item list |
2148 "/ only handle keyboard events for the left item list |
2252 "/ (otherwise, copy-paste would not work in the editFields on the right) |
2149 "/ (otherwise, copy-paste would not work in the editFields on the right) |
2253 inView := evView isSameOrComponentOf:listOfItemsView. |
2150 (evView isSameOrComponentOf:listOfItemsView) ifFalse:[^ false]. |
2254 inView ifFalse:[^ false]. |
|
2255 |
2151 |
2256 key := anEvent key. |
2152 key := anEvent key. |
2257 rawKey := anEvent rawKey. |
2153 rawKey := anEvent rawKey. |
2258 |
2154 |
2259 ( key == #Delete |
2155 ( key == #Delete |
2360 "reset keyboardProcessor for menuBar" |
2256 "reset keyboardProcessor for menuBar" |
2361 |
2257 |
2362 super postOpenWith: aBuilder. |
2258 super postOpenWith: aBuilder. |
2363 aBuilder keyboardProcessor menuBar:nil. |
2259 aBuilder keyboardProcessor menuBar:nil. |
2364 self windowGroup addPreEventHook:self. |
2260 self windowGroup addPreEventHook:self. |
|
2261 ! ! |
|
2262 |
|
2263 !MenuEditor methodsFor:'menus-dynamic'! |
|
2264 |
|
2265 submenuTest |
|
2266 "returns a menu on the current editing menu |
|
2267 " |
|
2268 |menu indication choice submenu retriever| |
|
2269 |
|
2270 menu := listOfItems root submenu. |
|
2271 menu isNil ifTrue:[^ nil ]. |
|
2272 |
|
2273 menu allItemsDo:[:anItem| |
|
2274 anItem ignoreShortcutKeys:true. |
|
2275 anItem isVisible:true. |
|
2276 anItem enabled:true. |
|
2277 anItem translateLabel:false. |
|
2278 |
|
2279 anItem itemValue notNil ifTrue:[ |
|
2280 anItem itemValue:[ Transcript showCR:(anItem label) ]. |
|
2281 ]. |
|
2282 anItem indication notNil ifTrue:[ |
|
2283 indication isNil ifTrue:[ indication := true asValue ]. |
|
2284 anItem indication:indication |
|
2285 ]. |
|
2286 anItem choice notNil ifTrue:[ |
|
2287 choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
|
2288 anItem choice:choice |
|
2289 ]. |
|
2290 anItem isMenuSlice ifTrue:[ |
|
2291 anItem submenuChannel:nil. |
|
2292 anItem label:'... Slice Menu ...'. |
|
2293 ]. |
|
2294 anItem submenuChannel notNil ifTrue:[ |
|
2295 anItem submenuChannel:nil. |
|
2296 anItem submenu isNil ifTrue:[ |
|
2297 submenu isNil ifTrue:[ |
|
2298 submenu := Menu new. |
|
2299 submenu addItem:(MenuItem labeled:'Linked Menu...'). |
|
2300 ]. |
|
2301 anItem submenu:submenu. |
|
2302 ]. |
|
2303 ]. |
|
2304 retriever := anItem resourceRetriever. |
|
2305 retriever notNil ifTrue:[ |
|
2306 retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ] |
|
2307 ]. |
|
2308 ]. |
|
2309 menu findGuiResourcesIn:(self resolveName:specClass). |
|
2310 ^ menu |
2365 ! ! |
2311 ! ! |
2366 |
2312 |
2367 !MenuEditor methodsFor:'private'! |
2313 !MenuEditor methodsFor:'private'! |
2368 |
2314 |
2369 addAndSelectValueOf:aBlockOrItem |
2315 addAndSelectValueOf:aBlockOrItem |
2426 spec := WriteStream on:String new. |
2372 spec := WriteStream on:String new. |
2427 UISpecification prettyPrintSpecArray:menu on:spec indent:5. |
2373 UISpecification prettyPrintSpecArray:menu on:spec indent:5. |
2428 ^ spec contents. |
2374 ^ spec contents. |
2429 ! |
2375 ! |
2430 |
2376 |
2431 submenuTest |
|
2432 "returns a menu on the current editing menu |
|
2433 " |
|
2434 |menu indication choice submenu retriever| |
|
2435 |
|
2436 menu := listOfItems root submenu. |
|
2437 menu isNil ifTrue:[^ nil ]. |
|
2438 |
|
2439 menu allItemsDo:[:anItem| |
|
2440 anItem isVisible:true. |
|
2441 anItem enabled:true. |
|
2442 anItem translateLabel:false. |
|
2443 |
|
2444 anItem itemValue notNil ifTrue:[ |
|
2445 anItem itemValue:[ Transcript showCR:(anItem label) ]. |
|
2446 ]. |
|
2447 anItem indication notNil ifTrue:[ |
|
2448 indication isNil ifTrue:[ indication := true asValue ]. |
|
2449 anItem indication:indication |
|
2450 ]. |
|
2451 anItem choice notNil ifTrue:[ |
|
2452 choice isNil ifTrue:[ choice := anItem choiceValue asValue ]. |
|
2453 anItem choice:choice |
|
2454 ]. |
|
2455 anItem isMenuSlice ifTrue:[ |
|
2456 anItem submenuChannel:nil. |
|
2457 anItem label:'... Slice Menu ...'. |
|
2458 ]. |
|
2459 anItem submenuChannel notNil ifTrue:[ |
|
2460 anItem submenuChannel:nil. |
|
2461 anItem submenu isNil ifTrue:[ |
|
2462 submenu isNil ifTrue:[ |
|
2463 submenu := Menu new. |
|
2464 submenu addItem:(MenuItem labeled:'Linked Menu...'). |
|
2465 ]. |
|
2466 anItem submenu:submenu. |
|
2467 ]. |
|
2468 ]. |
|
2469 retriever := anItem resourceRetriever. |
|
2470 retriever notNil ifTrue:[ |
|
2471 retriever labelText notNil ifTrue:[ retriever labelText:(anItem label) ] |
|
2472 ]. |
|
2473 ]. |
|
2474 menu findGuiResourcesIn:(self resolveName:specClass). |
|
2475 ^ menu |
|
2476 ! |
|
2477 |
|
2478 withoutNotifyDo:aBlock |
2377 withoutNotifyDo:aBlock |
2479 "evaluate the block; all change notifications are |
2378 "evaluate the block; all change notifications are |
2480 discard during the block is evaluated" |
2379 discard during the block is evaluated" |
2481 |
2380 |
2482 |blockResult| |
2381 |blockResult| |
2587 "compile aspect and action methods" |
2486 "compile aspect and action methods" |
2588 |
2487 |
2589 |cls redefineAspectMethods category| |
2488 |cls redefineAspectMethods category| |
2590 |
2489 |
2591 specClass isNil ifTrue:[ |
2490 specClass isNil ifTrue:[ |
2592 self warn:'Define the class first !!'. |
2491 self warn:'Define the class first !!'. |
2593 ^ self |
2492 ^ self |
2594 ]. |
2493 ]. |
2595 redefineAspectMethods := self redefineAspectMethodsChannel value. |
2494 redefineAspectMethods := self redefineAspectMethodsChannel value. |
2596 |
2495 |
2597 cls := self resolveName:specClass. |
2496 cls := self resolveName:specClass. |
2598 cls isNil ifTrue:[ |
2497 cls isNil ifTrue:[ |
2599 self warn:'Class ', specClass asString, ' does not exist!!'. |
2498 self warn:'Class ', specClass asString, ' does not exist!!'. |
2600 ^ self |
2499 ^ self |
2601 ]. |
2500 ]. |
2602 |
2501 |
2603 category := UserPreferences current categoryForMenuActionsMethods. |
2502 category := UserPreferences current categoryForMenuActionsMethods. |
2604 |
2503 |
2605 self collectActionSelectors do:[:aSelector| |
2504 self collectActionSelectors do:[:aSelector| |
2606 self |
2505 CodeGeneratorTool |
2607 createActionMethodFor:aSelector in:cls |
2506 createActionMethodFor:aSelector in:cls |
2608 category:category |
2507 category:category |
2609 redefine:redefineAspectMethods. |
2508 redefine:redefineAspectMethods. |
2610 ]. |
2509 ]. |
2611 |
2510 |
2612 self collectAspectSelectors do:[:anAspect| |
2511 self collectAspectSelectors do:[:anAspect| |
2613 self |
2512 CodeGeneratorTool |
2614 createAspectMethodFor:anAspect in:cls |
2513 createAspectMethodFor:anAspect in:cls |
2615 category:category |
2514 category:category |
2616 redefine:redefineAspectMethods |
2515 redefine:redefineAspectMethods |
2617 ]. |
2516 ]. |
2618 ! ! |
2517 ! ! |
2619 |
2518 |
2620 !MenuEditor methodsFor:'user actions-building'! |
2519 !MenuEditor methodsFor:'user actions-building'! |
2621 |
2520 |