471 |
471 |
472 "Modified: 30.8.1995 / 22:49:49 / claus" |
472 "Modified: 30.8.1995 / 22:49:49 / claus" |
473 ! |
473 ! |
474 |
474 |
475 classCategoryMenu |
475 classCategoryMenu |
476 |specialMenu m labels selectors| |
476 |specialMenu m labels selectors shorties| |
477 |
477 |
478 currentClassCategory notNil ifTrue:[ |
478 currentClassCategory notNil ifTrue:[ |
479 labels := #( |
479 labels := #( |
480 'fileOut each binary ...' |
480 'fileOut each binary ...' |
481 '-' |
481 '-' |
482 'overall history ...' |
482 'overall history ...' |
483 '-' |
483 '-' |
484 'checkin each ...' |
484 'checkin each ...' |
485 ). |
485 ). |
486 selectors := #( |
486 selectors := #( |
487 classCategoryFileOutBinaryEach |
487 classCategoryFileOutBinaryEach |
488 nil |
488 nil |
489 classCategoryRepositoryHistory |
489 classCategoryRepositoryHistory |
490 nil |
490 nil |
491 classCategoryCheckinEach |
491 classCategoryCheckinEach |
492 ). |
492 ). |
493 ] ifFalse:[ |
493 ] ifFalse:[ |
494 labels := #( |
494 labels := #( |
495 'overall history ...' |
495 'overall history ...' |
496 ). |
496 ). |
497 selectors := #( |
497 selectors := #( |
498 classCategoryRepositoryHistory |
498 classCategoryRepositoryHistory |
499 ). |
499 ). |
500 ]. |
500 ]. |
501 |
501 |
502 specialMenu := PopUpMenu |
502 specialMenu := PopUpMenu |
503 labels:(resources array:labels) |
503 labels:(resources array:labels) |
504 selectors:selectors |
504 selectors:selectors |
505 receiver:self. |
505 receiver:self. |
506 |
506 |
507 device ctrlDown ifTrue:[ |
507 device ctrlDown ifTrue:[ |
508 ^ specialMenu |
508 ^ specialMenu |
509 ]. |
509 ]. |
510 |
510 |
511 currentClassCategory isNil ifTrue:[ |
511 currentClassCategory isNil ifTrue:[ |
512 labels := #( |
512 labels := #( |
513 'clone' |
513 'clone' |
514 'spawn full class' |
514 'spawn full class' |
515 '-' |
515 '-' |
516 'update' |
516 'update' |
517 'find class ...' |
517 'find class ...' |
518 'find method ...' |
518 'find method ...' |
519 '-' |
519 '-' |
520 'new class category ...' |
520 'new class category ...' |
521 '-' |
521 '-' |
522 'others ...' |
522 'others ...' |
523 ). |
523 ). |
524 selectors := #( |
524 selectors := #( |
525 classCategoryClone |
525 classCategoryClone |
526 classCategorySpawnFullClass |
526 classCategorySpawnFullClass |
527 nil |
527 nil |
528 classCategoryUpdate |
528 classCategoryUpdate |
529 classCategoryFindClass |
529 classCategoryFindClass |
530 classCategoryFindMethod |
530 classCategoryFindMethod |
531 nil |
531 nil |
532 classCategoryNewCategory |
532 classCategoryNewCategory |
533 nil |
533 nil |
534 otherMenu |
534 otherMenu |
535 ). |
535 ). |
|
536 shorties := #( |
|
537 nil |
|
538 nil |
|
539 nil |
|
540 nil |
|
541 Find |
|
542 nil |
|
543 nil |
|
544 nil |
|
545 nil |
|
546 #'Ctrl' |
|
547 ). |
536 ] ifFalse:[ |
548 ] ifFalse:[ |
537 labels := #( |
549 labels := #( |
538 'fileOut' |
550 'fileOut' |
539 'fileOut each' |
551 'fileOut each' |
540 "/ |
552 'printOut' |
541 "/ 'fileOut binary' |
553 'printOut protocol' |
542 "/ |
554 '-' |
543 'printOut' |
555 'clone' |
544 'printOut protocol' |
556 'SPAWN_CATEGORY' |
545 '-' |
557 'spawn full class' |
546 'clone' |
558 '-' |
547 'SPAWN_CATEGORY' |
559 'update' |
548 'spawn full class' |
560 'find class ...' |
549 '-' |
561 'find method ...' |
550 'update' |
562 '-' |
551 'find class ...' |
563 'new class category ...' |
552 'find method ...' |
564 'rename ...' |
553 '-' |
565 'remove' |
554 'new class category ...' |
566 '-' |
555 'rename ...' |
567 'others ...' |
556 'remove' |
568 ). |
557 '-' |
569 selectors := #( |
558 'others ...' |
570 classCategoryFileOut |
559 ). |
571 classCategoryFileOutEach |
560 selectors := #( |
572 classCategoryPrintOut |
561 classCategoryFileOut |
573 classCategoryPrintOutProtocol |
562 classCategoryFileOutEach |
574 nil |
563 classCategoryPrintOut |
575 classCategoryClone |
564 classCategoryPrintOutProtocol |
576 classCategorySpawn |
565 nil |
577 classCategorySpawnFullClass |
566 classCategoryClone |
578 nil |
567 classCategorySpawn |
579 classCategoryUpdate |
568 classCategorySpawnFullClass |
580 classCategoryFindClass |
569 nil |
581 classCategoryFindMethod |
570 classCategoryUpdate |
582 nil |
571 classCategoryFindClass |
583 classCategoryNewCategory |
572 classCategoryFindMethod |
584 classCategoryRename |
573 nil |
585 classCategoryRemove |
574 classCategoryNewCategory |
586 nil |
575 classCategoryRename |
587 otherMenu |
576 classCategoryRemove |
588 ). |
577 nil |
589 shorties := #( |
578 otherMenu |
590 nil |
579 ). |
591 nil |
|
592 nil |
|
593 nil |
|
594 nil |
|
595 nil |
|
596 nil |
|
597 nil |
|
598 nil |
|
599 nil |
|
600 Find |
|
601 nil |
|
602 nil |
|
603 nil |
|
604 nil |
|
605 nil |
|
606 nil |
|
607 #'Ctrl' |
|
608 ). |
580 ]. |
609 ]. |
581 |
610 |
582 m := PopUpMenu |
611 m := PopUpMenu |
583 labels:(resources array:labels) |
612 labels:(resources array:labels) |
584 selectors:selectors. |
613 selectors:selectors |
|
614 accelerators:shorties. |
|
615 |
585 m subMenuAt:#otherMenu put:specialMenu. |
616 m subMenuAt:#otherMenu put:specialMenu. |
586 ^ m |
617 ^ m |
587 |
618 |
588 "Created: 14.9.1995 / 10:50:17 / claus" |
619 "Created: 14.9.1995 / 10:50:17 / claus" |
589 "Modified: 25.1.1996 / 17:29:30 / cg" |
620 "Modified: 2.3.1996 / 16:20:33 / cg" |
590 ! |
621 ! |
591 |
622 |
592 classCategoryNewCategory |
623 classCategoryNewCategory |
593 |box| |
624 |box| |
594 |
625 |
3078 |
3111 |
3079 pos := aString indexOf:(Character space). |
3112 pos := aString indexOf:(Character space). |
3080 ^ aString copyFrom:(pos + 1) |
3113 ^ aString copyFrom:(pos + 1) |
3081 ! ! |
3114 ! ! |
3082 |
3115 |
|
3116 !BrowserView methodsFor:'event handling'! |
|
3117 |
|
3118 handlesKeyPress:key inView:view |
|
3119 "this method is reached via delegation: are we prepared to handle |
|
3120 a keyPress in some other view ?" |
|
3121 |
|
3122 <resource: #keyboard (#Find #Cmdh)> |
|
3123 |
|
3124 |untranslatedKey| |
|
3125 |
|
3126 view == classCategoryListView ifTrue:[ |
|
3127 (key == #Find) ifTrue:[^ true]. |
|
3128 ]. |
|
3129 |
|
3130 view == methodListView ifTrue:[ |
|
3131 untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:nil. |
|
3132 (untranslatedKey == #Cmdi) ifTrue:[^ true]. |
|
3133 (untranslatedKey == #Cmds) ifTrue:[^ true]. |
|
3134 ]. |
|
3135 ^ false |
|
3136 |
|
3137 "Created: 2.3.1996 / 14:33:30 / cg" |
|
3138 "Modified: 2.3.1996 / 16:13:14 / cg" |
|
3139 ! |
|
3140 |
|
3141 keyPress:key x:x y:y view:view |
|
3142 "this method is reached via delegation from the classCategoryListView" |
|
3143 |
|
3144 <resource: #keyboard (#Find)> |
|
3145 |
|
3146 |untranslatedKey| |
|
3147 |
|
3148 view == classCategoryListView ifTrue:[ |
|
3149 (key == #Find) ifTrue:[^ self classCategoryFindClass]. |
|
3150 ]. |
|
3151 view == methodListView ifTrue:[ |
|
3152 untranslatedKey := device keyboardMap keyAtValue:key ifAbsent:nil. |
|
3153 (untranslatedKey == #Cmdi) ifTrue:[^ self methodImplementors]. |
|
3154 (untranslatedKey == #Cmds) ifTrue:[^ self methodSenders]. |
|
3155 ]. |
|
3156 view keyPress:key x:x y:y |
|
3157 |
|
3158 "Created: 2.3.1996 / 14:37:52 / cg" |
|
3159 "Modified: 2.3.1996 / 16:13:28 / cg" |
|
3160 ! ! |
|
3161 |
3083 !BrowserView methodsFor:'help'! |
3162 !BrowserView methodsFor:'help'! |
3084 |
3163 |
3085 helpTextFor:aComponent |
3164 helpTextFor:aComponent |
3086 |s| |
3165 |s| |
3087 |
3166 |
3403 "create subviews for a full browser" |
3500 "create subviews for a full browser" |
3404 |
3501 |
3405 |vpanel hpanel frame v| |
3502 |vpanel hpanel frame v| |
3406 |
3503 |
3407 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) |
3504 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) |
3408 in:self. |
3505 in:self. |
3409 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3506 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3410 |
3507 |
3411 v := HVScrollableView for:SelectionInListView |
3508 v := HVScrollableView for:SelectionInListView |
3412 miniScrollerH:true miniScrollerV:false |
3509 miniScrollerH:true miniScrollerV:false |
3413 in:hpanel. |
3510 in:hpanel. |
3414 v origin:(0.0 @ 0.0) corner:(0.25 @ 1.0). |
3511 v origin:(0.0 @ 0.0) corner:(0.25 @ 1.0). |
3415 classCategoryListView := v scrolledView. |
3512 classCategoryListView := v scrolledView. |
|
3513 classCategoryListView delegate:self. |
3416 |
3514 |
3417 frame := View origin:(0.25 @ 0.0) corner:(0.5 @ 1.0) in:hpanel. |
3515 frame := View origin:(0.25 @ 0.0) corner:(0.5 @ 1.0) in:hpanel. |
3418 self createClassListViewIn:frame. |
3516 self createClassListViewIn:frame. |
3419 |
3517 |
3420 v := HVScrollableView for:SelectionInListView miniScrollerH:true miniScrollerV:false in:hpanel. |
3518 v := HVScrollableView for:SelectionInListView miniScrollerH:true miniScrollerV:false in:hpanel. |
3421 v origin:(0.5 @ 0.0) corner:(0.75 @ 1.0). |
3519 v origin:(0.5 @ 0.0) corner:(0.75 @ 1.0). |
3422 methodCategoryListView := v scrolledView. |
3520 methodCategoryListView := v scrolledView. |
3423 |
3521 |
3424 v := HVScrollableView for:SelectionInListView miniScrollerH:true miniScrollerV:false in:hpanel. |
3522 self createMethodListViewIn:hpanel atX:0.75. |
3425 v origin:(0.75 @ 0.0) corner:(1.0 @ 1.0). |
|
3426 methodListView := v scrolledView. |
|
3427 |
3523 |
3428 self createCodeViewIn:vpanel |
3524 self createCodeViewIn:vpanel |
|
3525 |
|
3526 "Modified: 2.3.1996 / 16:07:24 / cg" |
3429 ! |
3527 ! |
3430 |
3528 |
3431 setupForClass:aClass |
3529 setupForClass:aClass |
3432 "create subviews for browsing a single class" |
3530 "create subviews for browsing a single class" |
3433 |
3531 |
3434 |vpanel hpanel frame v| |
3532 |vpanel hpanel frame v| |
3435 |
3533 |
3436 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3534 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3437 corner:(1.0 @ 1.0) |
3535 corner:(1.0 @ 1.0) |
3438 in:self. |
3536 in:self. |
3439 |
3537 |
3440 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3538 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3441 frame := View origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)in:hpanel. |
3539 frame := View origin:(0.0 @ 0.0) corner:(0.5 @ 1.0)in:hpanel. |
3442 |
3540 |
3443 self createTogglesIn:frame. |
3541 self createTogglesIn:frame. |
3444 |
3542 |
3445 v := ScrollableView for:SelectionInListView in:frame. |
3543 v := ScrollableView for:SelectionInListView in:frame. |
3446 v origin:(0.0 @ 0.0) |
3544 v origin:(0.0 @ 0.0) |
3447 extent:[frame width |
3545 extent:[frame width |
3448 @ |
3546 @ |
3449 (frame height |
3547 (frame height |
3450 - ViewSpacing |
3548 - ViewSpacing |
3451 - instanceToggle height |
3549 - instanceToggle height |
3452 - instanceToggle borderWidth |
3550 - instanceToggle borderWidth |
3453 + v borderWidth)]. |
3551 + v borderWidth)]. |
3454 methodCategoryListView := v scrolledView. |
3552 methodCategoryListView := v scrolledView. |
3455 |
3553 |
3456 v := ScrollableView for:SelectionInListView in:hpanel. |
3554 self createMethodListViewIn:hpanel atX:0.5. |
3457 v origin:(0.5 @ 0.0) corner:(1.0 @ 1.0). |
|
3458 methodListView := v scrolledView. |
|
3459 |
|
3460 self createCodeViewIn:vpanel. |
3555 self createCodeViewIn:vpanel. |
3461 |
3556 |
3462 self switchToClass:aClass. |
3557 self switchToClass:aClass. |
3463 actualClass := acceptClass := aClass. |
3558 actualClass := acceptClass := aClass. |
3464 self updateMethodCategoryList. |
3559 self updateMethodCategoryList. |
3465 self updateMethodList. |
3560 self updateMethodList. |
3466 self updateCodeView. |
3561 self updateCodeView. |
3467 self classDefinition. |
3562 self classDefinition. |
|
3563 |
|
3564 "Modified: 2.3.1996 / 16:07:35 / cg" |
3468 ! |
3565 ! |
3469 |
3566 |
3470 setupForClass:aClass methodCategory:aMethodCategory |
3567 setupForClass:aClass methodCategory:aMethodCategory |
3471 "setup subviews to browse a method category" |
3568 "setup subviews to browse a method category" |
3472 |
3569 |
3473 |vpanel v| |
3570 |vpanel v| |
3474 |
3571 |
3475 vpanel := VariableVerticalPanel |
3572 vpanel := VariableVerticalPanel |
3476 origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) |
3573 origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) |
3477 in:self. |
3574 in:self. |
3478 |
3575 |
3479 v := ScrollableView for:SelectionInListView in:vpanel. |
3576 v := self createMethodListViewIn:vpanel atX:0.0. |
3480 v origin:(0.0 @ 0.0) corner:(1.0 @ 0.25). |
3577 v corner:(1.0 @ 0.25). |
3481 methodListView := v scrolledView. |
|
3482 |
3578 |
3483 self createCodeViewIn:vpanel. |
3579 self createCodeViewIn:vpanel. |
3484 |
3580 |
3485 currentClassCategory := aClass category. |
3581 currentClassCategory := aClass category. |
3486 self switchToClass:aClass. |
3582 self switchToClass:aClass. |
3487 actualClass := acceptClass := aClass. |
3583 actualClass := acceptClass := aClass. |
3488 currentMethodCategory := aMethodCategory. |
3584 currentMethodCategory := aMethodCategory. |
3489 self updateMethodList. |
3585 self updateMethodList. |
3490 self updateCodeView. |
3586 self updateCodeView. |
|
3587 |
|
3588 "Modified: 2.3.1996 / 16:10:44 / cg" |
3491 ! |
3589 ! |
3492 |
3590 |
3493 setupForClass:aClass selector:selector |
3591 setupForClass:aClass selector:selector |
3494 "setup subviews to browse a single method" |
3592 "setup subviews to browse a single method" |
3495 |
3593 |
3514 "setup subviews to browse a class category" |
3612 "setup subviews to browse a class category" |
3515 |
3613 |
3516 |vpanel hpanel frame v| |
3614 |vpanel hpanel frame v| |
3517 |
3615 |
3518 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3616 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3519 corner:(1.0 @ 1.0) |
3617 corner:(1.0 @ 1.0) |
3520 in:self. |
3618 in:self. |
3521 |
3619 |
3522 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3620 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3523 frame := View origin:(0.0 @ 0.0) corner:(0.33 @ 1.0) in:hpanel. |
3621 frame := View origin:(0.0 @ 0.0) corner:(0.33 @ 1.0) in:hpanel. |
3524 |
3622 |
3525 self createClassListViewIn:frame. |
3623 self createClassListViewIn:frame. |
3526 |
3624 |
3527 v := ScrollableView for:SelectionInListView in:hpanel. |
3625 v := ScrollableView for:SelectionInListView in:hpanel. |
3528 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3626 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3529 methodCategoryListView := v scrolledView. |
3627 methodCategoryListView := v scrolledView. |
3530 |
3628 |
3531 v := ScrollableView for:SelectionInListView in:hpanel. |
3629 self createMethodListViewIn:hpanel atX:0.66. |
3532 v origin:(0.66 @ 0.0) corner:(1.0 @ 1.0). |
|
3533 methodListView := v scrolledView. |
|
3534 |
|
3535 self createCodeViewIn:vpanel. |
3630 self createCodeViewIn:vpanel. |
3536 |
3631 |
3537 currentClassCategory := aClassCategory. |
3632 currentClassCategory := aClassCategory. |
3538 self updateClassList. |
3633 self updateClassList. |
3539 self updateMethodCategoryList. |
3634 self updateMethodCategoryList. |
3540 self updateMethodList. |
3635 self updateMethodList. |
3541 self updateCodeView |
3636 self updateCodeView |
|
3637 |
|
3638 "Modified: 2.3.1996 / 16:07:52 / cg" |
3542 ! |
3639 ! |
3543 |
3640 |
3544 setupForClassHierarchy:aClass |
3641 setupForClassHierarchy:aClass |
3545 "setup subviews to browse a class hierarchy" |
3642 "setup subviews to browse a class hierarchy" |
3546 |
3643 |
3547 |vpanel hpanel frame v cls| |
3644 |vpanel hpanel frame v cls| |
3548 |
3645 |
3549 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3646 vpanel := VariableVerticalPanel origin:(0.0 @ 0.0) |
3550 corner:(1.0 @ 1.0) |
3647 corner:(1.0 @ 1.0) |
3551 in:self. |
3648 in:self. |
3552 |
3649 |
3553 " |
3650 " |
3554 notice: we use a different ratio here |
3651 notice: we use a different ratio here |
3555 " |
3652 " |
3556 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.4) in:vpanel. |
3653 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.4) in:vpanel. |
3560 |
3657 |
3561 v := ScrollableView for:SelectionInListView in:hpanel. |
3658 v := ScrollableView for:SelectionInListView in:hpanel. |
3562 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3659 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3563 methodCategoryListView := v scrolledView. |
3660 methodCategoryListView := v scrolledView. |
3564 |
3661 |
3565 v := ScrollableView for:SelectionInListView in:hpanel. |
3662 self createMethodListViewIn:hpanel atX:0.66. |
3566 v origin:(0.66 @ 0.0) corner:(1.0 @ 1.0). |
3663 self createCodeViewIn:vpanel atY:0.4. |
3567 methodListView := v scrolledView. |
|
3568 |
|
3569 self createCodeViewIn:vpanel at:0.4. |
|
3570 |
3664 |
3571 cls := aClass. |
3665 cls := aClass. |
3572 cls isMeta ifTrue:[ |
3666 cls isMeta ifTrue:[ |
3573 cls := cls soleInstance |
3667 cls := cls soleInstance |
3574 ]. |
3668 ]. |
3575 currentClassHierarchy := currentClass := actualClass := cls. |
3669 currentClassHierarchy := currentClass := actualClass := cls. |
3576 self updateClassList. |
3670 self updateClassList. |
3577 classListView selectElement:aClass name; makeSelectionVisible. |
3671 classListView selectElement:aClass name; makeSelectionVisible. |
3578 self updateMethodCategoryList. |
3672 self updateMethodCategoryList. |
3579 self updateMethodList. |
3673 self updateMethodList. |
3580 self updateCodeView. |
3674 self updateCodeView. |
3581 |
3675 |
3582 aClass isMeta ifTrue:[ |
3676 aClass isMeta ifTrue:[ |
3583 self instanceProtocol:false |
3677 self instanceProtocol:false |
3584 ]. |
3678 ]. |
|
3679 |
|
3680 "Modified: 2.3.1996 / 16:08:50 / cg" |
3585 ! |
3681 ! |
3586 |
3682 |
3587 setupForClassList:aList |
3683 setupForClassList:aList |
3588 "setup subviews to browse classes from a list" |
3684 "setup subviews to browse classes from a list" |
3589 |
3685 |
3590 |vpanel hpanel frame l v| |
3686 |vpanel hpanel frame l v| |
3591 |
3687 |
3592 vpanel := VariableVerticalPanel |
3688 vpanel := VariableVerticalPanel |
3593 origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:self. |
3689 origin:(0.0 @ 0.0) corner:(1.0 @ 1.0) in:self. |
3594 |
3690 |
3595 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3691 hpanel := View origin:(0.0 @ 0.0) corner:(1.0 @ 0.25) in:vpanel. |
3596 frame := View origin:(0.0 @ 0.0) corner:(0.33 @ 1.0) in:hpanel. |
3692 frame := View origin:(0.0 @ 0.0) corner:(0.33 @ 1.0) in:hpanel. |
3597 |
3693 |
3598 self createClassListViewIn:frame. |
3694 self createClassListViewIn:frame. |
3599 |
3695 |
3600 v := ScrollableView for:SelectionInListView in:hpanel. |
3696 v := ScrollableView for:SelectionInListView in:hpanel. |
3601 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3697 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3602 methodCategoryListView := v scrolledView. |
3698 methodCategoryListView := v scrolledView. |
3603 |
3699 |
3604 v := ScrollableView for:SelectionInListView in:hpanel. |
3700 self createMethodListViewIn:hpanel atX:0.66. |
3605 v origin:(0.66 @ 0.0) corner:(1.0 @ 1.0). |
|
3606 methodListView := v scrolledView. |
|
3607 |
|
3608 self createCodeViewIn:vpanel. |
3701 self createCodeViewIn:vpanel. |
3609 |
3702 |
3610 l := (aList collect:[:entry | entry name]) asOrderedCollection. |
3703 l := (aList collect:[:entry | entry name]) asOrderedCollection. |
3611 classListView list:(l sort). |
3704 classListView list:(l sort). |
3612 |
3705 |
3613 self updateMethodCategoryList. |
3706 self updateMethodCategoryList. |
3614 self updateMethodList. |
3707 self updateMethodList. |
3615 self updateCodeView |
3708 self updateCodeView |
|
3709 |
|
3710 "Modified: 2.3.1996 / 16:08:06 / cg" |
3616 ! |
3711 ! |
3617 |
3712 |
3618 setupForFullClass |
3713 setupForFullClass |
3619 "setup subviews to browse a class as full text" |
3714 "setup subviews to browse a class as full text" |
3620 |
3715 |
3663 |
3758 |
3664 v := ScrollableView for:SelectionInListView in:hpanel. |
3759 v := ScrollableView for:SelectionInListView in:hpanel. |
3665 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3760 v origin:(0.33 @ 0.0) corner:(0.66 @ 1.0). |
3666 methodCategoryListView := v scrolledView. |
3761 methodCategoryListView := v scrolledView. |
3667 |
3762 |
3668 v := ScrollableView for:SelectionInListView in:hpanel. |
3763 self createMethodListViewIn:hpanel atX:0.66. |
3669 v origin:(0.66 @ 0.0) corner:(1.0 @ 1.0). |
3764 self createCodeViewIn:vpanel atY:0.4. |
3670 methodListView := v scrolledView. |
|
3671 |
|
3672 self createCodeViewIn:vpanel at:0.4. |
|
3673 |
3765 |
3674 cls := aClass. |
3766 cls := aClass. |
3675 cls isMeta ifTrue:[ |
3767 cls isMeta ifTrue:[ |
3676 cls := cls soleInstance |
3768 cls := cls soleInstance |
3677 ]. |
3769 ]. |
3678 currentClassHierarchy := actualClass := acceptClass := currentClass := cls. |
3770 currentClassHierarchy := actualClass := acceptClass := currentClass := cls. |
3679 fullProtocol := true. |
3771 fullProtocol := true. |
3680 |
3772 |
3681 self updateClassList. |
3773 self updateClassList. |
3682 self updateMethodCategoryList. |
3774 self updateMethodCategoryList. |
3683 self updateMethodList. |
3775 self updateMethodList. |
3684 self updateCodeView. |
3776 self updateCodeView. |
3685 self updateVariableList. |
3777 self updateVariableList. |
3686 aClass isMeta ifTrue:[ |
3778 aClass isMeta ifTrue:[ |
3687 self instanceProtocol:false |
3779 self instanceProtocol:false |
3688 ]. |
3780 ]. |
|
3781 |
|
3782 "Modified: 2.3.1996 / 16:08:55 / cg" |
3689 ! |
3783 ! |
3690 |
3784 |
3691 setupForList:aList |
3785 setupForList:aList |
3692 "setup subviews to browse methods from a list" |
3786 "setup subviews to browse methods from a list" |
3693 |
3787 |
4590 ! |
4684 ! |
4591 |
4685 |
4592 methodMenu |
4686 methodMenu |
4593 "return a popupmenu as appropriate for the methodList" |
4687 "return a popupmenu as appropriate for the methodList" |
4594 |
4688 |
4595 |specialMenu m labels selectors |
4689 |specialMenu m labels selectors shorties |
4596 newLabels newSelectors |
4690 newLabels newSelectors |
4597 mthdLabels mthdSelectors |
4691 mthdLabels mthdSelectors |
4598 brkLabels brkSelectors |
4692 brkLabels brkSelectors |
4599 fileLabels fileSelectors |
4693 fileLabels fileSelectors |
4600 searchLabels searchSelectors |
4694 searchLabels searchSelectors searchShorties |
4601 sepLocalLabels sepLocalSelectors |
4695 sepLocalLabels sepLocalSelectors |
4602 localSearchLabels localSearchSelectors| |
4696 localSearchLabels localSearchSelectors| |
4603 |
4697 |
4604 currentMethod notNil ifTrue:[ |
4698 currentMethod notNil ifTrue:[ |
4605 currentMethod isWrapped ifTrue:[ |
4699 currentMethod isWrapped ifTrue:[ |
4606 (MessageTracer isCountingMemoryUsage:currentMethod) ifTrue:[ |
4700 (MessageTracer isCountingMemoryUsage:currentMethod) ifTrue:[ |
4607 brkLabels := #( |
4701 brkLabels := #( |
4608 '-' |
4702 '-' |
4609 'stop mem usage' |
4703 'stop mem usage' |
4610 ). |
4704 ). |
4611 |
4705 |
4612 brkSelectors := #( |
4706 brkSelectors := #( |
4613 nil |
4707 nil |
4614 methodStopMemoryUsage |
4708 methodStopMemoryUsage |
4615 ) |
4709 ) |
4616 ] ifFalse:[ |
4710 ] ifFalse:[ |
4617 (MessageTracer isCounting:currentMethod) ifTrue:[ |
4711 (MessageTracer isCounting:currentMethod) ifTrue:[ |
4618 brkLabels := #( |
4712 brkLabels := #( |
4619 '-' |
4713 '-' |
4620 'stop counting' |
4714 'stop counting' |
4621 ). |
4715 ). |
4622 |
4716 |
4623 brkSelectors := #( |
4717 brkSelectors := #( |
4624 nil |
4718 nil |
4625 methodStopCounting |
4719 methodStopCounting |
4626 ) |
4720 ) |
4627 ] ifFalse:[ |
4721 ] ifFalse:[ |
4628 brkLabels := #( |
4722 brkLabels := #( |
4629 '-' |
4723 '-' |
4630 'remove break/trace' |
4724 'remove break/trace' |
4631 ). |
4725 ). |
4632 |
4726 |
4633 brkSelectors := #( |
4727 brkSelectors := #( |
4634 nil |
4728 nil |
4635 methodRemoveBreakOrTrace |
4729 methodRemoveBreakOrTrace |
4636 ) |
4730 ) |
4637 ] |
4731 ] |
4638 ] |
4732 ] |
4639 ] ifFalse:[ |
4733 ] ifFalse:[ |
4640 brkLabels := #( |
4734 brkLabels := #( |
4641 '-' |
4735 '-' |
4642 'breakpoint' |
4736 'breakpoint' |
4643 'trace' |
4737 '-' |
4644 'trace sender' |
4738 'trace' |
4645 'trace full walkback' |
4739 'trace sender' |
4646 'start counting' |
4740 'trace full walkback' |
4647 'start mem usage' |
4741 '-' |
4648 ). |
4742 'start counting' |
4649 |
4743 'start mem usage' |
4650 brkSelectors := #( |
4744 ). |
4651 nil |
4745 |
4652 methodBreakPoint |
4746 brkSelectors := #( |
4653 methodTrace |
4747 nil |
4654 methodTraceSender |
4748 methodBreakPoint |
4655 methodTraceFull |
4749 nil |
4656 methodStartCounting |
4750 methodTrace |
4657 methodStartMemoryUsage |
4751 methodTraceSender |
4658 ) |
4752 methodTraceFull |
4659 ]. |
4753 nil |
4660 |
4754 methodStartCounting |
4661 Method methodPrivacySupported ifTrue:[ |
4755 methodStartMemoryUsage |
4662 labels := #( |
4756 ) |
4663 'inspect method' |
4757 ]. |
4664 'compile to machine code' |
4758 |
4665 'decompile' |
4759 Method methodPrivacySupported ifTrue:[ |
4666 '-' |
4760 labels := #( |
4667 'make private' |
4761 'inspect method' |
4668 'make protected' |
4762 'compile to machine code' |
4669 'make public' |
4763 'decompile' |
4670 'make ignored' |
4764 '-' |
4671 ). |
4765 'make public' |
4672 selectors := #( |
4766 'make private' |
4673 methodInspect |
4767 'make protected' |
4674 methodSTCCompile |
4768 'make ignored' |
4675 methodDecompile |
4769 ). |
4676 nil |
4770 selectors := #( |
4677 methodMakePrivate |
4771 methodInspect |
4678 methodMakeProtected |
4772 methodSTCCompile |
4679 methodMakePublic |
4773 methodDecompile |
4680 methodMakeIgnored |
4774 nil |
4681 ) |
4775 methodMakePublic |
4682 ] ifFalse:[ |
4776 methodMakePrivate |
4683 labels := #( |
4777 methodMakeProtected |
4684 'inspect method' |
4778 methodMakeIgnored |
4685 'compile to machine code' |
4779 ) |
4686 'decompile' |
4780 ] ifFalse:[ |
4687 ). |
4781 labels := #( |
4688 selectors := #( |
4782 'inspect method' |
4689 methodInspect |
4783 'compile to machine code' |
4690 methodSTCCompile |
4784 'decompile' |
4691 methodDecompile |
4785 ). |
4692 ) |
4786 selectors := #( |
4693 ]. |
4787 methodInspect |
4694 |
4788 methodSTCCompile |
4695 labels := labels , brkLabels. |
4789 methodDecompile |
4696 selectors := selectors , brkSelectors. |
4790 ) |
4697 |
4791 ]. |
4698 specialMenu := PopUpMenu |
4792 |
4699 labels:(resources array:labels) |
4793 labels := labels , brkLabels. |
4700 selectors:selectors. |
4794 selectors := selectors , brkSelectors. |
|
4795 |
|
4796 specialMenu := PopUpMenu |
|
4797 labels:(resources array:labels) |
|
4798 selectors:selectors. |
4701 ]. |
4799 ]. |
4702 |
4800 |
4703 device ctrlDown ifTrue:[ |
4801 device ctrlDown ifTrue:[ |
4704 currentMethod isNil ifTrue:[ |
4802 currentMethod isNil ifTrue:[ |
4705 methodListView flash. |
4803 methodListView flash. |
4706 ^ nil |
4804 ^ nil |
4707 ]. |
4805 ]. |
4708 |
4806 |
4709 ^ specialMenu |
4807 ^ specialMenu |
4710 ]. |
4808 ]. |
4711 |
4809 |
4712 |
4810 |
4713 sepLocalLabels := sepLocalSelectors := #(). |
4811 sepLocalLabels := sepLocalSelectors := #(). |
4714 |
4812 |
4715 searchLabels := #( |
4813 searchLabels := #( |
4716 'senders ...' |
4814 'senders ...' |
4717 'implementors ...' |
4815 'implementors ...' |
4718 'globals ...' |
4816 'globals ...' |
4719 'string search ...' |
4817 'string search ...' |
4720 'apropos ...' |
4818 'apropos ...' |
4721 ). |
4819 ). |
4722 searchSelectors := #( |
4820 searchSelectors := #( |
4723 methodSenders |
4821 methodSenders |
4724 methodImplementors |
4822 methodImplementors |
4725 methodGlobalReferends |
4823 methodGlobalReferends |
4726 methodStringSearch |
4824 methodStringSearch |
4727 methodAproposSearch |
4825 methodAproposSearch |
4728 ). |
4826 ). |
|
4827 |
|
4828 searchShorties := #( |
|
4829 Cmds |
|
4830 Cmdi |
|
4831 nil |
|
4832 nil |
|
4833 nil |
|
4834 ). |
4729 |
4835 |
4730 currentClass notNil ifTrue:[ |
4836 currentClass notNil ifTrue:[ |
4731 localSearchLabels := #( |
4837 localSearchLabels := #( |
4732 '-' |
4838 '-' |
4733 'local senders ...' |
4839 'local senders ...' |
4734 'local implementors ...' |
4840 'local implementors ...' |
4735 'local super sends ...' |
4841 'local super sends ...' |
4736 'local string search ...' |
4842 'local string search ...' |
4737 'local apropos ...' |
4843 'local apropos ...' |
4738 ). |
4844 ). |
4739 localSearchSelectors := #( |
4845 localSearchSelectors := #( |
4740 nil |
4846 nil |
4741 methodLocalSenders |
4847 methodLocalSenders |
4742 methodLocalImplementors |
4848 methodLocalImplementors |
4743 methodLocalSuperSends |
4849 methodLocalSuperSends |
4744 methodLocalStringSearch |
4850 methodLocalStringSearch |
4745 methodLocalAproposSearch |
4851 methodLocalAproposSearch |
4746 ). |
4852 ). |
4747 ] ifFalse:[ |
4853 ] ifFalse:[ |
4748 localSearchLabels := localSearchSelectors := #() |
4854 localSearchLabels := localSearchSelectors := #() |
4749 ]. |
4855 ]. |
4750 |
4856 |
4751 currentMethodCategory notNil ifTrue:[ |
4857 currentMethodCategory notNil ifTrue:[ |
4752 sepLocalLabels := #('-'). sepLocalSelectors := #(nil). |
4858 sepLocalLabels := #('-'). sepLocalSelectors := #(nil). |
4753 |
4859 |
4754 newLabels := #( |
4860 newLabels := #( |
4755 'new method' |
4861 'new method' |
4756 ). |
4862 ). |
4757 |
4863 |
4758 newSelectors := #( |
4864 newSelectors := #( |
4759 methodNewMethod |
4865 methodNewMethod |
4760 ). |
4866 ). |
4761 ] ifFalse:[ |
4867 ] ifFalse:[ |
4762 newLabels := newSelectors := #() |
4868 newLabels := newSelectors := #() |
4763 ]. |
4869 ]. |
4764 |
4870 |
4765 currentMethod notNil ifTrue:[ |
4871 currentMethod notNil ifTrue:[ |
4766 fileLabels := #( |
4872 fileLabels := #( |
4767 'fileOut' |
4873 'fileOut' |
4768 'printOut' |
4874 'printOut' |
4769 '-' |
4875 '-' |
4770 'SPAWN_METHOD' |
4876 'SPAWN_METHOD' |
4771 '-' |
4877 '-' |
4772 ). |
4878 ). |
4773 |
4879 |
4774 fileSelectors := #( |
4880 fileSelectors := #( |
4775 methodFileOut |
4881 methodFileOut |
4776 methodPrintOut |
4882 methodPrintOut |
4777 nil |
4883 nil |
4778 methodSpawn |
4884 methodSpawn |
4779 nil |
4885 nil |
4780 ). |
4886 ). |
4781 |
4887 |
4782 sepLocalLabels := #('-'). sepLocalSelectors := #(nil). |
4888 sepLocalLabels := #('-'). sepLocalSelectors := #(nil). |
4783 |
4889 |
4784 mthdLabels := #( |
4890 mthdLabels := #( |
4785 'change category ...' |
4891 'change category ...' |
4786 'move ...' |
4892 'move ...' |
4787 'remove' |
4893 'remove' |
4788 ). |
4894 ). |
4789 |
4895 |
4790 mthdSelectors := #( |
4896 mthdSelectors := #( |
4791 methodChangeCategory |
4897 methodChangeCategory |
4792 methodMove |
4898 methodMove |
4793 methodRemove |
4899 methodRemove |
4794 ). |
4900 ). |
4795 |
4901 |
4796 ] ifFalse:[ |
4902 ] ifFalse:[ |
4797 fileLabels := fileSelectors := #(). |
4903 fileLabels := fileSelectors := #(). |
4798 mthdLabels := mthdSelectors := #(). |
4904 mthdLabels := mthdSelectors := #(). |
4799 ]. |
4905 ]. |
4800 |
4906 |
4801 |
4907 |
4802 |
4908 |
4803 labels := |
4909 labels := |
4804 fileLabels , |
4910 fileLabels , |
4805 searchLabels , |
4911 searchLabels , |
4806 localSearchLabels , |
4912 localSearchLabels , |
4807 sepLocalLabels , |
4913 sepLocalLabels , |
4808 newLabels , |
4914 newLabels , |
4809 mthdLabels. |
4915 mthdLabels. |
4810 |
4916 |
4811 selectors := |
4917 selectors := |
4812 fileSelectors , |
4918 fileSelectors , |
4813 searchSelectors , |
4919 searchSelectors , |
4814 localSearchSelectors , |
4920 localSearchSelectors , |
4815 sepLocalSelectors , |
4921 sepLocalSelectors , |
4816 newSelectors , |
4922 newSelectors , |
4817 mthdSelectors . |
4923 mthdSelectors . |
|
4924 |
|
4925 shorties := (Array new:(fileSelectors size)) |
|
4926 , searchShorties |
|
4927 , (Array new:(localSearchSelectors size |
|
4928 + sepLocalSelectors size |
|
4929 + newSelectors size |
|
4930 + mthdSelectors size)). |
|
4931 |
4818 |
4932 |
4819 specialMenu notNil ifTrue:[ |
4933 specialMenu notNil ifTrue:[ |
4820 labels := labels , #( |
4934 labels := labels , #( |
4821 '-' |
4935 '-' |
4822 'others ...' |
4936 'others ...' |
4823 ). |
4937 ). |
4824 selectors := selectors , #( |
4938 selectors := selectors , #( |
4825 nil |
4939 nil |
4826 #otherMenu |
4940 #otherMenu |
4827 ) |
4941 ). |
|
4942 shorties := shorties , #( nil #'Ctrl') |
4828 ]. |
4943 ]. |
4829 |
4944 |
4830 m := PopUpMenu |
4945 m := PopUpMenu |
4831 labels:(resources array:labels) |
4946 labels:(resources array:labels) |
4832 selectors:selectors. |
4947 selectors:selectors |
|
4948 accelerators:shorties. |
4833 |
4949 |
4834 specialMenu notNil ifTrue:[ |
4950 specialMenu notNil ifTrue:[ |
4835 m subMenuAt:#otherMenu put:specialMenu. |
4951 m subMenuAt:#otherMenu put:specialMenu. |
4836 ]. |
4952 ]. |
4837 |
4953 |
4838 currentMethod notNil ifTrue:[ |
4954 currentMethod notNil ifTrue:[ |
4839 currentMethod isPrivate ifTrue:[ |
4955 currentMethod isPrivate ifTrue:[ |
4840 m disable:#methodMakePrivate |
4956 m disable:#methodMakePrivate |
4841 ]. |
4957 ]. |
4842 currentMethod isProtected ifTrue:[ |
4958 currentMethod isProtected ifTrue:[ |
4843 m disable:#methodMakeProtected |
4959 m disable:#methodMakeProtected |
4844 ]. |
4960 ]. |
4845 currentMethod isPublic ifTrue:[ |
4961 currentMethod isPublic ifTrue:[ |
4846 m disable:#methodMakePublic |
4962 m disable:#methodMakePublic |
4847 ]. |
4963 ]. |
4848 currentMethod isIgnored ifTrue:[ |
4964 currentMethod isIgnored ifTrue:[ |
4849 m disable:#methodMakeIgnored |
4965 m disable:#methodMakeIgnored |
4850 ]. |
4966 ]. |
4851 ]. |
4967 ]. |
4852 currentMethod notNil ifTrue:[ |
4968 currentMethod notNil ifTrue:[ |
4853 (currentMethod code notNil |
4969 (currentMethod code notNil |
4854 or:[Compiler canCreateMachineCode not]) ifTrue:[ |
4970 or:[Compiler canCreateMachineCode not]) ifTrue:[ |
4855 m disable:#methodSTCCompile |
4971 m disable:#methodSTCCompile |
4856 ]. |
4972 ]. |
4857 currentMethod byteCode isNil ifTrue:[ |
4973 currentMethod byteCode isNil ifTrue:[ |
4858 m disable:#methodDecompile |
4974 m disable:#methodDecompile |
4859 ]. |
4975 ]. |
4860 ]. |
4976 ]. |
4861 ^ m |
4977 ^ m |
4862 |
4978 |
4863 "Created: 23.11.1995 / 12:02:29 / cg" |
4979 "Created: 23.11.1995 / 12:02:29 / cg" |
4864 "Modified: 18.12.1995 / 16:20:07 / stefan" |
4980 "Modified: 18.12.1995 / 16:20:07 / stefan" |
4865 "Modified: 23.12.1995 / 17:06:00 / cg" |
4981 "Modified: 2.3.1996 / 16:20:12 / cg" |
4866 ! |
4982 ! |
4867 |
4983 |
4868 methodMove |
4984 methodMove |
4869 "move the current method into another class; typically a superclass" |
4985 "move the current method into another class; typically a superclass" |
4870 |
4986 |