Tools__SearchDialog.st
changeset 16690 99e111fd8e17
parent 16463 06f1e610b85a
child 16694 715f1da6f138
child 16920 6411ac77e0d1
equal deleted inserted replaced
16688:2371bdab3d4c 16690:99e111fd8e17
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 2000 by eXept Software AG
     4  COPYRIGHT (c) 2000 by eXept Software AG
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
    21 		codeField selectorHolder defaultOpenHow withTextEntry allowFind
    23 		codeField selectorHolder defaultOpenHow withTextEntry allowFind
    22 		allowBuffer allowBrowser searchWhat searchClassProtocolHolder
    24 		allowBuffer allowBrowser searchWhat searchClassProtocolHolder
    23 		searchInstanceProtocolHolder selectorOrCode selectionList
    25 		searchInstanceProtocolHolder selectorOrCode selectionList
    24 		listHolder matchProcess inputField showMetaFilter
    26 		listHolder matchProcess inputField showMetaFilter
    25 		metaclassesOnlyHolder classesOnlyHolder initialText
    27 		metaclassesOnlyHolder classesOnlyHolder initialText
    26 		withSearchStringInLiterals searchStringInLiteralsHolder'
    28 		withSearchStringInLiterals searchStringInLiteralsHolder
       
    29 		searchFreeStandingWordsOnlyHolder withSearchFreeStandingWordsOnly'
    27 	classVariableNames:'LastCodeSearched LastCodeSearchWasMethod LastGlobalSearched
    30 	classVariableNames:'LastCodeSearched LastCodeSearchWasMethod LastGlobalSearched
    28 		LastStringSearched LastSearchWasMatch LastSearchWasCaseSensitive
    31 		LastStringSearched LastSearchWasMatch LastSearchWasCaseSensitive
    29 		LastStringSearchArea LastCodeSearchArea AREA_LISTOFMETHODS
    32 		LastStringSearchArea LastCodeSearchArea AREA_LISTOFMETHODS
    30 		LastResourceSearched'
    33 		LastResourceSearched'
    31 	poolDictionaries:''
    34 	poolDictionaries:''
   147 'Search only in class methods (meta classes)'
   150 'Search only in class methods (meta classes)'
   148 
   151 
   149 #searchStringInLiterals
   152 #searchStringInLiterals
   150 'Search string in literal constants; not in source code'
   153 'Search string in literal constants; not in source code'
   151 
   154 
       
   155 #searchFreeStandingWordsOnly
       
   156 'Search for free-standing words only (i.e. not substrings)'
       
   157 
   152 #match
   158 #match
   153 'Perform a pattern match search, as opposed to an exact string search.\Pattern is a simple GLOB pattern (as in filenames)'
   159 'Perform a pattern match search, as opposed to an exact string search.\Pattern is a simple GLOB pattern (as in filenames)'
   154 
   160 
   155 #caseSensitive
   161 #caseSensitive
   156 'Perform a case sensitive search (default is to ignore case differences)'
   162 'Perform a case sensitive search (default is to ignore case differences)'
   183 
   189 
   184 showMetaFilter:aBoolean
   190 showMetaFilter:aBoolean
   185     "enable another checkbox, to allow searching in meta/non-meta"
   191     "enable another checkbox, to allow searching in meta/non-meta"
   186 
   192 
   187     showMetaFilter := aBoolean.
   193     showMetaFilter := aBoolean.
       
   194 !
       
   195 
       
   196 withSearchFreeStandingWordsOnly:aBoolean
       
   197     "enable another checkbox, to allow searching for full words only"
       
   198      
       
   199     withSearchFreeStandingWordsOnly := aBoolean.
   188 !
   200 !
   189 
   201 
   190 withSearchStringInLiterals:aBoolean
   202 withSearchStringInLiterals:aBoolean
   191     "enable another checkbox, to allow searching for a string
   203     "enable another checkbox, to allow searching for a string
   192      in the literals only"
   204      in the literals only"
   240 searchAreaSelected
   252 searchAreaSelected
   241     "the value of the corresponding radio button;
   253     "the value of the corresponding radio button;
   242      a symbol describing where to search"
   254      a symbol describing where to search"
   243 
   255 
   244     ^ whereRadioGroup value.
   256     ^ whereRadioGroup value.
       
   257 !
       
   258 
       
   259 searchFreeStandingWordsOnly
       
   260     "the value of the corresponding check toggle;
       
   261      if on, only free standing words match - i.e. the searched word
       
   262      may not be part of a longer word"
       
   263      
       
   264     ^ searchFreeStandingWordsOnlyHolder value ? false.
   245 !
   265 !
   246 
   266 
   247 searchIgnoringCase
   267 searchIgnoringCase
   248     ^ self searchIsCaseSensitive not
   268     ^ self searchIsCaseSensitive not
   249 !
   269 !
   577     ].
   597     ].
   578     (withSearchStringInLiterals ? false) ifTrue:[    
   598     (withSearchStringInLiterals ? false) ifTrue:[    
   579         currentPanel := self.
   599         currentPanel := self.
   580         self addCheckBoxForSearchInLiteralsOnly
   600         self addCheckBoxForSearchInLiteralsOnly
   581     ].
   601     ].
       
   602     (withSearchFreeStandingWordsOnly ? false) ifTrue:[    
       
   603         currentPanel := self.
       
   604         self addCheckBoxForSearchFreeStandingWordsOnly
       
   605     ].
   582     
   606     
   583     self addHorizontalLine.
   607     self addHorizontalLine.
   584 
   608 
   585     hPanel := HorizontalPanelView "SimpleView" new.
   609     hPanel := HorizontalPanelView "SimpleView" new.
   586     hPanel verticalLayout:#top.
   610     hPanel verticalLayout:#top.
   953     self addCheckBox:b forSearchArea:#ownersHierarchiesWithPrivateClasses.
   977     self addCheckBox:b forSearchArea:#ownersHierarchiesWithPrivateClasses.
   954     (selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ 
   978     (selectedClasses contains:[ :cls | cls isPrivate. ]) ifFalse:[ 
   955         b disable.
   979         b disable.
   956     ].
   980     ].
   957     ^ b.
   981     ^ b.
       
   982 !
       
   983 
       
   984 addCheckBoxForSearchFreeStandingWordsOnly
       
   985     |p b|
       
   986 
       
   987     p := View new.
       
   988     
       
   989     b := CheckBox label:(resources string:'Search Free Standing Words Only') in:p.
       
   990     b model:(searchFreeStandingWordsOnlyHolder := false asValue).
       
   991     p helpKey:#searchFreeStandingWordsOnly.
       
   992     self makeTabable:b.
       
   993 
       
   994     currentPanel add:p.
       
   995     ^ nil.
   958 !
   996 !
   959 
   997 
   960 addCheckBoxForSearchInLiteralsOnly
   998 addCheckBoxForSearchInLiteralsOnly
   961     |p b|
   999     |p b|
   962 
  1000