Tools__StringSearchToolForTextView.st
changeset 8062 3b38e4e4d786
parent 8060 e9ff9acc34ff
child 8064 9d91d0d69b09
equal deleted inserted replaced
8061:4efeccdc0f1d 8062:3b38e4e4d786
    57                     model: hideSearchBar
    57                     model: hideSearchBar
    58                   )
    58                   )
    59                  (LabelSpec
    59                  (LabelSpec
    60                     label: 'Search:'
    60                     label: 'Search:'
    61                     name: 'SearchLabel'
    61                     name: 'SearchLabel'
    62                     layout: (LayoutFrame 23 0 1 0 76 0 23 0)
    62                     layout: (LayoutFrame 23 0 1 0 71 0 23 0)
    63                     translateLabel: true
    63                     translateLabel: true
    64                     adjust: right
    64                     adjust: right
    65                   )
    65                   )
    66                  (InputFieldSpec
    66                  (InputFieldSpec
    67                     name: 'SearchEntryField'
    67                     name: 'SearchEntryField'
    68                     layout: (LayoutFrame 82 0 1 0 278 0 23 0)
    68                     layout: (LayoutFrame 72 0 1 0 253 0 23 0)
    69                     model: searchTextHolder
    69                     model: searchTextHolder
    70                     immediateAccept: true
    70                     immediateAccept: true
    71                     acceptOnReturn: true
    71                     acceptOnReturn: true
    72                     acceptOnTab: true
    72                     acceptOnTab: true
    73                     acceptOnLostFocus: true
    73                     acceptOnLostFocus: true
    76                     postBuildCallback: postBuildSearchTextView:
    76                     postBuildCallback: postBuildSearchTextView:
    77                   )
    77                   )
    78                  (ActionButtonSpec
    78                  (ActionButtonSpec
    79                     label: 'searchNextIcon'
    79                     label: 'searchNextIcon'
    80                     name: 'SearchNextButton'
    80                     name: 'SearchNextButton'
    81                     layout: (LayoutFrame 284 0 2 0 305 0 23 0)
    81                     layout: (LayoutFrame 258 0 2 0 279 0 23 0)
    82                     hasCharacterOrientedLabel: false
    82                     hasCharacterOrientedLabel: false
    83                     translateLabel: true
    83                     translateLabel: true
    84                     model: searchNextText
    84                     model: searchNextText
    85                   )
    85                   )
    86                  (ActionButtonSpec
    86                  (ActionButtonSpec
    87                     label: 'searchPreviousIcon'
    87                     label: 'searchPreviousIcon'
    88                     name: 'searchPreviousButton'
    88                     name: 'searchPreviousButton'
    89                     layout: (LayoutFrame 312 0 2 0 333 0 23 0)
    89                     layout: (LayoutFrame 286 0 2 0 307 0 23 0)
    90                     hasCharacterOrientedLabel: false
    90                     hasCharacterOrientedLabel: false
    91                     translateLabel: true
    91                     translateLabel: true
    92                     model: searchPreviousText
    92                     model: searchPreviousText
    93                   )
    93                   )
    94                  (CheckBoxSpec
    94                  (CheckBoxSpec
    95                     label: 'Ignore case'
    95                     label: 'Ignore case'
    96                     name: 'IgnoreCaseCheckBox'
    96                     name: 'IgnoreCaseCheckBox'
    97                     layout: (LayoutFrame 338 0 1 0 428 0 23 0)
    97                     layout: (LayoutFrame 312 0 1 0 424 0 23 0)
    98                     model: ignoreCaseHolder
    98                     model: ignoreCaseHolder
    99                     translateLabel: true
    99                     translateLabel: true
   100                   )
   100                   )
   101                  (CheckBoxSpec
   101                  (CheckBoxSpec
   102                     label: 'Match'
   102                     label: 'Match'
   103                     name: 'MatchCheckBox'
   103                     name: 'MatchCheckBox'
   104                     layout: (LayoutFrame 427 0 1 0 487 0 23 0)
   104                     layout: (LayoutFrame 424 0 1 0 508 0 23 0)
   105                     model: matchHolder
   105                     model: matchHolder
   106                     translateLabel: true
   106                     translateLabel: true
   107                   )
   107                   )
   108                  (LabelSpec
   108                  (LabelSpec
   109                     label: 'SearchBarImageInfoLabel'
   109                     label: 'SearchBarImageInfoLabel'
   110                     name: 'SearchBarImageInfoLabel'
   110                     name: 'SearchBarImageInfoLabel'
   111                     layout: (LayoutFrame 489 0 1 0 513 0 23 0)
   111                     layout: (LayoutFrame 510 0 1 0 534 0 23 0)
   112                     hasCharacterOrientedLabel: false
   112                     hasCharacterOrientedLabel: false
   113                     translateLabel: true
   113                     translateLabel: true
   114                     labelChannel: searchBarImageInfoLabelHolder
   114                     labelChannel: searchBarImageInfoLabelHolder
   115                   )
   115                   )
   116                  (LabelSpec
   116                  (LabelSpec
   117                     label: 'SearchBarInfoLabel'
   117                     label: 'SearchBarInfoLabel'
   118                     name: 'SearchBarInfoLabel'
   118                     name: 'SearchBarInfoLabel'
   119                     layout: (LayoutFrame 516 0 1 0 794 0 23 0)
   119                     layout: (LayoutFrame 545 0 1 0 794 0 23 0)
   120                     translateLabel: true
   120                     translateLabel: true
   121                     labelChannel: searchBarInfoLabelHolder
   121                     labelChannel: searchBarInfoLabelHolder
   122                     adjust: left
   122                     adjust: left
   123                   )
   123                   )
   124                  )
   124                  )
   161 !StringSearchToolForTextView methodsFor:'change & update'!
   161 !StringSearchToolForTextView methodsFor:'change & update'!
   162 
   162 
   163 matchHolderChanged
   163 matchHolderChanged
   164 
   164 
   165     self searchNextTextIncludingCurrentSelection: true.
   165     self searchNextTextIncludingCurrentSelection: true.
       
   166     self setFocusToSearchTextView.
   166 ! !
   167 ! !
   167 
   168 
   168 !StringSearchToolForTextView methodsFor:'initialization & release'!
   169 !StringSearchToolForTextView methodsFor:'initialization & release'!
   169 
   170 
   170 postBuildSearchTextView: anEditFieldView
   171 postBuildSearchTextView: anEditFieldView
   236 
   237 
   237     |searchText ignoreCase absentBlock|
   238     |searchText ignoreCase absentBlock|
   238 
   239 
   239     self searchTextStarted.
   240     self searchTextStarted.
   240     searchText := searchTextView contents.
   241     searchText := searchTextView contents.
       
   242     self setFocusToSearchTextView.
   241     searchText isEmptyOrNil ifTrue:[^self].
   243     searchText isEmptyOrNil ifTrue:[^self].
   242     ignoreCase := self ignoreCaseHolder value.
   244     ignoreCase := self ignoreCaseHolder value.
   243     self textView isNil ifTrue:[^ self].
   245     self textView isNil ifTrue:[^ self].
   244     absentBlock := [self searchPreviousTextReachBeginning].
   246     absentBlock := [self searchPreviousTextReachBeginning].
   245     self textView searchBwd:searchText ignoreCase:ignoreCase ifAbsent:absentBlock.
   247     self textView searchBwd:searchText ignoreCase:ignoreCase ifAbsent:absentBlock.
   265 ! !
   267 ! !
   266 
   268 
   267 !StringSearchToolForTextView class methodsFor:'documentation'!
   269 !StringSearchToolForTextView class methodsFor:'documentation'!
   268 
   270 
   269 version
   271 version
   270     ^ '$Header: /cvs/stx/stx/libtool/Tools__StringSearchToolForTextView.st,v 1.2 2008-04-07 10:00:19 fm Exp $'
   272     ^ '$Header: /cvs/stx/stx/libtool/Tools__StringSearchToolForTextView.st,v 1.3 2008-04-08 09:03:48 fm Exp $'
   271 ! !
   273 ! !