Tools__NewSystemBrowser.st
branchjv
changeset 13609 8b400fde34ef
parent 13607 b9f60b13662a
parent 13555 11cfb7fdaee7
child 13610 c9b5724788bc
equal deleted inserted replaced
13608:f0126e42bbef 13609:8b400fde34ef
    13 
    13 
    14 "{ NameSpace: Tools }"
    14 "{ NameSpace: Tools }"
    15 
    15 
    16 SystemBrowser subclass:#NewSystemBrowser
    16 SystemBrowser subclass:#NewSystemBrowser
    17 	instanceVariableNames:'environment navigationState bufferNameList selectedBuffer buffers
    17 	instanceVariableNames:'environment navigationState bufferNameList selectedBuffer buffers
    18 		bufferUsageOrder browserCanvas immediateUpdate showClassPackages
    18                 bufferUsageOrder browserCanvas immediateUpdate showClassPackages
    19 		lastMethodCategory lastMethodMoveClass browserCanvasType
    19                 lastMethodCategory lastMethodMoveClass browserCanvasType
    20 		syntaxColoringProcessRunning syntaxColoringProcess
    20                 syntaxColoringProcessRunning syntaxColoringProcess
    21 		methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
    21                 methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
    22 		isEmbedded'
    22                 isEmbedded'
    23 	classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
    23 	classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
    24 		LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
    24                 LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
    25 		LastNameSpaceMove LastMethodMoveOrCopyTargetClass
    25                 LastNameSpaceMove LastMethodMoveOrCopyTargetClass
    26 		LastClassFilterBlockString LastMethodFilterBlockString
    26                 LastClassFilterBlockString LastMethodFilterBlockString
    27 		LastBreakPointConditionString LastIndividualChecks
    27                 LastBreakPointConditionString LastIndividualChecks
    28 		LastAcceptPackage LastVariableRenames LastVisitorClassName
    28                 LastAcceptPackage LastVariableRenames LastVisitorClassName
    29 		LastTemporaryVariableName FindHistory
    29                 LastTemporaryVariableName FindHistory
    30 		CheckForInstancesWhenRemovingClasses SynchronousUpdate
    30                 CheckForInstancesWhenRemovingClasses SynchronousUpdate
    31 		DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
    31                 DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
    32 		DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
    32                 DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
    33 		DefaultImmediateSyntaxColoring DefaultImmediateExplaining
    33                 DefaultImmediateSyntaxColoring DefaultImmediateExplaining
    34 		DefaultSyntaxColoring DefaultToolBarVisible
    34                 DefaultSyntaxColoring DefaultToolBarVisible
    35 		DefaultCodeInfoVisible DefaultShortNameInTabs
    35                 DefaultCodeInfoVisible DefaultShortNameInTabs
    36 		DefaultHideUnloadedClasses DefaultMarkApplications
    36                 DefaultHideUnloadedClasses DefaultMarkApplications
    37 		DefaultAutoFormat DefaultShowMethodComplexity
    37                 DefaultAutoFormat DefaultShowMethodComplexity
    38 		DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
    38                 DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
    39 		SharedMethodCategoryCache LastMethodProcessingBlockString
    39                 SharedMethodCategoryCache LastMethodProcessingBlockString
    40 		LastLoadedPackages DefaultShortAllClassesInNameSpaceOrganisation
    40                 LastLoadedPackages DefaultShortAllClassesInNameSpaceOrganisation
    41 		LastBaseVersionTag DefaultShowPseudoProtocols
    41                 LastBaseVersionTag DefaultShowPseudoProtocols
    42 		DefaultShowMultitabMode LastRenamedOld LastRenamedNew
    42                 DefaultShowMultitabMode LastRenamedOld LastRenamedNew
    43 		LastImportedPackage LastLintRules NewNavigationHistory
    43                 LastImportedPackage LastLintRules NewNavigationHistory
    44 		LastLiteralReplacementType LastLiteralReplacementNewName
    44                 LastLiteralReplacementType LastLiteralReplacementNewName
    45 		LastLiteralReplacementOldLiteral LastNewProjectType
    45                 LastLiteralReplacementOldLiteral LastNewProjectType
    46 		LastClassProcessingBlockString RecentlyClosedList
    46                 LastClassProcessingBlockString RecentlyClosedList
    47 		LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
    47                 LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
    48 		CachedMethodsImplemented DefaultShowSyntheticMethods'
    48                 CachedMethodsImplemented'
    49 	poolDictionaries:''
    49 	poolDictionaries:''
    50 	category:'Interface-Browsers-New'
    50 	category:'Interface-Browsers-New'
    51 !
    51 !
    52 
    52 
    53 Object subclass:#ClassCompletionEntry
    53 Object subclass:#ClassCompletionEntry
 12492 
 12492 
 12493     <resource: #menu>
 12493     <resource: #menu>
 12494 
 12494 
 12495     ^
 12495     ^
 12496      #(Menu
 12496      #(Menu
 12497 	(
 12497         (
 12498 	 (MenuItem
 12498          (MenuItem
 12499 	    label: 'Toolbar'
 12499             label: 'Toolbar'
 12500 	    translateLabel: true
 12500             translateLabel: true
 12501 	    hideMenuOnActivated: false
 12501             hideMenuOnActivated: false
 12502 	    indication: toolBarVisibleHolder
 12502             indication: toolBarVisibleHolder
 12503 	  )
 12503           )
 12504 	 (MenuItem
 12504          (MenuItem
 12505 	    label: 'Bookmarks'
 12505             label: 'Bookmarks'
 12506 	    translateLabel: true
 12506             translateLabel: true
 12507 	    hideMenuOnActivated: false
 12507             hideMenuOnActivated: false
 12508 	    indication: bookmarkBarVisibleHolder
 12508             indication: bookmarkBarVisibleHolder
 12509 	  )
 12509           )
 12510 	 (MenuItem
 12510          (MenuItem
 12511 	    label: 'Searchbar'
 12511             label: 'Searchbar'
 12512 	    translateLabel: true
 12512             translateLabel: true
 12513 	    hideMenuOnActivated: false
 12513             hideMenuOnActivated: false
 12514 	    indication: stringSearchToolVisibleHolder
 12514             indication: stringSearchToolVisibleHolder
 12515 	  )
 12515           )
 12516 	 (MenuItem
 12516          (MenuItem
 12517 	    label: 'Info'
 12517             label: 'Info'
 12518 	    translateLabel: true
 12518             translateLabel: true
 12519 	    hideMenuOnActivated: false
 12519             hideMenuOnActivated: false
 12520 	    indication: codeInfoVisible
 12520             indication: codeInfoVisible
 12521 	  )
 12521           )
 12522 	 (MenuItem
 12522          (MenuItem
 12523 	    label: '-'
 12523             label: '-'
 12524 	  )
 12524           )
 12525 	 (MenuItem
 12525          (MenuItem
 12526 	    label: 'Multitab Mode'
 12526             label: 'Multitab Mode'
 12527 	    translateLabel: true
 12527             translateLabel: true
 12528 	    hideMenuOnActivated: false
 12528             hideMenuOnActivated: false
 12529 	    indication: showMultitabMode
 12529             indication: showMultitabMode
 12530 	  )
 12530           )
 12531 	 (MenuItem
 12531          (MenuItem
 12532 	    label: 'Enable Embedded Resource Editors'
 12532             label: 'Enable Embedded Resource Editors'
 12533 	    translateLabel: true
 12533             translateLabel: true
 12534 	    hideMenuOnActivated: false
 12534             hideMenuOnActivated: false
 12535 	    indication: showSpecialResourceEditors
 12535             indication: showSpecialResourceEditors
 12536 	  )
 12536           )
 12537 	 (MenuItem
 12537          (MenuItem
 12538 	    label: 'Coverage Info'
 12538             label: 'Coverage Info'
 12539 	    translateLabel: true
 12539             translateLabel: true
 12540 	    hideMenuOnActivated: false
 12540             hideMenuOnActivated: false
 12541 	    indication: showCoverageInformation
 12541             indication: showCoverageInformation
 12542 	  )
 12542           )
 12543 	 (MenuItem
 12543          (MenuItem
 12544 	    label: 'Browslet'
 12544             label: 'Browslet'
 12545 	    itemValue: showPlugin:
 12545             itemValue: showPlugin:
 12546 	    translateLabel: true
 12546             translateLabel: true
 12547 	    isVisible: false
 12547             isVisible: false
 12548 	    hideMenuOnActivated: false
 12548             hideMenuOnActivated: false
 12549 	    indication: showPlugin
 12549             indication: showPlugin
 12550 	  )
 12550           )
 12551 	 (MenuItem
 12551          (MenuItem
 12552 	    label: '-'
 12552             label: '-'
 12553 	  )
 12553           )
 12554 	 (MenuItem
 12554          (MenuItem
 12555 	    label: 'Class'
 12555             label: 'Class'
 12556 	    translateLabel: true
 12556             translateLabel: true
 12557 	    submenu:
 12557             submenu:
 12558 	   (Menu
 12558            (Menu
 12559 	      (
 12559               (
 12560 	       (MenuItem
 12560                (MenuItem
 12561 		  label: 'Hide Unloaded Classes'
 12561                   label: 'Hide Unloaded Classes'
 12562 		  translateLabel: true
 12562                   translateLabel: true
 12563 		  hideMenuOnActivated: false
 12563                   hideMenuOnActivated: false
 12564 		  indication: hideUnloadedClasses
 12564                   indication: hideUnloadedClasses
 12565 		)
 12565                 )
 12566 	       (MenuItem
 12566                (MenuItem
 12567 		  label: 'Show All Classes in NameSpace View'
 12567                   label: 'Show All Classes in NameSpace View'
 12568 		  translateLabel: true
 12568                   translateLabel: true
 12569 		  hideMenuOnActivated: false
 12569                   hideMenuOnActivated: false
 12570 		  indication: showAllClassesInNameSpaceOrganisation
 12570                   indication: showAllClassesInNameSpaceOrganisation
 12571 		)
 12571                 )
 12572 	       (MenuItem
 12572                (MenuItem
 12573 		  label: '-'
 12573                   label: '-'
 12574 		)
 12574                 )
 12575 	       (MenuItem
 12575                (MenuItem
 12576 		  enabled: showUnloadedClasses
 12576                   enabled: showUnloadedClasses
 12577 		  label: 'Emphasize Unloaded Classes'
 12577                   label: 'Emphasize Unloaded Classes'
 12578 		  translateLabel: true
 12578                   translateLabel: true
 12579 		  hideMenuOnActivated: false
 12579                   hideMenuOnActivated: false
 12580 		  indication: emphasizeUnloadedClasses
 12580                   indication: emphasizeUnloadedClasses
 12581 		)
 12581                 )
 12582 	       (MenuItem
 12582                (MenuItem
 12583 		  label: 'Show Class Type Indicator'
 12583                   label: 'Show Class Type Indicator'
 12584 		  translateLabel: true
 12584                   translateLabel: true
 12585 		  hideMenuOnActivated: false
 12585                   hideMenuOnActivated: false
 12586 		  indication: markApplicationsHolder
 12586                   indication: markApplicationsHolder
 12587 		)
 12587                 )
 12588 	       (MenuItem
 12588                (MenuItem
 12589 		  label: 'Short Class Names in Tabs'
 12589                   label: 'Short Class Names in Tabs'
 12590 		  translateLabel: true
 12590                   translateLabel: true
 12591 		  hideMenuOnActivated: false
 12591                   hideMenuOnActivated: false
 12592 		  indication: shortNamesInTabs
 12592                   indication: shortNamesInTabs
 12593 		)
 12593                 )
 12594 	       (MenuItem
 12594                (MenuItem
 12595 		  label: 'Show Class-Packages'
 12595                   label: 'Show Class-Packages'
 12596 		  translateLabel: true
 12596                   translateLabel: true
 12597 		  hideMenuOnActivated: false
 12597                   hideMenuOnActivated: false
 12598 		  indication: showClassPackages
 12598                   indication: showClassPackages
 12599 		)
 12599                 )
 12600 	       (MenuItem
 12600                (MenuItem
 12601 		  label: '-'
 12601                   label: '-'
 12602 		)
 12602                 )
 12603 	       (MenuItem
 12603                (MenuItem
 12604 		  label: 'Sort and Indent by Inheritance'
 12604                   label: 'Sort and Indent by Inheritance'
 12605 		  translateLabel: true
 12605                   translateLabel: true
 12606 		  hideMenuOnActivated: false
 12606                   hideMenuOnActivated: false
 12607 		  indication: sortByNameAndInheritance
 12607                   indication: sortByNameAndInheritance
 12608 		)
 12608                 )
 12609 	       )
 12609                )
 12610 	      nil
 12610               nil
 12611 	      nil
 12611               nil
 12612 	    )
 12612             )
 12613 	  )
 12613           )
 12614 	 (MenuItem
 12614          (MenuItem
 12615 	    label: 'Protocol'
 12615             label: 'Protocol'
 12616 	    translateLabel: true
 12616             translateLabel: true
 12617 	    submenu:
 12617             submenu:
 12618 	   (Menu
 12618            (Menu
 12619 	      (
 12619               (
 12620 	       (MenuItem
 12620                (MenuItem
 12621 		  label: 'Show Pseudo Protocols'
 12621                   label: 'Show Pseudo Protocols'
 12622 		  translateLabel: true
 12622                   translateLabel: true
 12623 		  hideMenuOnActivated: false
 12623                   hideMenuOnActivated: false
 12624 		  indication: showPseudoProtocols
 12624                   indication: showPseudoProtocols
 12625 		)
 12625                 )
 12626 	       )
 12626                )
 12627 	      nil
 12627               nil
 12628 	      nil
 12628               nil
 12629 	    )
 12629             )
 12630 	  )
 12630           )
 12631 	 (MenuItem
 12631          (MenuItem
 12632 	    label: 'Selector'
 12632             label: 'Selector'
 12633 	    translateLabel: true
 12633             translateLabel: true
 12634 	    submenu:
 12634             submenu:
 12635 	   (Menu
 12635            (Menu
 12636 	      (
 12636               (
 12637 	       (MenuItem
 12637                (MenuItem
 12638 		  label: 'Show Inherited Methods'
 12638                   label: 'Show Inherited Methods'
 12639 		  translateLabel: true
 12639                   translateLabel: true
 12640 		  hideMenuOnActivated: false
 12640                   hideMenuOnActivated: false
 12641 		  choice: methodVisibilityHolder
 12641                   choice: methodVisibilityHolder
 12642 		  choiceValue: all
 12642                   choiceValue: all
 12643 		)
 12643                 )
 12644 	       (MenuItem
 12644                (MenuItem
 12645 		  label: 'Show Inherited Methods except Object''s'
 12645                   label: 'Show Inherited Methods except Object''s'
 12646 		  translateLabel: true
 12646                   translateLabel: true
 12647 		  hideMenuOnActivated: false
 12647                   hideMenuOnActivated: false
 12648 		  choice: methodVisibilityHolder
 12648                   choice: methodVisibilityHolder
 12649 		  choiceValue: allButObject
 12649                   choiceValue: allButObject
 12650 		)
 12650                 )
 12651 	       (MenuItem
 12651                (MenuItem
 12652 		  label: 'Do not Show Inherited Methods'
 12652                   label: 'Do not Show Inherited Methods'
 12653 		  translateLabel: true
 12653                   translateLabel: true
 12654 		  hideMenuOnActivated: false
 12654                   hideMenuOnActivated: false
 12655 		  choice: methodVisibilityHolder
 12655                   choice: methodVisibilityHolder
 12656 		  choiceValue: class
 12656                   choiceValue: class
 12657 		)
 12657                 )
 12658 	       (MenuItem
 12658                (MenuItem
 12659 		  label: '-'
 12659                   label: '-'
 12660 		)
 12660                 )
 12661 	       (MenuItem
 12661                (MenuItem
 12662 		  label: 'Show Synthetic Methods'
 12662                   label: 'Show Synthetic Methods'
 12663 		  translateLabel: true
 12663                   translateLabel: true
 12664 		  hideMenuOnActivated: false
 12664                   hideMenuOnActivated: false
 12665 		  indication: showSyntheticMethods
 12665                   indication: showSyntheticMethods
 12666 		)
 12666                 )
 12667 	       (MenuItem
 12667                (MenuItem
 12668 		  label: '-'
 12668                   label: '-'
 12669 		)
 12669                 )
 12670 	       (MenuItem
 12670                (MenuItem
 12671 		  label: 'Show Method Inheritance Indicator'
 12671                   label: 'Show Method Inheritance Indicator'
 12672 		  translateLabel: true
 12672                   translateLabel: true
 12673 		  hideMenuOnActivated: false
 12673                   hideMenuOnActivated: false
 12674 		  indication: showMethodInheritance
 12674                   indication: showMethodInheritance
 12675 		)
 12675                 )
 12676 	       (MenuItem
 12676                (MenuItem
 12677 		  label: 'Show Method Type Indicator'
 12677                   label: 'Show Method Type Indicator'
 12678 		  translateLabel: true
 12678                   translateLabel: true
 12679 		  hideMenuOnActivated: false
 12679                   hideMenuOnActivated: false
 12680 		  indication: showMethodTypeIcon
 12680                   indication: showMethodTypeIcon
 12681 		)
 12681                 )
 12682 	       (MenuItem
 12682                (MenuItem
 12683 		  enabled: hasOOMPackageLoadedHolder
 12683                   enabled: hasOOMPackageLoadedHolder
 12684 		  label: 'Show Method-Complexity'
 12684                   label: 'Show Method-Complexity'
 12685 		  translateLabel: true
 12685                   translateLabel: true
 12686 		  hideMenuOnActivated: false
 12686                   hideMenuOnActivated: false
 12687 		  indication: showMethodComplexity
 12687                   indication: showMethodComplexity
 12688 		)
 12688                 )
 12689 	       )
 12689                )
 12690 	      nil
 12690               nil
 12691 	      nil
 12691               nil
 12692 	    )
 12692             )
 12693 	  )
 12693           )
 12694 	 (MenuItem
 12694          (MenuItem
 12695 	    label: 'Code'
 12695             label: 'Code'
 12696 	    translateLabel: true
 12696             translateLabel: true
 12697 	    submenu:
 12697             submenu:
 12698 	   (Menu
 12698            (Menu
 12699 	      (
 12699               (
 12700 	       (MenuItem
 12700                (MenuItem
 12701 		  label: 'Syntax Coloring'
 12701                   label: 'Syntax Coloring'
 12702 		  translateLabel: true
 12702                   translateLabel: true
 12703 		  hideMenuOnActivated: false
 12703                   hideMenuOnActivated: false
 12704 		  indication: doSyntaxColoring
 12704                   indication: doSyntaxColoring
 12705 		)
 12705                 )
 12706 	       (MenuItem
 12706                (MenuItem
 12707 		  enabled: doSyntaxColoring
 12707                   enabled: doSyntaxColoring
 12708 		  label: 'Immediate Syntax Coloring'
 12708                   label: 'Immediate Syntax Coloring'
 12709 		  translateLabel: true
 12709                   translateLabel: true
 12710 		  hideMenuOnActivated: false
 12710                   hideMenuOnActivated: false
 12711 		  indication: doImmediateSyntaxColoring
 12711                   indication: doImmediateSyntaxColoring
 12712 		)
 12712                 )
 12713 	       (MenuItem
 12713                (MenuItem
 12714 		  label: 'Immediate Explaining'
 12714                   label: 'Immediate Explaining'
 12715 		  translateLabel: true
 12715                   translateLabel: true
 12716 		  hideMenuOnActivated: false
 12716                   hideMenuOnActivated: false
 12717 		  indication: doImmediateExplaining
 12717                   indication: doImmediateExplaining
 12718 		)
 12718                 )
 12719 	       (MenuItem
 12719                (MenuItem
 12720 		  label: 'Auto-Format Code'
 12720                   label: 'Auto-Format Code'
 12721 		  translateLabel: true
 12721                   translateLabel: true
 12722 		  hideMenuOnActivated: false
 12722                   hideMenuOnActivated: false
 12723 		  indication: doAutoFormat
 12723                   indication: doAutoFormat
 12724 		)
 12724                 )
 12725 	       (MenuItem
 12725                (MenuItem
 12726 		  label: 'Show MethodTemplate for New Methods'
 12726                   label: 'Show MethodTemplate for New Methods'
 12727 		  translateLabel: true
 12727                   translateLabel: true
 12728 		  hideMenuOnActivated: false
 12728                   hideMenuOnActivated: false
 12729 		  indication: showMethodTemplate
 12729                   indication: showMethodTemplate
 12730 		)
 12730                 )
 12731 	       )
 12731                )
 12732 	      nil
 12732               nil
 12733 	      nil
 12733               nil
 12734 	    )
 12734             )
 12735 	  )
 12735           )
 12736 	 (MenuItem
 12736          (MenuItem
 12737 	    label: '-'
 12737             label: '-'
 12738 	  )
 12738           )
 12739 	 (MenuItem
 12739          (MenuItem
 12740 	    label: 'Settings...'
 12740             label: 'Settings...'
 12741 	    itemValue: openSettingsDialog
 12741             itemValue: openSettingsDialog
 12742 	    translateLabel: true
 12742             translateLabel: true
 12743 	  )
 12743           )
 12744 	 )
 12744          )
 12745 	nil
 12745         nil
 12746 	nil
 12746         nil
 12747       )
 12747       )
 12748 !
 12748 !
 12749 
 12749 
 12750 viewMenuForChainBrowser
 12750 viewMenuForChainBrowser
 12751     "This resource specification was automatically generated
 12751     "This resource specification was automatically generated
 17860     resources := resourcesOrNil ? self classResources.
 17860     resources := resourcesOrNil ? self classResources.
 17861     showFullNameHolder := (LastClassSearchBoxShowedFullName ? false) asValue.
 17861     showFullNameHolder := (LastClassSearchBoxShowedFullName ? false) asValue.
 17862 
 17862 
 17863     doWhat := doWhatByDefault.
 17863     doWhat := doWhatByDefault.
 17864     canFind := aBrowserOrNil notNil
 17864     canFind := aBrowserOrNil notNil
 17865 	       and:[aBrowserOrNil navigationState notNil and:[ aBrowserOrNil navigationState isFullBrowser ]].
 17865                and:[aBrowserOrNil navigationState notNil and:[ aBrowserOrNil navigationState isFullBrowser ]].
 17866 
 17866 
 17867     (doWhat isNil or:[aBrowserOrNil isNil]) ifTrue:[
 17867     (doWhat isNil or:[aBrowserOrNil isNil]) ifTrue:[
 17868 	title := ''.
 17868         title := ''.
 17869 	boxLabel := (resources string:'Select a class').
 17869         boxLabel := (resources string:'Select a class').
 17870 	okText := 'OK'.
 17870         okText := 'OK'.
 17871 	okText2 := nil. doWhat2 := nil.
 17871         okText2 := nil. doWhat2 := nil.
 17872 	okText3 := nil. doWhat3 := nil.
 17872         okText3 := nil. doWhat3 := nil.
 17873     ] ifFalse:[
 17873     ] ifFalse:[
 17874 	title := (singleClass ifTrue:[ 'Class to browse' ] ifFalse:[ 'Class(es) to browse' ]).
 17874         title := (singleClass ifTrue:[ 'Class to browse' ] ifFalse:[ 'Class(es) to browse' ]).
 17875 	boxLabel := (resources string:'Browse or Search').
 17875         boxLabel := (resources string:'Browse or Search').
 17876 
 17876 
 17877 	(doWhat isNil and:[canFind not]) ifTrue:[
 17877         (doWhat isNil and:[canFind not]) ifTrue:[
 17878 	    doWhat := #newBuffer.
 17878             doWhat := #newBuffer.
 17879 	].
 17879         ].
 17880 
 17880 
 17881 	doWhat == #newBrowser ifTrue:[
 17881         doWhat == #newBrowser ifTrue:[
 17882 	    okText := 'Open'.
 17882             okText := 'Open'.
 17883 	    okText2 := 'Add Buffer'. doWhat2 := #newBuffer.
 17883             okText2 := 'Add Buffer'. doWhat2 := #newBuffer.
 17884 	    okText3 := 'Find'.       doWhat3 := nil.
 17884             okText3 := 'Find'.       doWhat3 := nil.
 17885 	] ifFalse:[ doWhat == #newBuffer ifTrue:[
 17885         ] ifFalse:[ doWhat == #newBuffer ifTrue:[
 17886 	    okText := 'Add Buffer'.
 17886             okText := 'Add Buffer'.
 17887 	    okText2 := 'Open New'.   doWhat2 := #newBrowser.
 17887             okText2 := 'Open New'.   doWhat2 := #newBrowser.
 17888 	    okText3 := 'Find'.       doWhat3 := nil.
 17888             okText3 := 'Find'.       doWhat3 := nil.
 17889 	] ifFalse:[
 17889         ] ifFalse:[
 17890 	    title := (singleClass ifTrue:[ 'Class to find' ] ifFalse:[ 'Class(es) to find' ]).
 17890             title := (singleClass ifTrue:[ 'Class to find' ] ifFalse:[ 'Class(es) to find' ]).
 17891 	    okText := 'Find'.
 17891             okText := 'Find'.
 17892 	    okText2 := 'Open New'.   doWhat2 := #newBrowser.
 17892             okText2 := 'Open New'.   doWhat2 := #newBrowser.
 17893 	    okText3 := 'Add Buffer'. doWhat3 := #newBuffer.
 17893             okText3 := 'Add Buffer'. doWhat3 := #newBuffer.
 17894 	]].
 17894         ]].
 17895     ].
 17895     ].
 17896 
 17896 
 17897     genShortNameListEntry :=
 17897     genShortNameListEntry :=
 17898 	[:cls |
 17898         [:cls |
 17899 	    |ns|
 17899             |ns|
 17900 
 17900 
 17901 	    cls isNil ifTrue:[
 17901             cls isNil ifTrue:[
 17902 		nil
 17902                 nil
 17903 	    ] ifFalse:[
 17903             ] ifFalse:[
 17904 		ns := cls topNameSpace name.
 17904                 ns := cls topNameSpace name.
 17905 		ns = 'Smalltalk'
 17905                 ns = 'Smalltalk'
 17906 		    ifTrue:[ ns := '' ]
 17906                     ifTrue:[ ns := '' ]
 17907 		    ifFalse:[ns := ' (in ',ns,')'].
 17907                     ifFalse:[ns := ' (in ',ns,')'].
 17908 		cls nameWithoutNameSpacePrefix,ns
 17908                 cls nameWithoutNameSpacePrefix,ns
 17909 	    ].
 17909             ].
 17910 	].
 17910         ].
 17911 
 17911 
 17912     classNamesInChangeSet := ChangeSet current changedClasses
 17912     classNamesInChangeSet := ChangeSet current changedClasses
 17913 				select: (filterOrNil ? [:cls | true])
 17913                                 select: (filterOrNil ? [:cls | true])
 17914 				thenCollect:[:each | each theNonMetaclass name].
 17914                                 thenCollect:[:each | each theNonMetaclass name].
 17915 
 17915 
 17916     initialFullNames := self visitedClassNamesHistory.
 17916     initialFullNames := self visitedClassNamesHistory.
 17917     (filterOrNil notNil) ifTrue:[
 17917     (filterOrNil notNil) ifTrue:[
 17918 	initialFullNames := initialFullNames select:[:nm | filterOrNil value:(Smalltalk at:nm)].
 17918         initialFullNames := initialFullNames select:[:nm | filterOrNil value:(Smalltalk at:nm)].
 17919     ].
 17919     ].
 17920 
 17920 
 17921     initialFullNames := initialFullNames select:[:nm | nm notNil].
 17921     initialFullNames := initialFullNames select:[:nm | nm notNil].
 17922     initialShortNames := initialFullNames collect:[:nm |
 17922     initialShortNames := initialFullNames collect:[:nm | 
 17923 			    |cls|
 17923                             |cls|
 17924 
 17924 
 17925 			    cls := Smalltalk at:nm.
 17925                             cls := Smalltalk at:nm.
 17926 			    cls isNil ifTrue:[
 17926                             cls isNil ifTrue:[
 17927 				"/ class no longer exists (removed?)
 17927                                 "/ class no longer exists (removed?)
 17928 				nm colorizeAllWith:(Color grey)
 17928                                 nm colorizeAllWith:(Color grey)
 17929 			    ] ifFalse:[
 17929                             ] ifFalse:[
 17930 				genShortNameListEntry value:(Smalltalk at:nm)
 17930                                 genShortNameListEntry value:(Smalltalk at:nm)
 17931 			    ].
 17931                             ].
 17932 			].
 17932                         ].
 17933 
 17933 
 17934     colorizedFullNames := initialFullNames collect:[:clsName |
 17934     colorizedFullNames := initialFullNames collect:[:clsName | 
 17935 				(classNamesInChangeSet includes:clsName) ifTrue:[
 17935                                 (classNamesInChangeSet includes:clsName) ifTrue:[
 17936 				    clsName asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 17936                                     clsName asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 17937 				] ifFalse:[
 17937                                 ] ifFalse:[
 17938 				    clsName
 17938                                     clsName
 17939 				].
 17939                                 ].
 17940 			    ].
 17940                             ].
 17941 
 17941 
 17942     colorizedShortNames := initialShortNames with:initialFullNames collect:[:shortName :clsName |
 17942     colorizedShortNames := initialShortNames with:initialFullNames collect:[:shortName :clsName | 
 17943 				(classNamesInChangeSet includes:clsName) ifTrue:[
 17943                                 (classNamesInChangeSet includes:clsName) ifTrue:[
 17944 				    shortName asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 17944                                     shortName asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 17945 				] ifFalse:[
 17945                                 ] ifFalse:[
 17946 				    shortName
 17946                                     shortName
 17947 				].
 17947                                 ].
 17948 			    ].
 17948                             ].
 17949 
 17949 
 17950     title := (resources string:title) , msgTail , '.\' , (resources string:'(TAB to complete; matchPattern allowed - "*" for all):').
 17950     title := (resources string:title) , msgTail , '.\' , (resources string:'(TAB to complete; matchPattern allowed - "*" for all):').
 17951 
 17951 
 17952     box := self
 17952     box := self
 17953 		enterBoxForClassWithCodeSelectionTitle:title withCRs
 17953                 enterBoxForClassWithCodeSelectionTitle:title withCRs
 17954 		withList:(showFullNameHolder value ifTrue:[colorizedFullNames] ifFalse:[colorizedShortNames])
 17954                 withList:(showFullNameHolder value ifTrue:[colorizedFullNames] ifFalse:[colorizedShortNames])
 17955 		okText:okText
 17955                 okText:okText
 17956 		forBrowser:aBrowserOrNil.
 17956                 forBrowser:aBrowserOrNil.
 17957 
 17957 
 17958     box label:boxLabel.
 17958     box label:boxLabel.
 17959 
 17959 
 17960     doWhat notNil ifTrue:[
 17960     doWhat notNil ifTrue:[
 17961 	button2 := Button label:(resources string:okText2).
 17961         button2 := Button label:(resources string:okText2).
 17962 	(aBrowserOrNil notNil and:[aBrowserOrNil navigationState isFullBrowser]) "singleClass" ifTrue:[
 17962         (aBrowserOrNil notNil and:[aBrowserOrNil navigationState isFullBrowser]) "singleClass" ifTrue:[
 17963 	    button3 := Button label:(resources string:okText3)
 17963             button3 := Button label:(resources string:okText3)
 17964 	].
 17964         ].
 17965 	box addButton:button2 after:(box okButton).
 17965         box addButton:button2 after:(box okButton).
 17966 	button3 notNil ifTrue:[box addButton:button3 after:button2].
 17966         button3 notNil ifTrue:[box addButton:button3 after:button2].
 17967 
 17967 
 17968 	button2 action:[
 17968         button2 action:[
 17969 	   doWhat := doWhat2.
 17969            doWhat := doWhat2.
 17970 	   box doAccept.
 17970            box doAccept.
 17971 	   box okPressed.
 17971            box okPressed.
 17972 	].
 17972         ].
 17973 	button3 notNil ifTrue:[
 17973         button3 notNil ifTrue:[
 17974 	    button3 action:[
 17974             button3 action:[
 17975 	       doWhat := doWhat3.
 17975                doWhat := doWhat3.
 17976 	       box doAccept.
 17976                box doAccept.
 17977 	       box okPressed.
 17977                box okPressed.
 17978 	    ].
 17978             ].
 17979 	].
 17979         ].
 17980     ].
 17980     ].
 17981 
 17981 
 17982     allClasses := Smalltalk allClasses copyAsOrderedCollection.
 17982     allClasses := Smalltalk allClasses copyAsOrderedCollection.
 17983     filterOrNil notNil ifTrue:[
 17983     filterOrNil notNil ifTrue:[
 17984 	allClasses := allClasses select: filterOrNil
 17984         allClasses := allClasses select: filterOrNil
 17985     ].
 17985     ].
 17986 
 17986 
 17987     allNames := (allClasses
 17987     allNames := (allClasses
 17988 		    collect:[:cls |
 17988                     collect:[:cls |
 17989 			|ns nm|
 17989                         |ns nm|
 17990 
 17990 
 17991 			ns := cls topNameSpace name.
 17991                         ns := cls topNameSpace name.
 17992 			ns = 'Smalltalk'
 17992                         ns = 'Smalltalk'
 17993 			    ifTrue:[ ns := '' ]
 17993                             ifTrue:[ ns := '' ]
 17994 			    ifFalse:[ns := ' (in ',ns,')'].
 17994                             ifFalse:[ns := ' (in ',ns,')'].
 17995 			cls isNameSpace ifTrue:[
 17995                         cls isNameSpace ifTrue:[
 17996 			    nm := cls nameWithoutNameSpacePrefix,ns,' (Namespace)'
 17996                             nm := cls nameWithoutNameSpacePrefix,ns,' (Namespace)'
 17997 			] ifFalse:[
 17997                         ] ifFalse:[
 17998 			    nm := cls nameWithoutNameSpacePrefix,ns
 17998                             nm := cls nameWithoutNameSpacePrefix,ns
 17999 			].
 17999                         ].
 18000 			(classNamesInChangeSet includes:cls name) ifTrue:[
 18000                         (classNamesInChangeSet includes:cls name) ifTrue:[
 18001 			    nm asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 18001                             nm asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 18002 			] ifFalse:[
 18002                         ] ifFalse:[
 18003 			    nm
 18003                             nm
 18004 			].
 18004                         ].
 18005 		    ]) sortWith:allClasses; yourself.
 18005                     ]) sortWith:allClasses; yourself.
 18006 
 18006 
 18007     allFullNames := (allClasses
 18007     allFullNames := (allClasses 
 18008 		    collect:[:cls |
 18008                     collect:[:cls | 
 18009 			|nm|
 18009                         |nm|
 18010 
 18010 
 18011 			nm := cls name.
 18011                         nm := cls name.
 18012 			(classNamesInChangeSet includes:cls name) ifTrue:[
 18012                         (classNamesInChangeSet includes:cls name) ifTrue:[
 18013 			    nm asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 18013                             nm asText emphasisAllAdd:(UserPreferences current emphasisForChangedCode)
 18014 			] ifFalse:[
 18014                         ] ifFalse:[
 18015 			    nm
 18015                             nm
 18016 			].
 18016                         ].
 18017 		    ]) sortWith:allClasses; yourself.
 18017                     ]) sortWith:allClasses; yourself.
 18018 
 18018 
 18019     updateList := [
 18019     updateList := [
 18020 	    |nameToSearch list namesStarting namesIncluding lcName nameList|
 18020             |nameToSearch list namesStarting namesIncluding lcName nameList|
 18021 
 18021 
 18022 	    (nameToSearch := classNameHolder value withoutSeparators) isEmpty ifTrue:[
 18022             (nameToSearch := classNameHolder value withoutSeparators) isEmpty ifTrue:[
 18023 		showingWhatLabel label:(resources string:'Recently visited:').
 18023                 showingWhatLabel label:(resources string:'Recently visited:').
 18024 		list := (showFullNameHolder value ifTrue:[colorizedFullNames] ifFalse:[colorizedShortNames]).
 18024                 list := (showFullNameHolder value ifTrue:[colorizedFullNames] ifFalse:[colorizedShortNames]).
 18025 	    ] ifFalse:[
 18025             ] ifFalse:[
 18026 		showingWhatLabel label:(resources string:'Matching classes:').
 18026                 showingWhatLabel label:(resources string:'Matching classes:').
 18027 		nameList := showFullNameHolder value
 18027                 nameList := showFullNameHolder value
 18028 				ifTrue:[ allFullNames ]
 18028                                 ifTrue:[ allFullNames ]
 18029 				ifFalse:[ allNames ].
 18029                                 ifFalse:[ allNames ].
 18030 
 18030 
 18031 		lcName := nameToSearch asLowercase.
 18031                 lcName := nameToSearch asLowercase.
 18032 		(lcName includesString:'::') ifTrue:[
 18032                 (lcName includesString:'::') ifTrue:[
 18033 		    list := OrderedCollection new.
 18033                     list := OrderedCollection new.
 18034 		    allClasses doWithIndex:[:cls :idx |
 18034                     allClasses doWithIndex:[:cls :idx |
 18035 			|isIncluded|
 18035                         |isIncluded|
 18036 
 18036 
 18037 			(nameToSearch includesMatchCharacters) ifTrue:[
 18037                         (nameToSearch includesMatchCharacters) ifTrue:[
 18038 			    isIncluded := (lcName match:cls name asLowercase)
 18038                             isIncluded := (lcName match:cls name asLowercase)
 18039 			] ifFalse:[
 18039                         ] ifFalse:[
 18040 			    isIncluded := (cls name includesString:lcName caseSensitive:false)
 18040                             isIncluded := (cls name includesString:lcName caseSensitive:false)
 18041 			].
 18041                         ].
 18042 			isIncluded ifTrue:[
 18042                         isIncluded ifTrue:[
 18043 			    list add:(nameList at:idx)
 18043                             list add:(nameList at:idx)
 18044 			].
 18044                         ].
 18045 		    ].
 18045                     ].
 18046 		] ifFalse:[
 18046                 ] ifFalse:[
 18047 		    (nameToSearch includesMatchCharacters) ifTrue:[
 18047                     (nameToSearch includesMatchCharacters) ifTrue:[
 18048 			list := nameList select:[:nm | lcName match:nm asLowercase]
 18048                         list := nameList select:[:nm | lcName match:nm asLowercase]
 18049 		    ] ifFalse:[
 18049                     ] ifFalse:[
 18050 			namesIncluding := nameList
 18050                         namesIncluding := nameList
 18051 					    select:[:nm |
 18051                                             select:[:nm |
 18052 						"/ nm asLowercase startsWith:lcName
 18052                                                 "/ nm asLowercase startsWith:lcName
 18053 						nm asLowercase includesString:lcName caseSensitive:false
 18053                                                 nm asLowercase includesString:lcName caseSensitive:false
 18054 					    ].
 18054                                             ].
 18055 			namesStarting := namesIncluding select:[:nm | nm asLowercase startsWith:lcName].
 18055                         namesStarting := namesIncluding select:[:nm | nm asLowercase startsWith:lcName].
 18056 			list := namesStarting , {nil} , (namesIncluding \ namesStarting).
 18056                         list := namesStarting , {nil} , (namesIncluding \ namesStarting).
 18057 		    ]
 18057                     ]
 18058 		]
 18058                 ]
 18059 	    ].
 18059             ].
 18060 	    box listView
 18060             box listView
 18061 		list:list;
 18061                 list:list;
 18062 		scrollToLine:((list findFirst:[:line | (line ? '') startsWith:lcName]) max:1)
 18062                 scrollToLine:((list findFirst:[:line | (line ? '') startsWith:lcName]) max:1)
 18063 	].
 18063         ].
 18064 
 18064 
 18065     classNameHolder := '' asValue.
 18065     classNameHolder := '' asValue.
 18066     box enterField
 18066     box enterField
 18067 	model:classNameHolder;
 18067         model:classNameHolder;
 18068 	immediateAccept:true.
 18068         immediateAccept:true.
 18069     classNameHolder onChangeEvaluate:updateList.
 18069     classNameHolder onChangeEvaluate:updateList.
 18070 
 18070 
 18071     box entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 18071     box entryCompletionBlock:(DoWhatIMeanSupport classNameEntryCompletionBlock).
 18072     box action:[:aString | className := aString].
 18072     box action:[:aString | className := aString].
 18073 
 18073 
 18074     box panelView
 18074     box panelView
 18075 	addSubView:(showingWhatLabel := (Label label:(resources string:'Recently visited:')) adjust:#left) before:nil;
 18075         addSubView:(showingWhatLabel := (Label label:(resources string:'Recently visited:')) adjust:#left) before:nil;
 18076 	addSubView:(check := CheckBox label:(resources string:'Show Full Name (do not strip off Namespace)') model:showFullNameHolder) before:nil.
 18076         addSubView:(check := CheckBox label:(resources string:'Show Full Name (do not strip off Namespace)') model:showFullNameHolder) before:nil.
 18077     showFullNameHolder onChangeEvaluate:updateList.
 18077     showFullNameHolder onChangeEvaluate:updateList.
 18078     box enterField origin:(0 @ check corner y).
 18078     box enterField origin:(0 @ check corner y).
 18079     box enterField onKey:#CursorDown leaveWith:[ box listView requestFocus.
 18079     box enterField 
 18080 						 box listView hasSelection ifFalse:[
 18080         onKey:#CursorDown 
 18081 						    box listView selectFirst
 18081         leaveWith:[ 
 18082 						 ]
 18082             box listView windowGroup focusView:box listView byTab:true.
 18083 					       ].
 18083             box listView hasSelection ifFalse:[
       
 18084                 box listView selectFirst
       
 18085             ] ifTrue:[
       
 18086                 box listView selectNext
       
 18087             ].
       
 18088         ].
 18084     box listView origin:(0 @ check corner y).
 18089     box listView origin:(0 @ check corner y).
 18085 
 18090 
 18086     box extent:(400 @ 350).
 18091     box extent:(400 @ 350).
 18087     box open.
 18092     box open.
 18088 
 18093 
 18089     className isEmptyOrNil ifTrue:[^ nil "cancel"].
 18094     className isEmptyOrNil ifTrue:[^ nil "cancel"].
 18090 
 18095 
 18091     LastClassSearchBoxShowedFullName := showFullNameHolder value.
 18096     LastClassSearchBoxShowedFullName := showFullNameHolder value.
 18092 
 18097 
 18093     (className endsWith:$) ) ifTrue:[
 18098     (className endsWith:$) ) ifTrue:[
 18094 	(className indexOfSubCollection:'(in ') == 0 ifTrue:[
 18099         (className indexOfSubCollection:'(in ') == 0 ifTrue:[
 18095 	    "/ a namespace
 18100             "/ a namespace
 18096 	    className := (className copyTo:(className indexOfSubCollection:'(Name')-1) withoutSeparators
 18101             className := (className copyTo:(className indexOfSubCollection:'(Name')-1) withoutSeparators
 18097 	] ifFalse:[
 18102         ] ifFalse:[
 18098 	    className := ((className copyFrom:(className indexOfSubCollection:'(in ')+4)
 18103             className := ((className copyFrom:(className indexOfSubCollection:'(in ')+4)
 18099 			    copyButLast:1)
 18104                             copyButLast:1)
 18100 			 , '::' , className asCollectionOfWords first
 18105                          , '::' , className asCollectionOfWords first
 18101 	].
 18106         ].
 18102     ].
 18107     ].
 18103 
 18108 
 18104     (doWhat isNil or:[aBrowserOrNil isNil]) ifTrue:[
 18109     (doWhat isNil or:[aBrowserOrNil isNil]) ifTrue:[
 18105 	aBlock notNil ifTrue:[aBlock value:className optionalArgument:singleClass and:doWhat].
 18110         aBlock notNil ifTrue:[aBlock value:className optionalArgument:singleClass and:doWhat].
 18106 	^ className
 18111         ^ className
 18107     ].
 18112     ].
 18108 
 18113 
 18109     aBrowserOrNil withSearchCursorDo:[
 18114     aBrowserOrNil withSearchCursorDo:[
 18110 	aBlock value:className value:singleClass value:doWhat.
 18115         aBlock value:className value:singleClass value:doWhat.
 18111     ].
 18116     ].
 18112     ^ className
 18117     ^ className
 18113 
 18118 
 18114     "Modified: / 29-08-2013 / 12:24:28 / cg"
 18119     "Modified: / 29-08-2013 / 12:24:28 / cg"
 18115     "Modified: / 04-09-2013 / 17:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 18120     "Modified: / 04-09-2013 / 17:48:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 19013 variableFilter
 19018 variableFilter
 19014     ^ self navigationState variableFilter
 19019     ^ self navigationState variableFilter
 19015 
 19020 
 19016     "Created: / 24.2.2000 / 23:28:06 / cg"
 19021     "Created: / 24.2.2000 / 23:28:06 / cg"
 19017 ! !
 19022 ! !
 19018 
       
 19019 
       
 19020 
 19023 
 19021 !NewSystemBrowser methodsFor:'aspects-organization'!
 19024 !NewSystemBrowser methodsFor:'aspects-organization'!
 19022 
 19025 
 19023 categoryMenuVisible
 19026 categoryMenuVisible
 19024     |holder|
 19027     |holder|
 22710 
 22713 
 22711 useSearchBarInBrowser
 22714 useSearchBarInBrowser
 22712 
 22715 
 22713     ^ UserPreferences current useSearchBarInBrowser or:[self codeView searchBarActionBlock notNil]
 22716     ^ UserPreferences current useSearchBarInBrowser or:[self codeView searchBarActionBlock notNil]
 22714 ! !
 22717 ! !
 22715 
       
 22716 
 22718 
 22717 !NewSystemBrowser methodsFor:'change & update'!
 22719 !NewSystemBrowser methodsFor:'change & update'!
 22718 
 22720 
 22719 categorySelectionChanged
 22721 categorySelectionChanged
 22720     "category selection changed by user interaction"
 22722     "category selection changed by user interaction"
 34638     |highest highestString nrString nr fileNamePrefix fileNameMiddle
 34640     |highest highestString nrString nr fileNamePrefix fileNameMiddle
 34639      changedClassesAndMetaclasses changedClasses fileName changedOwningClasses generatedPatchFilename tempStream changeSet|
 34641      changedClassesAndMetaclasses changedClasses fileName changedOwningClasses generatedPatchFilename tempStream changeSet|
 34640 
 34642 
 34641     "/ find the highest numbered patchfile
 34643     "/ find the highest numbered patchfile
 34642     'stxPatches' asFilename directoryContentsDo:[:fn |
 34644     'stxPatches' asFilename directoryContentsDo:[:fn |
 34643 	(fn includes:$_) ifTrue:[
 34645         (fn includes:$_) ifTrue:[
 34644 	    nrString := fn upTo:$_.
 34646             nrString := fn upTo:$_.
 34645 	    nr := Integer readFrom:nrString onError:nil.
 34647             nr := Integer readFrom:nrString onError:nil.
 34646 	    nr notNil ifTrue:[
 34648             nr notNil ifTrue:[
 34647 		nr > (highest ? -1) ifTrue:[
 34649                 nr > (highest ? -1) ifTrue:[
 34648 		    highest := nr.
 34650                     highest := nr.
 34649 		    highestString := nrString.
 34651                     highestString := nrString.
 34650 		]
 34652                 ]
 34651 	    ].
 34653             ].
 34652 	].
 34654         ].
 34653     ].
 34655     ].
 34654     highest isNil ifTrue:[
 34656     highest isNil ifTrue:[
 34655 	fileNamePrefix := '01'
 34657         fileNamePrefix := '01'
 34656     ] ifFalse:[
 34658     ] ifFalse:[
 34657 	fileNamePrefix := (highest+1) printStringLeftPaddedTo:(highestString size) with:$0.
 34659         fileNamePrefix := (highest+1) printStringLeftPaddedTo:(highestString size) with:$0.
 34658     ].
 34660     ].
 34659 
 34661 
 34660     changedClassesAndMetaclasses := diffSet changedClasses.
 34662     changedClassesAndMetaclasses := diffSet changedClasses.
 34661     changedClasses := changedClassesAndMetaclasses collect:[:clsOrMeta | clsOrMeta theNonMetaclass].
 34663     changedClasses := changedClassesAndMetaclasses collect:[:clsOrMeta | clsOrMeta theNonMetaclass].
 34662     changedOwningClasses := changedClasses collect:[:each | each isPrivate
 34664     changedOwningClasses := changedClasses collect:[:each | each isPrivate 
 34663 								ifTrue:[ each owningClass ]
 34665                                                                 ifTrue:[ each owningClass ]
 34664 								ifFalse:[ each ]] as:Set.
 34666                                                                 ifFalse:[ each ]] as:Set.
 34665     changedOwningClasses := changedOwningClasses asOrderedCollection.
 34667     changedOwningClasses := changedOwningClasses asOrderedCollection.
 34666 
 34668 
 34667     changedOwningClasses size == 1 ifTrue:[
 34669     changedOwningClasses size == 1 ifTrue:[
 34668 	fileNameMiddle := changedOwningClasses first nameWithoutPrefix
 34670         fileNameMiddle := changedOwningClasses first nameWithoutPrefix
 34669     ] ifFalse:[
 34671     ] ifFalse:[
 34670 	fileNameMiddle := 'patches'
 34672         fileNameMiddle := 'patches'
 34671     ].
 34673     ].
 34672     fileNameMiddle := fileNameMiddle asFilename makeLegalFilename name.
 34674     fileNameMiddle := fileNameMiddle asFilename makeLegalFilename name.
 34673     fileName := (fileNamePrefix,'_',fileNameMiddle,'.st') asFilename.
 34675     fileName := (fileNamePrefix,'_',fileNameMiddle,'.st') asFilename.
 34674 
 34676 
 34675     tempStream := FileStream newTemporaryIn:'stxPatches'.
 34677     tempStream := FileStream newTemporaryIn:'stxPatches'.
 34676     tempStream nextPutLine:('"/ patches to bring %1 to version %2' bindWith:changedClasses first name with:thisRevString).
 34678     tempStream nextPutLine:('"/ patches to bring %1 to version %2' bindWith:changedClasses first name with:thisRevString).
 34677     tempStream nextPutLine:('"/').
 34679     tempStream nextPutLine:('"/').
 34678     tempStream nextPutLine:('"/ first, a guard, to ignore the patch if the library already contains an up-to-date class:').
 34680     tempStream nextPutLine:('"/ first, a guard, to ignore the patch if the library already contains an up-to-date class:').
 34679     tempStream nextPutLine:('"/').
 34681     tempStream nextPutLine:('"/').
 34680     changedOwningClasses do:[:eachClass |
 34682     changedOwningClasses do:[:eachClass |
 34681 	tempStream nextPutLine:('(AbstractSourceCodeManager isRevision:(%2 revision) sameOrAfter:''%1'') ifTrue:[ AbortSignal raise ].'
 34683         tempStream nextPutLine:('(AbstractSourceCodeManager isRevision:(%2 revision) sameOrAfter:''%1'') ifTrue:[ AbortSignal raiseErrorString:''patch is for older version'' ].'
 34682 			    bindWith:eachClass revision
 34684                             bindWith:eachClass revision
 34683 			    with:eachClass name).
 34685                             with:eachClass name).
 34684     ].
 34686     ].
 34685     tempStream nextPutChunkSeparator; cr; cr.
 34687     tempStream nextPutChunkSeparator; cr; cr.
 34686 
 34688 
 34687     changeSet := ChangeSet fromDiffSet:diffSet.
 34689     changeSet := ChangeSet fromDiffSet:diffSet.
 34688     changeSet fileOutOn:tempStream.
 34690     changeSet fileOutOn:tempStream.
 34689     tempStream syncData; close.
 34691     tempStream syncData; close.
 34690 
 34692         
 34691     generatedPatchFilename := ('stxPatches' asFilename construct:fileName).
 34693     generatedPatchFilename := ('stxPatches' asFilename construct:fileName).
 34692 
 34694 
 34693     tempStream fileName renameTo:generatedPatchFilename.
 34695     tempStream fileName renameTo:generatedPatchFilename.
 34694     (Dialog
 34696     (Dialog 
 34695 	confirm:('Created new patchFile as: "%1"' bindWith:generatedPatchFilename name)
 34697         confirm:('Created new patchFile as: "%1"' bindWith:generatedPatchFilename name)
 34696 	yesLabel:'Show' noLabel:'OK')
 34698         yesLabel:'Show' noLabel:'OK')
 34697     ifTrue:[
 34699     ifTrue:[
 34698 	UserPreferences fileBrowserClass openOn:generatedPatchFilename
 34700         UserPreferences fileBrowserClass openOn:generatedPatchFilename
 34699     ].
 34701     ].
 34700 
 34702 
 34701     "Created: / 26-09-2012 / 15:13:07 / cg"
 34703     "Created: / 26-09-2012 / 15:13:07 / cg"
 34702 !
 34704 !
 34703 
 34705 
 38119 !
 38121 !
 38120 
 38122 
 38121 openSTXDocumentation
 38123 openSTXDocumentation
 38122     HTMLDocumentView openFullOnDocumentationFile:'TOP.html'
 38124     HTMLDocumentView openFullOnDocumentationFile:'TOP.html'
 38123 ! !
 38125 ! !
 38124 
       
 38125 
 38126 
 38126 !NewSystemBrowser methodsFor:'menu actions-inheritance'!
 38127 !NewSystemBrowser methodsFor:'menu actions-inheritance'!
 38127 
 38128 
 38128 inheritanceMenuNavigateToClass
 38129 inheritanceMenuNavigateToClass
 38129     self switchToClass:(navigationState inheritanceView scrolledView selectionHolder value)
 38130     self switchToClass:(navigationState inheritanceView scrolledView selectionHolder value)
 44703 
 44704 
 44704     mclass := method mclass.
 44705     mclass := method mclass.
 44705     mselector := method selector.
 44706     mselector := method selector.
 44706     className := mclass name.
 44707     className := mclass name.
 44707     [
 44708     [
 44708 	|set|
 44709         |set|
 44709 
 44710 
 44710 	set := ChangeSet forExistingMethods:(Array with:method).
 44711         set := ChangeSet forExistingMethods:(Array with:method).
 44711 	set := set select:[:c | c isMethodChange].
 44712         set := set select:[:c | c isMethodChange].
 44712 	lastChange := set first.
 44713         lastChange := set first.
 44713     ] value.
 44714     ] value.
 44714 
 44715 
 44715     thisIsAnExtensionMethod := (method isExtension).
 44716     thisIsAnExtensionMethod := (method isExtension).
 44716     thisIsAnExtensionMethod ifTrue:[
 44717     thisIsAnExtensionMethod ifTrue:[
 44717 	packageId := method package asPackageId.
 44718         packageId := method package asPackageId.
 44718 	mgr := manager
 44719         mgr := manager
 44719     ] ifFalse:[
 44720     ] ifFalse:[
 44720 	packageId := mclass package asPackageId.
 44721         packageId := mclass package asPackageId.
 44721 	"/ mgr := packageId projectDefinitionClass sourceCodeManager.
 44722         "/ mgr := packageId projectDefinitionClass sourceCodeManager.
 44722 	mgr := manager.
 44723         mgr := manager.
 44723 	"/self assert:(mgr = packageId projectDefinitionClass sourceCodeManager).
 44724         "/self assert:(mgr = packageId projectDefinitionClass sourceCodeManager).
 44724     ].
 44725     ].
 44725     directory := packageId directory.
 44726     directory := packageId directory.
 44726     module := packageId module.
 44727     module := packageId module.
 44727 
 44728 
 44728     self withWaitCursorDo:[
 44729     self withWaitCursorDo:[
 44729 	|revisionLog start stop answer t tS list msg first|
 44730         |revisionLog start stop answer t tS list msg first|
 44730 
 44731 
 44731 	thisIsAnExtensionMethod ifTrue:[
 44732         thisIsAnExtensionMethod ifTrue:[
 44732 	    revisionLog := mgr
 44733             revisionLog := mgr
 44733 		revisionLogOf:nil
 44734                 revisionLogOf:nil
 44734 		fromRevision:nil
 44735                 fromRevision:nil
 44735 		toRevision:nil
 44736                 toRevision:nil
 44736 		numberOfRevisions:nil
 44737                 numberOfRevisions:nil
 44737 		fileName:'extensions.st'
 44738                 fileName:'extensions.st'
 44738 		directory:directory
 44739                 directory:directory
 44739 		module:module.
 44740                 module:module.
 44740 	] ifFalse:[
 44741         ] ifFalse:[
 44741 	    revisionLog := mgr revisionLogOf:mclass.
 44742             revisionLog := mgr revisionLogOf:mclass.
 44742 	].
 44743         ].
 44743 	revisions := revisionLog at:#revisions.
 44744         revisions := revisionLog at:#revisions.
 44744 
 44745 
 44745 	start := 1.
 44746         start := 1.
 44746 	stop := revisions size.
 44747         stop := revisions size.
 44747 	stop > 20 ifTrue:[
 44748         stop > 20 ifTrue:[
 44748 	    thisIsAnExtensionMethod ifTrue:[
 44749             thisIsAnExtensionMethod ifTrue:[
 44749 		t := 500.   "/ fake time
 44750                 t := 500.   "/ fake time
 44750 	    ] ifFalse:[
 44751             ] ifFalse:[
 44751 		"/ measure the time it takes to checkout a version...
 44752                 "/ measure the time it takes to checkout a version...
 44752 		t := Time millisecondsToRun:[
 44753                 t := Time millisecondsToRun:[
 44753 		    |revSourceStream|
 44754                     |revSourceStream|
 44754 
 44755 
 44755 		    revSourceStream := mgr getSourceStreamFor:mclass revision:((revisions at:10) at:#revision).
 44756                     revSourceStream := mgr getSourceStreamFor:mclass revision:((revisions at:10) at:#revision).
 44756 		    ChangeSet fromStream:revSourceStream.
 44757                     ChangeSet fromStream:revSourceStream.
 44757 		    revSourceStream close.
 44758                     revSourceStream close.
 44758 		].
 44759                 ].
 44759 	    ].
 44760             ].
 44760 
 44761 
 44761 	    list := revisions collect:[:entry |
 44762             list := revisions collect:[:entry |
 44762 					|rev author dateString date msg|
 44763                                         |rev author dateString date msg|
 44763 
 44764 
 44764 					rev := entry at:#revision.
 44765                                         rev := entry at:#revision.
 44765 					author := entry at:#author.
 44766                                         author := entry at:#author.
 44766 					dateString := entry at:#date.
 44767                                         dateString := entry at:#date.
 44767 					date := Timestamp readGeneralizedFrom:dateString.
 44768                                         date := Timestamp readGeneralizedFrom:dateString.
 44768 					dateString := date printStringFormat:'%(year)-%(mon)-%(day) %h:%m:%s'.
 44769                                         dateString := date printStringFormat:'%(year)-%(mon)-%(day) %h:%m:%s'.
 44769 					entry at:#date put:dateString.
 44770                                         entry at:#date put:dateString.
 44770 					msg := (entry at:#logMessage) asStringCollection first asString.
 44771                                         msg := ((entry at:#logMessage) asStringCollection firstIfEmpty:'') asString.
 44771 					rev,' ',author,' ',dateString,' ',msg
 44772                                         rev,' ',author,' ',dateString,' ',msg
 44772 				      ].
 44773                                       ].
 44773 	    msg := 'There are %1 revisions to extract from the repository'.
 44774             msg := 'There are %1 revisions to extract from the repository'.
 44774 	    t := (t * revisions size / 1000) rounded.
 44775             t := (t * revisions size / 1000) rounded.
 44775 	    t < 10 ifTrue:[
 44776             t < 10 ifTrue:[
 44776 		msg := msg,'\(this will take a few seconds).'.
 44777                 msg := msg,'\(this will take a few seconds).'.
 44777 		tS := t.
 44778                 tS := t.
 44778 	    ] ifFalse:[
 44779             ] ifFalse:[
 44779 		t := t * revisions size // 1000 // 10 * 10.
 44780                 t := t * revisions size // 1000 // 10 * 10.
 44780 		tS := (TimeDuration fromSeconds:t) printStringForApproximation.
 44781                 tS := (TimeDuration fromSeconds:t) printStringForApproximation.
 44781 		msg := msg,'\(this will take roughly %2).'
 44782                 msg := msg,'\(this will take roughly %2).'
 44782 	    ].
 44783             ].
 44783 	    msg := msg,'\\Do you want to see all or only some of the revisions ?'.
 44784             msg := msg,'\\Do you want to see all or only some of the revisions ?'.
 44784 
 44785 
 44785 	    answer := Dialog
 44786             answer := Dialog
 44786 		choose:(resources stringWithCRs:msg
 44787                 choose:(resources stringWithCRs:msg
 44787 				    with:revisions size
 44788                                     with:revisions size
 44788 				    with:tS)
 44789                                     with:tS)
 44789 		fromList:list values:revisions initialSelection:nil
 44790                 fromList:list values:revisions initialSelection:nil
 44790 		buttons:nil
 44791                 buttons:nil
 44791 		values:nil
 44792                 values:nil
 44792 		default:nil
 44793                 default:nil
 44793 		lines:20
 44794                 lines:20
 44794 		cancel:[^ self]
 44795                 cancel:[^ self]
 44795 		multiple:false
 44796                 multiple:false
 44796 		title:(resources string:'Confirmation')
 44797                 title:(resources string:'Confirmation')
 44797 		postBuildBlock:[:dialog |
 44798                 postBuildBlock:[:dialog |
 44798 			    |b|
 44799                             |b|
 44799 
 44800 
 44800 			    b := Button label:(resources string:'Browse Newer than Selected').
 44801                             b := Button label:(resources string:'Browse Newer than Selected').
 44801 			    b action:[ stop := (dialog componentAt:#ListView) selection. dialog okPressed].
 44802                             b action:[ stop := (dialog componentAt:#ListView) selection. dialog okPressed].
 44802 			    b := dialog addButton:b before:dialog okButton.
 44803                             b := dialog addButton:b before:dialog okButton.
 44803 
 44804 
 44804 			    dialog okButton label:(resources string:'Browse All').
 44805                             dialog okButton label:(resources string:'Browse All').
 44805 			    dialog okButton action:[ stop := revisions size. dialog okPressed].
 44806                             dialog okButton action:[ stop := revisions size. dialog okPressed].
 44806 			].
 44807                         ].
 44807 
 44808 
 44808 	    stop isNil ifTrue:[^ self ].
 44809             stop isNil ifTrue:[^ self ].
 44809 	].
 44810         ].
 44810 
 44811 
 44811 t := Time millisecondsToRun:[
 44812 t := Time millisecondsToRun:[
 44812 
 44813 
 44813 	previousMethods := ChangeSet new.
 44814         previousMethods := ChangeSet new.
 44814 	lastSource := currentSource := method source.
 44815         lastSource := currentSource := method source.
 44815 	lastRevision := lastDate := nil.
 44816         lastRevision := lastDate := nil.
 44816 	first := true.
 44817         first := true.
 44817 
 44818 
 44818 	revisions from:start to:stop do:[:eachLogEntry |
 44819         revisions from:start to:stop do:[:eachLogEntry |
 44819 	    |revision date revSourceStream|
 44820             |revision date revSourceStream|
 44820 
 44821 
 44821 	    revision := eachLogEntry at:#revision.
 44822             revision := eachLogEntry at:#revision.
 44822 	    date := eachLogEntry at:#date.
 44823             date := eachLogEntry at:#date.
 44823 
 44824 
 44824 	    [
 44825             [
 44825 		|chg nChg classChangeSet changeSource changeName|
 44826                 |chg nChg classChangeSet changeSource changeName|
 44826 
 44827 
 44827 		self activityNotification:('Fetching revision ',revision,'...').
 44828                 self activityNotification:('Fetching revision ',revision,'...').
 44828 		thisIsAnExtensionMethod ifTrue:[
 44829                 thisIsAnExtensionMethod ifTrue:[
 44829 		    revSourceStream := mgr
 44830                     revSourceStream := mgr
 44830 					    streamForClass:nil
 44831                                             streamForClass:nil
 44831 					    fileName:'extensions.st'
 44832                                             fileName:'extensions.st'
 44832 					    revision:revision
 44833                                             revision:revision
 44833 					    directory:directory
 44834                                             directory:directory
 44834 					    module:module
 44835                                             module:module
 44835 					    cache:true.
 44836                                             cache:true.
 44836 		] ifFalse:[
 44837                 ] ifFalse:[
 44837 		    revSourceStream := mgr getSourceStreamFor:mclass revision:revision.
 44838                     revSourceStream := mgr getSourceStreamFor:mclass revision:revision.
 44838 		].
 44839                 ].
 44839 		revSourceStream isNil ifTrue:[
 44840                 revSourceStream isNil ifTrue:[
 44840 		    self warn:'could not load source for ' , mclass name , ' revision ', revision,  ' from repository'.
 44841                     self warn:'could not load source for ' , mclass name , ' revision ', revision,  ' from repository'.
 44841 		    chg := nil.
 44842                     chg := nil.
 44842 		] ifFalse:[
 44843                 ] ifFalse:[
 44843 		    classChangeSet := ChangeSet fromStream:revSourceStream.
 44844                     classChangeSet := ChangeSet fromStream:revSourceStream.
 44844 
 44845 
 44845 		    chg := classChangeSet
 44846                     chg := classChangeSet
 44846 				detect:[:chg | chg isMethodChange
 44847                                 detect:[:chg | chg isMethodChange
 44847 					       and:[chg selector = mselector
 44848                                                and:[chg selector = mselector
 44848 					       and:[chg className = className]]]
 44849                                                and:[chg className = className]]]
 44849 				ifNone:nil.
 44850                                 ifNone:nil.
 44850 		].
 44851                 ].
 44851 
 44852 
 44852 		chg isNil ifTrue:[
 44853                 chg isNil ifTrue:[
 44853 		    "the method was created in the next version (previous one processed)"
 44854                     "the method was created in the next version (previous one processed)"
 44854 		] ifFalse:[
 44855                 ] ifFalse:[
 44855 		    changeSource := chg source.
 44856                     changeSource := chg source.
 44856 		].
 44857                 ].
 44857 		((changeSource isNil and:[lastSource isNil])
 44858                 ((changeSource isNil and:[lastSource isNil])
 44858 		or:[ changeSource asString = lastSource asString ]) ifTrue:[
 44859                 or:[ changeSource asString = lastSource asString ]) ifTrue:[
 44859 		] ifFalse:[
 44860                 ] ifFalse:[
 44860 		    lastChange isNil ifTrue:[
 44861                     lastChange isNil ifTrue:[
 44861 			"/ mhm - was not in the previous version
 44862                         "/ mhm - was not in the previous version
 44862 		    ] ifFalse:[
 44863                     ] ifFalse:[
 44863 			nChg := lastChange asNamedMethodChange
 44864                         nChg := lastChange asNamedMethodChange
 44864 		    ].
 44865                     ].
 44865 		    lastRevision isNil ifTrue:[
 44866                     lastRevision isNil ifTrue:[
 44866 			(stop = revisions size) ifTrue:[
 44867                         (stop = revisions size) ifTrue:[
 44867 			    changeName := 'current (not in the repository)'.
 44868                             changeName := 'current (not in the repository)'.
 44868 			] ifFalse:[
 44869                         ] ifFalse:[
 44869 			    "/ not showing all - dont really know
 44870                             "/ not showing all - dont really know
 44870 			    changeName := 'current'.
 44871                             changeName := 'current'.
 44871 			].
 44872                         ].
 44872 		    ] ifFalse:[
 44873                     ] ifFalse:[
 44873 			changeName := lastRevision,' [',lastDate,']'.
 44874                         changeName := lastRevision,' [',lastDate,']'.
 44874 			first ifTrue:[
 44875                         first ifTrue:[
 44875 			    changeName := changeName,' (= current)'.
 44876                             changeName := changeName,' (= current)'.
 44876 			]
 44877                         ]
 44877 		    ].
 44878                     ].
 44878 		    nChg notNil ifTrue:[
 44879                     nChg notNil ifTrue:[
 44879 			nChg changeName:changeName.
 44880                         nChg changeName:changeName.
 44880 			previousMethods add:nChg.
 44881                         previousMethods add:nChg.
 44881 		    ].
 44882                     ].
 44882 		    lastSource := changeSource.
 44883                     lastSource := changeSource.
 44883 		    lastChange := chg.
 44884                     lastChange := chg.
 44884 
 44885 
 44885 		    first := false.
 44886                     first := false.
 44886 		].
 44887                 ].
 44887 		lastRevision := revision.
 44888                 lastRevision := revision.
 44888 		lastDate := date.
 44889                 lastDate := date.
 44889 	    ] ensure:[
 44890             ] ensure:[
 44890 		revSourceStream notNil ifTrue:[revSourceStream close].
 44891                 revSourceStream notNil ifTrue:[revSourceStream close].
 44891 	    ].
 44892             ].
 44892 	].
 44893         ].
 44893 ].
 44894 ].
 44894 "/ Transcript showCR:('it took %1 seconds' bindWith:(t /1000)printString).
 44895 "/ Transcript showCR:('it took %1 seconds' bindWith:(t /1000)printString).
 44895 
 44896 
 44896 	self activityNotification:nil.
 44897         self activityNotification:nil.
 44897 	browser := (UserPreferences current changeSetBrowserClass) openOn:previousMethods.
 44898         browser := (UserPreferences current changeSetBrowserClass) openOn:previousMethods.
 44898 	browser window label:('Revisions of ' , mclass name , ' ' , mselector).
 44899         browser window label:('Revisions of ' , mclass name , ' ' , mselector).
 44899 	browser readOnly:true.
 44900         browser readOnly:true.
 44900     ].
 44901     ].
 44901 
 44902 
 44902     "Modified: / 01-07-2011 / 16:34:29 / cg"
 44903     "Modified: / 01-07-2011 / 16:34:29 / cg"
 44903     "Created: / 18-11-2011 / 18:19:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 44904     "Created: / 18-11-2011 / 18:19:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 44904     "Created: / 21-12-2011 / 20:29:42 / cg"
 44905     "Created: / 21-12-2011 / 20:29:42 / cg"
 47581 	open
 47582 	open
 47582 
 47583 
 47583     "Modified: / 25-06-2010 / 10:08:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 47584     "Modified: / 25-06-2010 / 10:08:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 47584     "Modified: / 28-02-2012 / 16:48:38 / cg"
 47585     "Modified: / 28-02-2012 / 16:48:38 / cg"
 47585 ! !
 47586 ! !
 47586 
       
 47587 
 47587 
 47588 !NewSystemBrowser methodsFor:'menu actions-variables'!
 47588 !NewSystemBrowser methodsFor:'menu actions-variables'!
 47589 
 47589 
 47590 browseVarRefsOrModsWithTitle:browserTitle boxTitle:boxTitle variables:varType access:accessType all:browseAll
 47590 browseVarRefsOrModsWithTitle:browserTitle boxTitle:boxTitle variables:varType access:accessType all:browseAll
 47591     "show an enterbox for instVar/classVar to search for.
 47591     "show an enterbox for instVar/classVar to search for.
 49417     "add more functionality to the codeView's text-editor-menu.
 49417     "add more functionality to the codeView's text-editor-menu.
 49418      Get here via the menuHolder-plug in codeView."
 49418      Get here via the menuHolder-plug in codeView."
 49419 
 49419 
 49420     <resource: #programMenu>
 49420     <resource: #programMenu>
 49421 
 49421 
 49422     |shiftedMenu codeView menu sensor refactorItem menuOthers|
 49422     |shiftedMenu codeView menu sensor menuOthers|
 49423 
 49423 
 49424     shiftedMenu := self class shiftedCodeViewPopUpMenu decodeAsLiteralArray.
 49424     shiftedMenu := self class shiftedCodeViewPopUpMenu decodeAsLiteralArray.
 49425     shiftedMenu receiver:self.
 49425     shiftedMenu receiver:self.
 49426     shiftedMenu findGuiResourcesIn:self.
 49426     shiftedMenu findGuiResourcesIn:self.
 49427 
 49427 
 49428     codeView := self codeView.
 49428     codeView := self codeView.
 49429     sensor := codeView sensor.
 49429     sensor := codeView sensor.
 49430     sensor shiftDown ifTrue:[
 49430     sensor shiftDown ifTrue:[
 49431 	sensor ctrlDown ifFalse:[
 49431         sensor ctrlDown ifFalse:[
 49432 	    ^ shiftedMenu
 49432             ^ shiftedMenu
 49433 	].
 49433         ].
 49434     ].
 49434     ].
 49435 
 49435 
 49436     menu := codeView editMenu.
 49436     menu := codeView editMenu.
 49437 
 49437 
 49438 "/    sensor ctrlDown ifTrue:[
 49438 "/    sensor ctrlDown ifTrue:[
 49442 "/        ] ifFalse:[
 49442 "/        ] ifFalse:[
 49443 "/            "/ an oldStyle popUpMenu
 49443 "/            "/ an oldStyle popUpMenu
 49444 "/            menuOthers := menu.
 49444 "/            menuOthers := menu.
 49445 "/        ]
 49445 "/        ]
 49446 "/    ] ifFalse:[
 49446 "/    ] ifFalse:[
 49447 	(menu isKindOf:Menu) ifTrue:[
 49447         (menu isKindOf:Menu) ifTrue:[
 49448 	    "/ a newStyle menuPanel
 49448             "/ a newStyle menuPanel
 49449 	    "/ (menu atNameKey:'refactor') "atMenuItemLabeled:'Refactor'" putSubmenu:shiftedMenu visible:true.
 49449             "/ (menu atNameKey:'refactor') "atMenuItemLabeled:'Refactor'" putSubmenu:shiftedMenu visible:true.
 49450 	    menu atMenuItemLabeled:(resources string:'Refactor') putSubmenu:shiftedMenu visible:true.
 49450             (menu menuItemLabeled:(resources string:'Refactor')) notNil ifTrue:[
 49451 	] ifFalse:[
 49451                 menu atMenuItemLabeled:(resources string:'Refactor') putSubmenu:shiftedMenu visible:true.
 49452 	    "/ an oldStyle popUpMenu
 49452             ].
 49453 	    "/ this is a kludge...
 49453         ] ifFalse:[
 49454 	    shiftedMenu := shiftedMenu asOldStylePopUpMenuFor:self.
 49454             "/ an oldStyle popUpMenu
 49455 	    "/ would like to add the shifted-menu here
 49455             "/ this is a kludge...
 49456 	    menu menuView
 49456             shiftedMenu := shiftedMenu asOldStylePopUpMenuFor:self.
 49457 		addLabels:(Array with:'-' with:(resources string:'Refactor'))
 49457             "/ would like to add the shifted-menu here
 49458 		selectors:#( nil refactorings)
 49458             menu menuView
 49459 		accelerators:#(nil 'Shift')
 49459                 addLabels:(Array with:'-' with:(resources string:'Refactor'))
 49460 		after:#accept.
 49460                 selectors:#( nil refactorings)
 49461 	    menu subMenuAt:#refactorings put:shiftedMenu.
 49461                 accelerators:#(nil 'Shift')
 49462 
 49462                 after:#accept.
 49463 	    menuOthers := menu subMenuAt:#others.
 49463             menu subMenuAt:#refactorings put:shiftedMenu.
 49464 	].
 49464 
       
 49465             menuOthers := menu subMenuAt:#others.
       
 49466         ].
 49465 "/    ].
 49467 "/    ].
 49466 
 49468 
 49467 "/    sensor shiftDown ifFalse:[
 49469 "/    sensor shiftDown ifFalse:[
 49468 "/        menuOthers notNil ifTrue:[
 49470 "/        menuOthers notNil ifTrue:[
 49469 "/            menuOthers menuView
 49471 "/            menuOthers menuView
 49480 "/    ].
 49482 "/    ].
 49481 
 49483 
 49482     ^ menu
 49484     ^ menu
 49483 
 49485 
 49484     "Modified: / 18-10-2008 / 18:52:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
 49486     "Modified: / 18-10-2008 / 18:52:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
 49485     "Modified: / 01-03-2012 / 20:04:50 / cg"
 49487     "Modified: / 10-09-2013 / 14:40:13 / cg"
 49486 !
 49488 !
 49487 
 49489 
 49488 compareClassWithSmallTeamVersionMenu
 49490 compareClassWithSmallTeamVersionMenu
 49489     <resource: #programMenu >
 49491     <resource: #programMenu >
 49490 
 49492 
 49817 
 49819 
 49818     mthd := self theSingleSelectedMethod.
 49820     mthd := self theSingleSelectedMethod.
 49819 
 49821 
 49820     (mthd notNil and:[ (mSel := mthd selector) notNil]) ifTrue:[
 49822     (mthd notNil and:[ (mSel := mthd selector) notNil]) ifTrue:[
 49821 
 49823 
 49822 	"/ JV: Following code should be language-specific. For Smalltalk, use the old code.
 49824         "/ JV: Following code should be language-specific. For Smalltalk, use the old code.
 49823 	"/ For the rest, delegate to the language's toolbox (if any)
 49825         "/ For the rest, delegate to the language's toolbox (if any)
 49824 	mthd programmingLanguage isSmalltalk ifFalse:[
 49826         mthd programmingLanguage isSmalltalk ifFalse:[
 49825 	    | toolbox |
 49827             | toolbox |
 49826 
 49828 
 49827 	    toolbox := mthd programmingLanguage toolbox.
 49829             toolbox := mthd programmingLanguage toolbox.
 49828 	    toolbox isNil ifTrue:[
 49830             toolbox isNil ifTrue:[
 49829 		m addItem:((MenuItem label: (resources string: 'Not supported for %1 (no toolbox)'with: mthd programmingLanguage name))
 49831                 m addItem:((MenuItem label: (resources string: 'Not supported for %1 (no toolbox)'with: mthd programmingLanguage name))
 49830 			    enabled: false).
 49832                             enabled: false).
 49831 		^ m.
 49833                 ^ m.
 49832 	    ].
 49834             ].
 49833 	    toolbox browser: self.
 49835             toolbox browser: self.
 49834 	    ^ toolbox messagesMenuFor:actionSelector
 49836             toolbox environment: environment.
 49835 			withMethods: (Array with: mthd)
 49837             ^ toolbox messagesMenuFor:actionSelector
 49836 			withMethodSelectors:withCurrentSelector
 49838                         withMethods: (Array with: mthd)
 49837 			withSentSelectors: true
 49839                         withMethodSelectors:withCurrentSelector
 49838 			withSelfSelectorsOnly: selfSendsOnly
 49840                         withSentSelectors: true
 49839 	].
 49841                         withSelfSelectorsOnly: selfSendsOnly
 49840 
 49842         ].
 49841 	needSep := false.
 49843 
 49842 
 49844         needSep := false.
 49843 	contractedSelector := mSel contractTo:80.
 49845 
 49844 
 49846         contractedSelector := mSel contractTo:80.
 49845 	withCurrentSelector ifTrue:[
 49847 
 49846 	    item := MenuItem label:(' ' , contractedSelector , ' ').   "/ ' ' is a kludge - to allow '-' selector
 49848         withCurrentSelector ifTrue:[
 49847 	    item itemValue:actionSelector argument:mSel.
 49849             item := MenuItem label:(' ' , contractedSelector , ' ').   "/ ' ' is a kludge - to allow '-' selector
 49848 	    m addItem:item.
 49850             item itemValue:actionSelector argument:mSel.
 49849 	    needSep := true.
 49851             m addItem:item.
 49850 	].
 49852             needSep := true.
       
 49853         ].
 49851 "/            true "withInstanceProtocolOnly" ifTrue:[
 49854 "/            true "withInstanceProtocolOnly" ifTrue:[
 49852 "/                item := MenuItem label:(resources string:' %1 - Instance Protocol Only' with:contractedSelector).
 49855 "/                item := MenuItem label:(resources string:' %1 - Instance Protocol Only' with:contractedSelector).
 49853 "/                item value:actionSelector.
 49856 "/                item value:actionSelector.
 49854 "/                item argument:(#instanceProtocolOnly -> mSel).
 49857 "/                item argument:(#instanceProtocolOnly -> mSel).
 49855 "/                m addItem:item.
 49858 "/                m addItem:item.
 49859 "/                item value:actionSelector.
 49862 "/                item value:actionSelector.
 49860 "/                item argument:(#classProtocolOnly -> mSel).
 49863 "/                item argument:(#classProtocolOnly -> mSel).
 49861 "/                m addItem:item.
 49864 "/                m addItem:item.
 49862 "/            ].
 49865 "/            ].
 49863 
 49866 
 49864 	(withLocalSenders or:[ withSenderChain or:[ withLocalImplementors or:[ withImplementorChain]]]) ifTrue:[
 49867         (withLocalSenders or:[ withSenderChain or:[ withLocalImplementors or:[ withImplementorChain]]]) ifTrue:[
 49865 	    needSep ifTrue:[ m addSeparator ].
 49868             needSep ifTrue:[ m addSeparator ].
 49866 	    needSep := false.
 49869             needSep := false.
 49867 	].
 49870         ].
 49868 
 49871 
 49869 	withLocalSenders ifTrue:[
 49872         withLocalSenders ifTrue:[
 49870 	    "/ item := MenuItem label:(resources string:' %1 - Local Senders' with:contractedSelector).
 49873             "/ item := MenuItem label:(resources string:' %1 - Local Senders' with:contractedSelector).
 49871 	    item := MenuItem label:(resources string:'Local Senders of %1' with:contractedSelector).
 49874             item := MenuItem label:(resources string:'Local Senders of %1' with:contractedSelector).
 49872 	    item itemValue:#spawnLocalSendersBuffer.
 49875             item itemValue:#spawnLocalSendersBuffer.
 49873 	    m addItem:item. needSep := true
 49876             m addItem:item. needSep := true
 49874 	].
 49877         ].
 49875 	withSenderChain ifTrue:[
 49878         withSenderChain ifTrue:[
 49876 	    "/ item := MenuItem label:(resources string:' %1 - Sender Chain' with:contractedSelector).
 49879             "/ item := MenuItem label:(resources string:' %1 - Sender Chain' with:contractedSelector).
 49877 	    item := MenuItem label:(resources string:'Sender Chain of %1' with:contractedSelector).
 49880             item := MenuItem label:(resources string:'Sender Chain of %1' with:contractedSelector).
 49878 	    item itemValue:#spawnSenderChainBuffer.
 49881             item itemValue:#spawnSenderChainBuffer.
 49879 	    m addItem:item. needSep := true
 49882             m addItem:item. needSep := true
 49880 	].
 49883         ].
 49881 	(withCallersOfThisMethod and:[mthd isInstrumented]) ifTrue:[
 49884         (withCallersOfThisMethod and:[mthd isInstrumented]) ifTrue:[
 49882 	    item := MenuItem label:(resources string:'Callers of this %1' with:contractedSelector).
 49885             item := MenuItem label:(resources string:'Callers of this %1' with:contractedSelector).
 49883 	    item itemValue:#spawnCallersBuffer.
 49886             item itemValue:#spawnCallersBuffer.
 49884 	    m addItem:item. needSep := true
 49887             m addItem:item. needSep := true
 49885 	].
 49888         ].
 49886 
 49889 
 49887 	withLocalImplementors ifTrue:[
 49890         withLocalImplementors ifTrue:[
 49888 	    item := MenuItem label:(resources string:'Local Implementors of %1' with:contractedSelector).
 49891             item := MenuItem label:(resources string:'Local Implementors of %1' with:contractedSelector).
 49889 	    item itemValue:#spawnLocalImplementorsBuffer.
 49892             item itemValue:#spawnLocalImplementorsBuffer.
 49890 	    m addItem:item. needSep := true
 49893             m addItem:item. needSep := true
 49891 	].
 49894         ].
 49892 	withImplementorChain ifTrue:[
 49895         withImplementorChain ifTrue:[
 49893 	    item := MenuItem label:(resources string:'Implementor Chain of %1' with:contractedSelector).
 49896             item := MenuItem label:(resources string:'Implementor Chain of %1' with:contractedSelector).
 49894 	    item itemValue:#spawnImplementorChainBuffer.
 49897             item itemValue:#spawnImplementorChainBuffer.
 49895 	    m addItem:item. needSep := true
 49898             m addItem:item. needSep := true
 49896 	].
 49899         ].
 49897 	withMethodsCalledByThisMethod ifTrue:[
 49900         withMethodsCalledByThisMethod ifTrue:[
 49898 	    item := MenuItem label:(resources string:'Methods Called by %1' with:contractedSelector).
 49901             item := MenuItem label:(resources string:'Methods Called by %1' with:contractedSelector).
 49899 	    item itemValue:#spawnMethodsCalledByBuffer.
 49902             item itemValue:#spawnMethodsCalledByBuffer.
 49900 	    m addItem:item. needSep := true
 49903             m addItem:item. needSep := true
 49901 	].
 49904         ].
 49902 
 49905 
 49903 	selfSendsOnly ifTrue:[
 49906         selfSendsOnly ifTrue:[
 49904 	    l := mthd messagesSentToSelf.
 49907             l := mthd messagesSentToSelf.
 49905 	    l := l , (mthd messagesSentToSuper asArray collect:[:each | { each . mthd mclass superclass }]).
 49908             l := l , (mthd messagesSentToSuper asArray collect:[:each | { each . mthd mclass superclass }]).
 49906 	    l := l , ((mthd messagesPossiblySent
 49909             l := l , ((mthd messagesPossiblySent
 49907 			  select:[:sel | mthd mclass canUnderstand:sel])
 49910                           select:[:sel | mthd mclass canUnderstand:sel])
 49908 			    asArray collect:[:each | each colorizeAllWith:Color darkGrey]).
 49911                             asArray collect:[:each | each colorizeAllWith:Color darkGrey]).
 49909 	] ifFalse:[
 49912         ] ifFalse:[
 49910 	    l := mthd messagesSent asArray.
 49913             l := mthd messagesSent asArray.
 49911 	    l := l , (mthd messagesPossiblySent asArray collect:[:each | each colorizeAllWith:Color darkGrey]).
 49914             l := l , (mthd messagesPossiblySent asArray collect:[:each | each colorizeAllWith:Color darkGrey]).
 49912 	].
 49915         ].
 49913 	l size > 0 ifTrue:[
 49916         l size > 0 ifTrue:[
 49914 	    l := l asOrderedCollection sort:[:a :b |
 49917             l := l asOrderedCollection sort:[:a :b |
 49915 						|sA sB|
 49918                                                 |sA sB|
 49916 						sA := a isArray ifTrue:[a first] ifFalse:[a string].
 49919                                                 sA := a isArray ifTrue:[a first] ifFalse:[a string].
 49917 						sB := b isArray ifTrue:[b first] ifFalse:[b string].
 49920                                                 sB := b isArray ifTrue:[b first] ifFalse:[b string].
 49918 						sA < sB].
 49921                                                 sA < sB].
 49919 
 49922 
 49920 	    needSep ifTrue:[ m addSeparator ].
 49923             needSep ifTrue:[ m addSeparator ].
 49921 
 49924 
 49922 "/            (l size > 30) ifTrue:[
 49925 "/            (l size > 30) ifTrue:[
 49923 "/                l removeAllFoundIn:#(ifTrue: ifFalse: ifTrue:ifFalse: ifFalse:ifTrue:
 49926 "/                l removeAllFoundIn:#(ifTrue: ifFalse: ifTrue:ifFalse: ifFalse:ifTrue:
 49924 "/                                     whileTrue: whileFalse:
 49927 "/                                     whileTrue: whileFalse:
 49925 "/                                     isNil notNil
 49928 "/                                     isNil notNil
 49932 "/            ].
 49935 "/            ].
 49933 "/            (cut := l size > 30) ifTrue:[
 49936 "/            (cut := l size > 30) ifTrue:[
 49934 "/                l := l copyTo:30
 49937 "/                l := l copyTo:30
 49935 "/            ].
 49938 "/            ].
 49936 
 49939 
 49937 	    l do:[:eachMessageOrPair |
 49940             l do:[:eachMessageOrPair |
 49938 		|selector class label arg|
 49941                 |selector class label arg|
 49939 
 49942 
 49940 		eachMessageOrPair isArray ifTrue:[
 49943                 eachMessageOrPair isArray ifTrue:[
 49941 		    selector := eachMessageOrPair first.
 49944                     selector := eachMessageOrPair first.
 49942 		    class := eachMessageOrPair second.
 49945                     class := eachMessageOrPair second.
 49943 		    arg := eachMessageOrPair.
 49946                     arg := eachMessageOrPair.
 49944 		] ifFalse:[
 49947                 ] ifFalse:[
 49945 		    selector := eachMessageOrPair.
 49948                     selector := eachMessageOrPair.
 49946 		    arg := eachMessageOrPair string asSymbol.
 49949                     arg := eachMessageOrPair string asSymbol.
 49947 		].
 49950                 ].
 49948 		label := (selector contractTo:100).
 49951                 label := (selector contractTo:100).
 49949 		class notNil ifTrue:[
 49952                 class notNil ifTrue:[
 49950 		    label := label , ' (super)'.
 49953                     label := label , ' (super)'.
 49951 		].
 49954                 ].
 49952 		item := MenuItem label:(' ' , label, ' ').  "/ ' ' is a kludge - to allow '-' selector (i.e. not confuse with separator)
 49955                 item := MenuItem label:(' ' , label, ' ').  "/ ' ' is a kludge - to allow '-' selector (i.e. not confuse with separator)
 49953 		item itemValue:actionSelector argument:arg.
 49956                 item itemValue:actionSelector argument:arg.
 49954 		m addItem:item.
 49957                 m addItem:item.
 49955 	    ].
 49958             ].
 49956 
 49959 
 49957 "/            cut ifTrue:[
 49960 "/            cut ifTrue:[
 49958 "/                m addItem:(MenuItem label:'-').
 49961 "/                m addItem:(MenuItem label:'-').
 49959 "/                m addItem:(MenuItem label:'<< more items ignored >>').
 49962 "/                m addItem:(MenuItem label:'<< more items ignored >>').
 49960 "/            ]
 49963 "/            ]
 49961 	]
 49964         ]
 49962     ] ifFalse:[
 49965     ] ifFalse:[
 49963 	| methodsPerLanguage |
 49966         | methodsPerLanguage |
 49964 
 49967 
 49965 	allMessagesSent := Set new.
 49968         allMessagesSent := Set new.
 49966 
 49969 
 49967 	"/ not exactly one method selected;
 49970         "/ not exactly one method selected;
 49968 	"/ generate a menu for all selected method's implementors and sent messages.
 49971         "/ generate a menu for all selected method's implementors and sent messages.
 49969 	methods := self selectedMethodsValue.
 49972         methods := self selectedMethodsValue.
 49970 	methods isEmptyOrNil ifTrue:[
 49973         methods isEmptyOrNil ifTrue:[
 49971 	    methods := OrderedCollection new.
 49974             methods := OrderedCollection new.
 49972 	    self selectedClassesDo:[:cls |
 49975             self selectedClassesDo:[:cls |
 49973 		cls methodsDo:[:eachMethod | methods add:eachMethod].
 49976                 cls methodsDo:[:eachMethod | methods add:eachMethod].
 49974 	    ].
 49977             ].
 49975 	].
 49978         ].
 49976 	methodsPerLanguage := Dictionary new.
 49979         methodsPerLanguage := Dictionary new.
 49977 	methods do:[:each |
 49980         methods do:[:each |
 49978 	    (methodsPerLanguage at: each programmingLanguage ifAbsentPut:[Set new]) add: each.
 49981             (methodsPerLanguage at: each programmingLanguage ifAbsentPut:[Set new]) add: each.
 49979 	].
 49982         ].
 49980 	methodsPerLanguage keysAndValuesDo:[:language :methods |
 49983         methodsPerLanguage keysAndValuesDo:[:language :methods |
 49981 	    language isSmalltalk ifTrue:[
 49984             language isSmalltalk ifTrue:[
 49982 		"/ Do it as before...
 49985                 "/ Do it as before...
 49983 		methods do:[:eachMethod |
 49986                 methods do:[:eachMethod |
 49984 		    mSel := eachMethod selector ? '?'.
 49987                     mSel := eachMethod selector ? '?'.
 49985 		    contractedSelector := mSel contractTo:80.
 49988                     contractedSelector := mSel contractTo:80.
 49986 
 49989 
 49987 		    item := MenuItem label:(' ' , contractedSelector , ' ').   "/ ' ' is a kludge - to allow '-' selector
 49990                     item := MenuItem label:(' ' , contractedSelector , ' ').   "/ ' ' is a kludge - to allow '-' selector
 49988 		    item itemValue:actionSelector argument:mSel.
 49991                     item itemValue:actionSelector argument:mSel.
 49989 		    m addItem:item.
 49992                     m addItem:item.
 49990 
 49993 
 49991 		    selfSendsOnly ifTrue:[
 49994                     selfSendsOnly ifTrue:[
 49992 			allMessagesSent addAll:(eachMethod messagesSentToSelf).
 49995                         allMessagesSent addAll:(eachMethod messagesSentToSelf).
 49993 		    ] ifFalse:[
 49996                     ] ifFalse:[
 49994 			allMessagesSent addAll:(eachMethod messagesSent).
 49997                         allMessagesSent addAll:(eachMethod messagesSent).
 49995 		    ].
 49998                     ].
 49996 		].
 49999                 ].
 49997 	    ] ifFalse:[
 50000             ] ifFalse:[
 49998 		"/ Not a Smalltalk, must ask toolbox
 50001                 "/ Not a Smalltalk, must ask toolbox
 49999 		| toolbox |
 50002                 | toolbox |
 50000 
 50003 
 50001 		toolbox := language toolbox.
 50004                 toolbox := language toolbox.
 50002 		toolbox notNil ifTrue:[
 50005                 toolbox environment: environment.
 50003 		    m addItemsFrom:
 50006                 toolbox notNil ifTrue:[
 50004 			(toolbox messagesMenuFor:actionSelector
 50007                     m addItemsFrom:
 50005 				    withMethods: methods
 50008                         (toolbox messagesMenuFor:actionSelector
 50006 				    withMethodSelectors:true
 50009                                     withMethods: methods
 50007 				    withSentSelectors: false
 50010                                     withMethodSelectors:true
 50008 				    withSelfSelectorsOnly: selfSendsOnly)
 50011                                     withSentSelectors: false
 50009 		].
 50012                                     withSelfSelectorsOnly: selfSendsOnly)
 50010 	    ].
 50013                 ].
 50011 	].
 50014             ].
 50012 
 50015         ].
 50013 	needSep := true.
 50016 
 50014 	methodsPerLanguage keysAndValuesDo:[:language :methods |
 50017         needSep := true.
 50015 	    language isSmalltalk ifTrue:[
 50018         methodsPerLanguage keysAndValuesDo:[:language :methods |
 50016 		"/ Do it as before...
 50019             language isSmalltalk ifTrue:[
 50017 		allMessagesSent := allMessagesSent asSortedCollection.
 50020                 "/ Do it as before...
 50018 		allMessagesSent size > 0 ifTrue:[
 50021                 allMessagesSent := allMessagesSent asSortedCollection.
 50019 		    needSep ifTrue:[
 50022                 allMessagesSent size > 0 ifTrue:[
 50020 			m addSeparator.
 50023                     needSep ifTrue:[
 50021 			needSep := false.
 50024                         m addSeparator.
 50022 		    ].
 50025                         needSep := false.
 50023 		    allMessagesSent do:[:eachMessage |
 50026                     ].
 50024 			item := MenuItem label:(' ' , (eachMessage contractTo:100), ' ').  "/ ' ' is a kludge - to allow '-' selector
 50027                     allMessagesSent do:[:eachMessage |
 50025 			item itemValue:actionSelector argument:eachMessage asSymbol.
 50028                         item := MenuItem label:(' ' , (eachMessage contractTo:100), ' ').  "/ ' ' is a kludge - to allow '-' selector
 50026 			m addItem:item.
 50029                         item itemValue:actionSelector argument:eachMessage asSymbol.
 50027 		    ].
 50030                         m addItem:item.
 50028 		].
 50031                     ].
 50029 	    ] ifFalse:[
 50032                 ].
 50030 		"/ Not a Smalltalk, must ask toolbox
 50033             ] ifFalse:[
 50031 		| toolbox |
 50034                 "/ Not a Smalltalk, must ask toolbox
 50032 
 50035                 | toolbox |
 50033 		toolbox := language toolbox.
 50036 
 50034 		toolbox notNil ifTrue:[
 50037                 toolbox := language toolbox.
 50035 		    | lm |
 50038                 toolbox notNil ifTrue:[
 50036 
 50039                     | lm |
 50037 		    lm := toolbox messagesMenuFor:actionSelector
 50040 
 50038 				withMethods: methods
 50041                     lm := toolbox messagesMenuFor:actionSelector
 50039 				withMethodSelectors:false
 50042                                 withMethods: methods
 50040 				withSentSelectors: true
 50043                                 withMethodSelectors:false
 50041 				withSelfSelectorsOnly: selfSendsOnly.
 50044                                 withSentSelectors: true
 50042 		    (lm items notEmptyOrNil and:[needSep]) ifTrue:[
 50045                                 withSelfSelectorsOnly: selfSendsOnly.
 50043 			m addSeparator.
 50046                     (lm items notEmptyOrNil and:[needSep]) ifTrue:[
 50044 			needSep := false.
 50047                         m addSeparator.
 50045 		    ].
 50048                         needSep := false.
 50046 		    m addItemsFrom: lm.
 50049                     ].
 50047 		].
 50050                     m addItemsFrom: lm.
 50048 	    ].
 50051                 ].
 50049 	].
 50052             ].
       
 50053         ].
 50050     ].
 50054     ].
 50051     ^ m
 50055     ^ m
 50052 
 50056 
 50053     "Created: / 27-04-2010 / 15:05:52 / cg"
 50057     "Created: / 27-04-2010 / 15:05:52 / cg"
 50054     "Modified: / 30-07-2013 / 15:53:58 / cg"
 50058     "Modified: / 30-07-2013 / 15:53:58 / cg"
 50055     "Modified: / 01-09-2013 / 18:25:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 50059     "Modified: / 06-09-2013 / 19:37:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 50056 !
 50060 !
 50057 
 50061 
 50058 messagesMenuFor:actionSelector withSenderChain:withSenderChain withImplementorChain:withImplementorChain
 50062 messagesMenuFor:actionSelector withSenderChain:withSenderChain withImplementorChain:withImplementorChain
 50059     ^ self
 50063     ^ self
 50060 	messagesMenuFor:actionSelector
 50064 	messagesMenuFor:actionSelector
 50850 
 50854 
 50851     "Created: / 19-04-2011 / 14:29:47 / cg"
 50855     "Created: / 19-04-2011 / 14:29:47 / cg"
 50852     "Created: / 12-10-2011 / 20:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 50856     "Created: / 12-10-2011 / 20:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 50853     "Modified: / 19-10-2011 / 16:48:31 / cg"
 50857     "Modified: / 19-10-2011 / 16:48:31 / cg"
 50854 ! !
 50858 ! !
 50855 
       
 50856 
 50859 
 50857 !NewSystemBrowser methodsFor:'menus-dynamic-popup'!
 50860 !NewSystemBrowser methodsFor:'menus-dynamic-popup'!
 50858 
 50861 
 50859 categoryPopUpMenu
 50862 categoryPopUpMenu
 50860     "return the popUpMenu for the class-category-list view"
 50863     "return the popUpMenu for the class-category-list view"
 51306 
 51309 
 51307     |orgMode cls namespaces nsName cat pkg holder newValue doSwitchMeta mthd answer
 51310     |orgMode cls namespaces nsName cat pkg holder newValue doSwitchMeta mthd answer
 51308      ns classes|
 51311      ns classes|
 51309 
 51312 
 51310     aClass isNil ifTrue:[
 51313     aClass isNil ifTrue:[
 51311 	^ self
 51314         ^ self
 51312     ].
 51315     ].
 51313     aSelector notNil ifTrue:[
 51316     aSelector notNil ifTrue:[
 51314 	mthd := aClass compiledMethodAt:aSelector.
 51317         mthd := aClass compiledMethodAt:aSelector.
 51315     ].
 51318     ].
 51316 
 51319 
 51317     (navigationState isMethodListBrowser
 51320     (navigationState isMethodListBrowser
 51318     or:[navigationState isMethodBrowser]) ifTrue:[
 51321     or:[navigationState isMethodBrowser]) ifTrue:[
 51319 	"/ must check if that method is in the list ...
 51322         "/ must check if that method is in the list ...
 51320 
 51323 
 51321 	mthd isNil ifTrue:[
 51324         mthd isNil ifTrue:[
 51322 "/            (self confirm:'Add a buffer for the class ?' withCRs) ifFalse:[
 51325 "/            (self confirm:'Add a buffer for the class ?' withCRs) ifFalse:[
 51323 "/                ^ self
 51326 "/                ^ self
 51324 "/            ].
 51327 "/            ].
 51325 	    self spawnFullBrowserInClass:aClass selector:nil in:#newBuffer.
 51328             self spawnFullBrowserInClass:aClass selector:nil in:#newBuffer.
 51326 	    ^ self
 51329             ^ self
 51327 	].
 51330         ].
 51328 
 51331 
 51329 	navigationState methodListApplication isNil ifTrue:[
 51332         navigationState methodListApplication isNil ifTrue:[
 51330 	    self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51333             self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51331 	    ^ self
 51334             ^ self
 51332 	].
 51335         ].
 51333 
 51336 
 51334 	(navigationState methodList includesIdentical:mthd) ifFalse:[
 51337         (navigationState methodList includesIdentical:mthd) ifFalse:[
 51335 	    answer := OptionBox request:'Method not in list.\\Add a buffer for it ?' withCRs
 51338             answer := OptionBox request:'Method not in list.\\Add a buffer for it ?' withCRs
 51336 			label:'New Browser ?'
 51339                         label:'New Browser ?'
 51337 			image:(WarningBox iconBitmap)
 51340                         image:(WarningBox iconBitmap)
 51338 			buttonLabels:(resources array:#('New Browser' 'Add Buffer' 'Cancel'))
 51341                         buttonLabels:(resources array:#('New Browser' 'Add Buffer' 'Cancel'))
 51339 			values:#(#newBrowser #newBuffer nil)
 51342                         values:#(#newBrowser #newBuffer nil)
 51340 			default:#newBuffer
 51343                         default:#newBuffer
 51341 			onCancel:nil.
 51344                         onCancel:nil.
 51342 	    answer notNil ifTrue:[
 51345             answer notNil ifTrue:[
 51343 		self spawnFullBrowserInClass:aClass selector:aSelector in:answer.
 51346                 self spawnFullBrowserInClass:aClass selector:aSelector in:answer.
 51344 	    ].
 51347             ].
 51345 	    ^ self
 51348             ^ self
 51346 	].
 51349         ].
 51347 	self selectedMethods value:(OrderedCollection with:mthd).
 51350         self selectedMethods value:(OrderedCollection with:mthd).
 51348 	^ self
 51351         ^ self
 51349     ].
 51352     ].
 51350 
 51353 
       
 51354     mthd isNil ifTrue:[
       
 51355         self selectedMethods value:(OrderedCollection new).
       
 51356     ] ifFalse:[
       
 51357         self selectedMethods value:(OrderedCollection with:mthd).
       
 51358     ].
 51351     (navigationState isClassBrowser) ifTrue:[
 51359     (navigationState isClassBrowser) ifTrue:[
 51352 	"/ must check if that class is in the list ...
 51360         "/ must check if that class is in the list ...
 51353 	((navigationState classList value ? #()) includesIdentical:aClass) ifFalse:[
 51361         ((navigationState classList value ? #()) includesIdentical:aClass) ifFalse:[
 51354 	    navigationState isSingleClassBrowser ifTrue:[
 51362             navigationState isSingleClassBrowser ifTrue:[
 51355 		navigationState classList value:(Array with:aClass).
 51363                 navigationState classList value:(Array with:aClass).
 51356 	    ] ifFalse:[
 51364             ] ifFalse:[
 51357 		(self confirm:'Class not in list.\\Add a buffer for it ?' withCRs) ifTrue:[
 51365                 (self confirm:'Class not in list.\\Add a buffer for it ?' withCRs) ifTrue:[
 51358 		    self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51366                     self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51359 		].
 51367                 ].
 51360 		^ self
 51368                 ^ self
 51361 	    ].
 51369             ].
 51362 	].
 51370         ].
 51363 	self selectedClasses value:(OrderedCollection with:aClass).
 51371         self selectedClasses value:(OrderedCollection with:aClass).
 51364 	^ self
 51372         ^ self
 51365     ].
 51373     ].
 51366 
 51374 
 51367     (navigationState isProtocolBrowser) ifTrue:[
 51375     (navigationState isProtocolBrowser) ifTrue:[
 51368 	(self confirm:'Add a buffer for it ?' withCRs) ifTrue:[
 51376         (self confirm:'Add a buffer for it ?' withCRs) ifTrue:[
 51369 	    self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51377             self spawnFullBrowserInClass:aClass selector:aSelector in:#newBuffer.
 51370 	].
 51378         ].
 51371 	^ self
 51379         ^ self
 51372     ].
 51380     ].
 51373 
 51381 
 51374     orgMode := self organizerMode value.
 51382     orgMode := self organizerMode value.
 51375 
 51383 
 51376     "/ if the class is a namespace, ask if mode should be changed
 51384     "/ if the class is a namespace, ask if mode should be changed
 51377 
 51385 
 51378     (aClass isNameSpace and:[aClass ~~ Smalltalk]) ifTrue:[
 51386     (aClass isNameSpace and:[aClass ~~ Smalltalk]) ifTrue:[
 51379 	orgMode ~~ OrganizerCanvas organizerModeNamespace ifTrue:[
 51387         orgMode ~~ OrganizerCanvas organizerModeNamespace ifTrue:[
 51380 	    answer := self
 51388             answer := self
 51381 			confirmWithCancel:(resources string:'Browser: %1 is a namespace - switch organizers display mode ?' with:aClass name)
 51389                         confirmWithCancel:(resources string:'Browser: %1 is a namespace - switch organizers display mode ?' with:aClass name)
 51382 			defaultAnswer:false.
 51390                         defaultAnswer:false.
 51383 	    answer isNil ifTrue:[
 51391             answer isNil ifTrue:[
 51384 		AbortOperationRequest raise.
 51392                 AbortOperationRequest raise.
 51385 		^ self
 51393                 ^ self
 51386 	    ].
 51394             ].
 51387 	    answer ifTrue:[
 51395             answer ifTrue:[
 51388 		self organizerMode value:(OrganizerCanvas organizerModeNamespace).
 51396                 self organizerMode value:(OrganizerCanvas organizerModeNamespace).
 51389 		orgMode := self organizerMode value.
 51397                 orgMode := self organizerMode value.
 51390 	    ] ifFalse:[
 51398             ] ifFalse:[
 51391 		((self selectedClassesValue) contains:[:cls | cls nameSpace == aClass]) ifTrue:[^ self ].
 51399                 ((self selectedClassesValue) contains:[:cls | cls nameSpace == aClass]) ifTrue:[^ self ].
 51392 
 51400 
 51393 		"/ select the first class of that namespace
 51401                 "/ select the first class of that namespace
 51394 		classes := aClass allClasses.
 51402                 classes := aClass allClasses.
 51395 		classes notEmpty ifTrue:[
 51403                 classes notEmpty ifTrue:[
 51396 		    self switchToClass:(classes first) selector:nil.
 51404                     self switchToClass:(classes first) selector:nil.
 51397 		    ^ self.
 51405                     ^ self.
 51398 		]
 51406                 ]
 51399 	    ]
 51407             ]
 51400 	].
 51408         ].
 51401     ].
 51409     ].
 51402 
 51410 
 51403     "/ if the class is unloaded, turn hideUnloaded off
 51411     "/ if the class is unloaded, turn hideUnloaded off
 51404     (aClass isLoaded not
 51412     (aClass isLoaded not
 51405     and:[self hideUnloadedClasses value == true]) ifTrue:[
 51413     and:[self hideUnloadedClasses value == true]) ifTrue:[
 51406 	self hideUnloadedClasses value:false
 51414         self hideUnloadedClasses value:false
 51407     ].
 51415     ].
 51408 
 51416 
 51409     doSwitchMeta := true.
 51417     doSwitchMeta := true.
 51410     "/ FIX bug in protocol-list; will not update selection otherwise ...
 51418     "/ FIX bug in protocol-list; will not update selection otherwise ...
 51411     self immediateUpdate value:true.
 51419     self immediateUpdate value:true.
 51412 
 51420 
 51413     namespaces := self selectedNamespaces value ? #().
 51421     namespaces := self selectedNamespaces value ? #().
 51414     ns := aClass topNameSpace.
 51422     ns := aClass topNameSpace.
 51415     ns notNil ifTrue:[nsName := ns name].
 51423     ns notNil ifTrue:[nsName := ns name].
 51416     (namespaces includes:nsName) ifFalse:[
 51424     (namespaces includes:nsName) ifFalse:[
 51417 	(namespaces includes:(NavigatorModel nameListEntryForALL)) ifFalse:[
 51425         (namespaces includes:(NavigatorModel nameListEntryForALL)) ifFalse:[
 51418 	    self selectedNamespaces value:(OrderedCollection with: NavigatorModel nameListEntryForALL)
 51426             self selectedNamespaces value:(OrderedCollection with: NavigatorModel nameListEntryForALL)
 51419 	]
 51427         ]
 51420     ].
 51428     ].
 51421 "/    namespaces := self nameSpaceFilter value ? #().
 51429 "/    namespaces := self nameSpaceFilter value ? #().
 51422 "/    (namespaces includes:aClass nameSpace name) ifFalse:[
 51430 "/    (namespaces includes:aClass nameSpace name) ifFalse:[
 51423 "/        (namespaces includes:(NavigatorModel nameListEntryForALL)) ifFalse:[
 51431 "/        (namespaces includes:(NavigatorModel nameListEntryForALL)) ifFalse:[
 51424 "/            self nameSpaceFilter value:(OrderedCollection with: NavigatorModel nameListEntryForALL)
 51432 "/            self nameSpaceFilter value:(OrderedCollection with: NavigatorModel nameListEntryForALL)
 51425 "/        ]
 51433 "/        ]
 51426 "/    ].
 51434 "/    ].
 51427     orgMode == OrganizerCanvas organizerModeCategory ifTrue:[
 51435     orgMode == OrganizerCanvas organizerModeCategory ifTrue:[
 51428 	cat := aClass category ? '* no category *'.
 51436         cat := aClass category ? '* no category *'.
 51429 	(self selectedCategoriesValue includes:cat) ifFalse:[
 51437         (self selectedCategoriesValue includes:cat) ifFalse:[
 51430 	    self selectedCategories value:(OrderedCollection with:cat).
 51438             self selectedCategories value:(OrderedCollection with:cat).
 51431 	]
 51439         ]
 51432     ] ifFalse:[ orgMode == OrganizerCanvas organizerModeNamespace ifTrue:[
 51440     ] ifFalse:[ orgMode == OrganizerCanvas organizerModeNamespace ifTrue:[
 51433 	aClass isNameSpace ifTrue:[
 51441         aClass isNameSpace ifTrue:[
 51434 	    nsName := aClass name.
 51442             nsName := aClass name.
 51435 	] ifFalse:[
 51443         ] ifFalse:[
 51436 	    nsName := aClass nameSpace name.
 51444             nsName := aClass nameSpace name.
 51437 	].
 51445         ].
 51438 	(self selectedNamespacesValue includes:nsName) ifFalse:[
 51446         (self selectedNamespacesValue includes:nsName) ifFalse:[
 51439 	    self selectedNamespaces value:(OrderedCollection with:nsName).
 51447             self selectedNamespaces value:(OrderedCollection with:nsName).
 51440 	]
 51448         ]
 51441     ] ifFalse:[ orgMode == OrganizerCanvas organizerModeProject ifTrue:[
 51449     ] ifFalse:[ orgMode == OrganizerCanvas organizerModeProject ifTrue:[
 51442 	pkg := aClass package.
 51450         pkg := aClass package.
 51443 	holder := self selectedProjects.
 51451         holder := self selectedProjects.
 51444 	newValue := holder value ? #().
 51452         newValue := holder value ? #().
 51445 	(newValue includes:pkg) ifFalse:[
 51453         (newValue includes:pkg) ifFalse:[
 51446 	    newValue := OrderedCollection with:pkg.
 51454             newValue := OrderedCollection with:pkg.
 51447 	].
 51455         ].
 51448 	mthd notNil ifTrue:[
 51456         mthd notNil ifTrue:[
 51449 	    "/ careful - the method could be in an extension ...
 51457             "/ careful - the method could be in an extension ...
 51450 	    mthd package ~= pkg ifTrue:[
 51458             mthd package ~= pkg ifTrue:[
 51451 		(newValue includes:mthd package) ifFalse:[
 51459                 (newValue includes:mthd package) ifFalse:[
 51452 		    newValue := newValue asOrderedCollection.
 51460                     newValue := newValue asOrderedCollection.
 51453 		    newValue add:mthd package.
 51461                     newValue add:mthd package.
 51454 		].
 51462                 ].
 51455 	    ].
 51463             ].
 51456 	].
 51464         ].
 51457 	newValue ~= holder value ifTrue:[
 51465         newValue ~= holder value ifTrue:[
 51458 	    holder value:newValue.
 51466             holder value:newValue.
 51459 	].
 51467         ].
 51460     ] ifFalse:[ (orgMode == OrganizerCanvas organizerModeClassHierarchy
 51468     ] ifFalse:[ (orgMode == OrganizerCanvas organizerModeClassHierarchy
 51461 		 or:[orgMode == OrganizerCanvas organizerModeClassInheritance]) ifTrue:[
 51469                  or:[orgMode == OrganizerCanvas organizerModeClassInheritance]) ifTrue:[
 51462 	"/ make sure, that the class is in the hierarchy;
 51470         "/ make sure, that the class is in the hierarchy;
 51463 	"/ if required, update the hierarchy.
 51471         "/ if required, update the hierarchy.
 51464 
 51472 
 51465 	holder := self classHierarchyTopClass.
 51473         holder := self classHierarchyTopClass.
 51466 	cls := holder value.
 51474         cls := holder value.
 51467 	(cls isNil or:[(cls withAllSuperclasses includesIdentical:aClass) not]) ifTrue:[
 51475         (cls isNil or:[(cls withAllSuperclasses includesIdentical:aClass) not]) ifTrue:[
 51468 	    holder value:aClass.
 51476             holder value:aClass.
 51469 	].
 51477         ].
 51470 	doSwitchMeta := false.
 51478         doSwitchMeta := false.
 51471     ]]]].
 51479     ]]]].
 51472 
 51480 
 51473     doSwitchMeta ifTrue:[
 51481     doSwitchMeta ifTrue:[
 51474 	self meta value:(aClass isMeta).
 51482         self meta value:(aClass isMeta).
 51475     ].
 51483     ].
 51476 
 51484 
 51477     (self selectedClassesValue includesIdentical:aClass) ifFalse:[
 51485     (self selectedClassesValue includesIdentical:aClass) ifFalse:[
 51478 	self selectedClasses value:(OrderedCollection with:aClass).
 51486         self selectedClasses value:(OrderedCollection with:aClass).
 51479     ].
 51487     ].
 51480 
 51488 
 51481     mthd notNil ifTrue:[
 51489     mthd notNil ifTrue:[
 51482 	(self selectedProtocolsValue contains:[:cat | cat string = mthd category]) ifFalse:[
 51490 
 51483 	    self selectProtocols:(OrderedCollection with:mthd category).
 51491         (self selectedProtocolsValue contains:[:cat | (cat isNil and:[mthd category isNil]) or:[cat string = mthd category]]) ifFalse:[
 51484 	].
 51492             self selectProtocols:(OrderedCollection with:mthd category).
 51485 	self switchToMethod:mthd.
 51493         ].
       
 51494         self switchToMethod:mthd.
 51486     ] ifFalse:[
 51495     ] ifFalse:[
 51487 	self switchToSelector:aSelector.
 51496         self switchToSelector:aSelector.
 51488     ].
 51497     ].
 51489 
 51498 
 51490     self immediateUpdate value:false.
 51499     self immediateUpdate value:false.
 51491 
 51500 
 51492     updateHistory ifTrue:[
 51501     updateHistory ifTrue:[
 51493 	self addToHistory:aClass selector:aSelector
 51502         self addToHistory:aClass selector:aSelector
 51494     ].
 51503     ].
 51495 
 51504 
 51496     self normalLabel.
 51505     self normalLabel.
 51497 
 51506 
 51498     "/ self selectedMethods value:nil.
 51507     "/ self selectedMethods value:nil.
 51499     self enqueueDelayedClassSelectionChange.
 51508     self enqueueDelayedClassSelectionChange.
 51500 
 51509 
 51501     "Created: / 22-02-2008 / 09:05:51 / janfrog"
 51510     "Created: / 22-02-2008 / 09:05:51 / janfrog"
 51502     "Modified: / 27-02-2008 / 16:45:21 / janfrog"
 51511     "Modified: / 27-02-2008 / 16:45:21 / janfrog"
 51503     "Modified: / 28-02-2012 / 16:53:17 / cg"
 51512     "Modified: / 28-02-2012 / 16:53:17 / cg"
       
 51513     "Modified: / 10-09-2013 / 14:59:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 51504 !
 51514 !
 51505 
 51515 
 51506 switchToClassNameMatching:aMatchString
 51516 switchToClassNameMatching:aMatchString
 51507     |className class|
 51517     |className class|
 51508 
 51518 
 51719 
 51729 
 51720 switchToSelector:aSelector
 51730 switchToSelector:aSelector
 51721     |mthd cls orgMode pkg holder|
 51731     |mthd cls orgMode pkg holder|
 51722 
 51732 
 51723     aSelector notNil ifTrue:[
 51733     aSelector notNil ifTrue:[
 51724 	(cls := self theSingleSelectedClass) notNil ifTrue:[
 51734         (cls := self theSingleSelectedClass) notNil ifTrue:[
 51725 	    mthd := cls compiledMethodAt:aSelector asSymbol.
 51735             mthd := cls compiledMethodAt:aSelector asSymbol.
 51726 	    mthd notNil ifTrue:[
 51736             mthd notNil ifTrue:[
 51727 
 51737 
 51728 		"/ care for method being in another package
 51738                 "/ care for method being in another package
 51729 		orgMode := self organizerMode value.
 51739                 orgMode := self organizerMode value.
 51730 		orgMode == OrganizerCanvas organizerModeProject ifTrue:[
 51740                 orgMode == OrganizerCanvas organizerModeProject ifTrue:[
 51731 		    pkg := mthd package.
 51741                     pkg := mthd package.
 51732 		    holder := self selectedProjects.
 51742                     holder := self selectedProjects.
 51733 		    ((holder value ? #()) includes:pkg) ifFalse:[
 51743                     ((holder value ? #()) includes:pkg) ifFalse:[
 51734 			holder value:(Array with:pkg).
 51744                         holder value:(Array with:pkg).
 51735 		    ]
 51745                     ]
 51736 		].
 51746                 ].
 51737 
 51747 
 51738 		(self selectedProtocolsValue contains:[:p | p string = mthd category]) ifFalse:[
 51748                 (self selectedProtocolsValue contains:[:p | (p isNil and:[mthd category isNil]) or:[p string = mthd category]]) ifFalse:[
 51739 		    (self selectedProtocolsValue includes:BrowserList nameListEntryForALL) ifFalse:[
 51749                     (self selectedProtocolsValue includes:BrowserList nameListEntryForALL) ifFalse:[
 51740 			self selectProtocols:(Array with:mthd category).
 51750                         self selectProtocols:(Array with:mthd category).
 51741 		    ]
 51751                     ]
 51742 		].
 51752                 ].
 51743 		self theSingleSelectedMethod ~~ mthd ifTrue:[
 51753                 self theSingleSelectedMethod ~~ mthd ifTrue:[
 51744 		    self selectedMethods value:(Array with:mthd).
 51754                     self selectedMethods value:(Array with:mthd).
 51745 		]
 51755                 ]
 51746 	    ]
 51756             ]
 51747 	]
 51757         ]
 51748     ].
 51758     ].
 51749 
 51759 
 51750     "Created: / 4.2.2000 / 23:20:34 / cg"
 51760     "Created: / 04-02-2000 / 23:20:34 / cg"
 51751     "Modified: / 5.2.2000 / 23:07:10 / cg"
 51761     "Modified: / 05-02-2000 / 23:07:10 / cg"
       
 51762     "Modified: / 10-09-2013 / 14:58:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 51752 ! !
 51763 ! !
 51753 
 51764 
 51754 !NewSystemBrowser methodsFor:'private-buffers'!
 51765 !NewSystemBrowser methodsFor:'private-buffers'!
 51755 
 51766 
 51756 removeBuffer:nr
 51767 removeBuffer:nr
 52039     |s|
 52050     |s|
 52040 
 52051 
 52041     s := '' writeStream.
 52052     s := '' writeStream.
 52042 
 52053 
 52043     (aClass isRealNameSpace) ifTrue:[
 52054     (aClass isRealNameSpace) ifTrue:[
 52044 	aClass fileOutDefinitionOn:s
 52055         aClass fileOutDefinitionOn:s
 52045     ] ifFalse:[
 52056     ] ifFalse:[
 52046 	aClass theNonMetaclass isJavaClass ifTrue:[
 52057         aClass theNonMetaclass isJavaClass ifTrue:[
 52047 	    | src |
 52058             | src |
 52048 	    src := aClass theNonMetaclass source.
 52059             src := aClass theNonMetaclass source.
 52049 	    src notNil ifTrue:[ ^ src ].
 52060             src notNil ifTrue:[ ^ src ].
 52050 	    s nextPutLine: '// *** WARNING ***'.
 52061             s nextPutLine: '// *** WARNING ***'.
 52051 	    s nextPutLine: '// Following code has been decompiled from loaded class'.
 52062             s nextPutLine: '// Following code has been decompiled from loaded class'.
 52052 	    s nextPutLine: '// *** WARNING ***'.
 52063             s nextPutLine: '// *** WARNING ***'.
 52053 	    s cr.
 52064             s cr.
 52054 	    aClass fileOutDefinitionOn:s
 52065             aClass theNonMetaclass fileOutDefinitionOn:s
 52055 	] ifFalse:[
 52066         ] ifFalse:[
 52056 	    aClass isMeta ifTrue:[
 52067             aClass isMeta ifTrue:[
 52057 		aClass
 52068                 aClass
 52058 		    fileOutClassInstVarDefinitionOn:s
 52069                     fileOutClassInstVarDefinitionOn:s
 52059 		    withNameSpace:true.
 52070                     withNameSpace:true.
 52060 	    ] ifFalse:[
 52071             ] ifFalse:[
 52061 		"/
 52072                 "/
 52062 		"/ here, show it with a nameSpace pragma
 52073                 "/ here, show it with a nameSpace pragma
 52063 		"/ and prefer short names.
 52074                 "/ and prefer short names.
 52064 		"/
 52075                 "/
 52065 		aClass
 52076                 aClass
 52066 		    basicFileOutDefinitionOn:s
 52077                     basicFileOutDefinitionOn:s
 52067 		    withNameSpace:true
 52078                     withNameSpace:true
 52068 		    withPackage:false
 52079                     withPackage:false
 52069 	    ].
 52080             ].
 52070 	].
 52081         ].
 52071     ].
 52082     ].
 52072 
 52083 
 52073     ^ s contents withTabsExpanded.
 52084     ^ s contents withTabsExpanded.
 52074 
 52085 
 52075     "Modified: / 10-11-2006 / 17:13:54 / cg"
 52086     "Modified: / 10-11-2006 / 17:13:54 / cg"
 52076     "Modified: / 30-03-2012 / 20:08:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52087     "Modified: / 10-09-2013 / 01:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52077 !
 52088 !
 52078 
 52089 
 52079 commentOrDocumentationStringFromClass:aClass
 52090 commentOrDocumentationStringFromClass:aClass
 52080     "the classes documentation-method's comment, or nil"
 52091     "the classes documentation-method's comment, or nil"
 52081 
 52092 
 52366 
 52377 
 52367         "
 52378         "
 52368          add documentation as a comment, if there is any
 52379          add documentation as a comment, if there is any
 52369         "
 52380         "
 52370         info := self commentOrDocumentationStringFromClass:aClass.
 52381         info := self commentOrDocumentationStringFromClass:aClass.
 52371         text := definition.
       
 52372         info notNil ifTrue:[
 52382         info notNil ifTrue:[
 52373             text := text,(Character cr),info.
 52383             text := definition,(Character cr),info.
 52374         ].
 52384         ].
 52375         self codeHolder setValue:text.
 52385         self codeHolder setValue:text.
 52376         self codeView notNil ifTrue:[
 52386         self codeView notNil ifTrue:[
 52377             self codeView setContents:text
 52387             self codeView setContents:text
 52378         ].
 52388         ].
 52379     ].
 52389     ].
 52380     self updatePackageInfoForClass:aClass.
 52390     self updatePackageInfoForClass:aClass.
 52381 
 52391 
 52382     "Modified: / 27-07-2012 / 22:26:12 / cg"
 52392     "Modified: / 27-07-2012 / 22:26:12 / cg"
 52383     "Modified: / 05-07-2012 / 21:41:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52393     "Modified: / 10-09-2013 / 01:34:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52384     "Modified (format): / 10-09-2013 / 01:34:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
 52385 !
 52394 !
 52386 
 52395 
 52387 showClassDocumentation
 52396 showClassDocumentation
 52388     |cls text|
 52397     |cls text|
 52389 
 52398 
 52748     self showInfo:text.
 52757     self showInfo:text.
 52749 !
 52758 !
 52750 
 52759 
 52751 showCode:aString
 52760 showCode:aString
 52752 
 52761 
 52753     "No, do not scroll to the top if the code is already displayed!!"
 52762     "/Do not scroll to the top if the code is already displayed!!"
 52754     self showCode:aString scrollToTop:(self codeView contents string ~= aString)
 52763     self showCode:aString scrollToTop:(self codeView contents string ~= aString)
 52755 
 52764 
 52756     "Modified: / 01-03-2000 / 11:38:33 / cg"
 52765     "Modified: / 01-03-2000 / 11:38:33 / cg"
 52757     "Modified: / 04-08-2013 / 11:44:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52766     "Modified: / 10-09-2013 / 01:33:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52758 !
 52767 !
 52759 
 52768 
 52760 showCode:codeString scrollToTop:doScrollToTop
 52769 showCode:codeString scrollToTop:doScrollToTop
 52761     |codeView code shownCode prevCode|
 52770     |codeView code shownCode prevCode|
 52762 
 52771 
 52844 
 52853 
 52845 showMethodsCode:mthd scrollToTop:doScrollToTop
 52854 showMethodsCode:mthd scrollToTop:doScrollToTop
 52846     |code codeView doAutoFormat doSyntaxColoring doUpdateCode prevMthd doShowFullClassSource |
 52855     |code codeView doAutoFormat doSyntaxColoring doUpdateCode prevMthd doShowFullClassSource |
 52847 
 52856 
 52848     doAutoFormat := self doAutoFormat value and:[RBFormatter notNil].
 52857     doAutoFormat := self doAutoFormat value and:[RBFormatter notNil].
 52849     doShowFullClassSource := self navigationState isFullClassSourceBrowser or:[mthd isJavaMethod and:[JavaMethod showFullSource]].
 52858     doShowFullClassSource := self navigationState isFullClassSourceBrowser
       
 52859                                 or:[mthd isJavaMethod].
 52850     doUpdateCode := true.
 52860     doUpdateCode := true.
 52851     codeView := self codeView.
 52861     codeView := self codeView.
 52852     self assert:codeView notNil.
 52862     self assert:codeView notNil.
 52853 
 52863 
 52854     code := self sourceOfMethod:mthd.
 52864     code := self sourceOfMethod:mthd.
 52855     code isText ifTrue:[
 52865     code isText ifTrue:[
       
 52866         "/Already done...
 52856         doSyntaxColoring := false.
 52867         doSyntaxColoring := false.
 52857     ] ifFalse:[
 52868     ] ifFalse:[
 52858         "/Do no coloring here if CodeView2 is used,
 52869         "/Do no coloring here if CodeView2 is used,
 52859         "/since CodeView2 itself cares about the coloring!!
 52870         "/since CodeView2 itself cares about the coloring!!
 52860         "/Not working correctly -> do the coloring until fixed in CodeView2
 52871         "/Not working correctly -> do the coloring until fixed in CodeView2
 52861         "JV: Enable is, otherwise I won't notice that it does not work
 52872         "/JV: Then make a bug report because otherwise it won't be
 52862          correctly!!"
 52873         "/    ever fixed.
 52863         (UserPreferences current useCodeView2In: #Browser) ifTrue:[
 52874         "(UserPreferences current useCodeView2In: #Browser)"false ifTrue:[
 52864             doSyntaxColoring := code size < 2000
 52875             doSyntaxColoring := code size < 2000
 52865         ] ifFalse:[
 52876         ] ifFalse:[
 52866             doSyntaxColoring := self doSyntaxColoring value == true.
 52877             doSyntaxColoring := self doSyntaxColoring value == true.
 52867         ].
 52878         ].
 52868     ].
 52879     ].
 52883         mthd isSynthetic not ifTrue:[
 52894         mthd isSynthetic not ifTrue:[
 52884             prevMthd := navigationState lastMethodShownInCodeView.
 52895             prevMthd := navigationState lastMethodShownInCodeView.
 52885             prevMthd notNil ifTrue:[
 52896             prevMthd notNil ifTrue:[
 52886                 doUpdateCode := prevMthd isSynthetic or:[mthd mclass ~~ prevMthd mclass]
 52897                 doUpdateCode := prevMthd isSynthetic or:[mthd mclass ~~ prevMthd mclass]
 52887             ].
 52898             ].
       
 52899 
       
 52900 
 52888         ].
 52901         ].
 52889     ].
 52902     ].
 52890     doUpdateCode ifTrue:[
 52903     doUpdateCode ifTrue:[
 52891         doSyntaxColoring ifTrue:[
 52904         doSyntaxColoring ifTrue:[
 52892             "/ immediate coloring, if code is not too large;
 52905             "/ immediate coloring, if code is not too large;
 52913         ].
 52926         ].
 52914     ].
 52927     ].
 52915     navigationState lastMethodShownInCodeView: mthd.
 52928     navigationState lastMethodShownInCodeView: mthd.
 52916 
 52929 
 52917     "/ scroll, for file-based classes (java, ruby, etc.)
 52930     "/ scroll, for file-based classes (java, ruby, etc.)
 52918     mthd sourceLineNumber ~~ 1 ifTrue:[
 52931     doShowFullClassSource ifTrue:[
 52919         doScrollToTop ifTrue:[
 52932         mthd sourceLineNumber ~~ 1 ifTrue:[
 52920             codeView scrollToLine:mthd sourceLineNumber.
 52933             doScrollToTop "ifTrue:" ifFalse:[
       
 52934                 codeView scrollToLine:mthd sourceLineNumber
       
 52935             ]
 52921         ].
 52936         ].
 52922     ].
 52937     ].
 52923 
       
 52924     self codeAspect:(code ifNil:[nil] ifNotNil:[SyntaxHighlighter codeAspectMethod]).
 52938     self codeAspect:(code ifNil:[nil] ifNotNil:[SyntaxHighlighter codeAspectMethod]).
 52925     self normalLabel.
 52939     self normalLabel.
 52926     self updatePackageInfoForMethod:mthd.
 52940     self updatePackageInfoForMethod:mthd.
 52927 
 52941 
 52928     "Created: / 01-03-2000 / 11:38:57 / cg"
 52942     "Created: / 01-03-2000 / 11:38:57 / cg"
 52929     "Modified: / 27-07-2012 / 22:18:18 / cg"
 52943     "Modified: / 27-07-2012 / 22:18:18 / cg"
 52930     "Modified: / 14-09-2013 / 13:22:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52944     "Modified: / 10-09-2013 / 01:29:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 52931 !
 52945 !
 52932 
 52946 
 52933 showNothing
 52947 showNothing
 52934     self setAcceptActionForNothing.
 52948     self setAcceptActionForNothing.
 52935     self showCode:nil.
 52949     self showCode:nil.
 53628 	].
 53642 	].
 53629 	(what at:2) size ~~ 1 ifTrue:[
 53643 	(what at:2) size ~~ 1 ifTrue:[
 53630 	    self builder window beep
 53644 	    self builder window beep
 53631 	].
 53645 	].
 53632     ].
 53646     ].
       
 53647     box enterField 
       
 53648         onKey:#CursorDown 
       
 53649         leaveWith:[ 
       
 53650             box listView windowGroup focusView:box listView byTab:true.
       
 53651             box listView hasSelection ifFalse:[
       
 53652                 box listView selectFirst
       
 53653             ] ifTrue:[
       
 53654                 box listView selectNext
       
 53655             ]
       
 53656         ].
 53633     box open.
 53657     box open.
 53634     ^ retVal
 53658     ^ retVal
 53635 
 53659 
 53636     "Created: / 29.2.2000 / 10:53:09 / cg"
 53660     "Created: / 29.2.2000 / 10:53:09 / cg"
 53637 !
 53661 !
 55330 
 55354 
 55331 projectListApp
 55355 projectListApp
 55332     ^ navigationState projectListApplication
 55356     ^ navigationState projectListApplication
 55333 ! !
 55357 ! !
 55334 
 55358 
 55335 
       
 55336 !NewSystemBrowser methodsFor:'private-history'!
 55359 !NewSystemBrowser methodsFor:'private-history'!
 55337 
 55360 
 55338 lastSearchPatterns
 55361 lastSearchPatterns
 55339     ^ self class lastSearchPatterns
 55362     ^ self class lastSearchPatterns
 55340 !
 55363 !
 55569 !
 55592 !
 55570 
 55593 
 55571 explainInCode:code short:short withTimeout:withTimeout
 55594 explainInCode:code short:short withTimeout:withTimeout
 55572     "explain the selection or, if there is none, the node under the cursor"
 55595     "explain the selection or, if there is none, the node under the cursor"
 55573 
 55596 
 55574     |explanation explainTookTooLong|
 55597     |explanation explainTookTooLong html|
 55575 
 55598 
 55576     explainTookTooLong := false.
 55599     explainTookTooLong := false.
 55577     withTimeout ifTrue:[
 55600     withTimeout ifTrue:[
 55578 	explanation :=
 55601         explanation :=
 55579 	    [ self explanationForCode:code short:short ]
 55602             [ self explanationForCode:code short:short ]
 55580 		    valueWithWatchDog:[explainTookTooLong := true]
 55603                     valueWithWatchDog:[explainTookTooLong := true]
 55581 		    afterMilliseconds:200.
 55604                     afterMilliseconds:200.
 55582     ] ifFalse:[
 55605     ] ifFalse:[
 55583 	explanation := self explanationForCode:code short:short
 55606         explanation := self explanationForCode:code short:short
 55584     ].
 55607     ].
 55585 
 55608 
 55586     self activityNotification:nil.
 55609     self activityNotification:nil.
 55587     explainTookTooLong ifTrue:[
 55610     explainTookTooLong ifTrue:[
 55588 	self showInfo:'Explain took too long - cancelled.'.
 55611         self showInfo:'Explain took too long - cancelled.'.
 55589 	^ self.
 55612         ^ self.
 55590     ].
 55613     ].
 55591 
 55614 
 55592     explanation notEmptyOrNil ifTrue:[
 55615     explanation notEmptyOrNil ifTrue:[
 55593 	short ifTrue:[
 55616         short ifTrue:[
 55594 	    self showInfo:explanation
 55617             self showInfo:explanation
 55595 	] ifFalse:[
 55618         ] ifFalse:[
 55596 	    self information:explanation
 55619             explanation isArray ifTrue:[
 55597 	].
 55620                 html := explanation detect:[:entry | entry key == #html] ifNone:nil.
 55598 	builder window flush
 55621                 html notNil ifTrue:[
       
 55622                     "/ todo: need a stripped down viewer (small, popup, modal)
       
 55623                     HTMLDocumentView openFullOnText:(html value).
       
 55624                     ^ self.
       
 55625                 ].
       
 55626                 explanation := explanation first value.
       
 55627             ].
       
 55628             self information:explanation
       
 55629         ].
       
 55630         builder window flush
 55599     ].
 55631     ].
 55600 
 55632 
 55601     "Created: / 05-09-2006 / 10:37:04 / cg"
 55633     "Created: / 05-09-2006 / 10:37:04 / cg"
 55602 !
 55634 !
 55603 
 55635 
 60764 ! !
 60796 ! !
 60765 
 60797 
 60766 !NewSystemBrowser class methodsFor:'documentation'!
 60798 !NewSystemBrowser class methodsFor:'documentation'!
 60767 
 60799 
 60768 version
 60800 version
 60769     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60801     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1984 2013-09-16 15:12:57 cg Exp $'
 60770 !
 60802 !
 60771 
 60803 
 60772 version_CVS
 60804 version_CVS
 60773     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60805     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1984 2013-09-16 15:12:57 cg Exp $'
 60774 !
 60806 !
 60775 
 60807 
 60776 version_HG
 60808 version_HG
 60777 
 60809 
 60778     ^ '$Changeset: <not expanded> $'
 60810     ^ '$Changeset: <not expanded> $'
 60779 !
 60811 !
 60780 
 60812 
 60781 version_SVN
 60813 version_SVN
 60782     ^ '$Id: Tools__NewSystemBrowser.st,v 1.1975 2013-09-05 22:48:24 cg Exp $'
 60814     ^ '$Id: Tools__NewSystemBrowser.st,v 1.1984 2013-09-16 15:12:57 cg Exp $'
 60783 ! !
 60815 ! !
 60784 
 60816 
 60785 
 60817 
 60786 NewSystemBrowser initialize!
 60818 NewSystemBrowser initialize!