Skip to content

Commit

Permalink
DummyFindReplaceService
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-krivanek committed Oct 27, 2019
1 parent 56acfe3 commit ed7905e
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 7 deletions.
103 changes: 103 additions & 0 deletions src/Rubric/DummyFindReplaceService.class.st
@@ -0,0 +1,103 @@
Class {
#name : #DummyFindReplaceService,
#superclass : #FindReplaceService,
#instVars : [
'dialog',
'textAreaHolder'
],
#category : #'Rubric-Editing-FindReplaceService'
}

{ #category : #accessing }
DummyFindReplaceService class >> newFor: anObject [

^ super new
]

{ #category : #accessing }
DummyFindReplaceService >> caseSensitive [
^ caseSensitive ifNil: [caseSensitive := RubAbstractTextArea caseSensitiveFinds]
]

{ #category : #services }
DummyFindReplaceService >> dialogIsActiveFor: aTextArea [

^ false
]

{ #category : #services }
DummyFindReplaceService >> find [

^ nil
]

{ #category : #services }
DummyFindReplaceService >> findNext [

^ nil
]

{ #category : #updating }
DummyFindReplaceService >> findPolicyChanged [
]

{ #category : #accessing }
DummyFindReplaceService >> findText: aStringOrText [

^ false
]

{ #category : #initialization }
DummyFindReplaceService >> initialize [
super initialize.

textAreaHolder := WeakArray new: 1
]

{ #category : #services }
DummyFindReplaceService >> replace [

]

{ #category : #services }
DummyFindReplaceService >> replaceAll [

]

{ #category : #accessing }
DummyFindReplaceService >> searchBackwards: aBoolean [
searchBackwards := aBoolean.
self updateFindStartIndex.
self findPolicyChanged

]

{ #category : #updating }
DummyFindReplaceService >> updateFindStartIndex [

]

{ #category : #'user-interface' }
DummyFindReplaceService >> whenDialogDeleted [

]

{ #category : #'events handling' }
DummyFindReplaceService >> whenFindReplaceWindowRequired: anAnnouncement [

]

{ #category : #'events handling' }
DummyFindReplaceService >> whenTextAreaGotFocus: anAnnounce [

]

{ #category : #'events handling' }
DummyFindReplaceService >> whenTextAreaLostFocus: anAnnounce [

]

{ #category : #'events handling' }
DummyFindReplaceService >> whenTextAreaSelectionChanged: anAnnouncement [

]
2 changes: 1 addition & 1 deletion src/Rubric/RubAbstractTextArea.class.st
Expand Up @@ -136,7 +136,7 @@ RubAbstractTextArea class >> caseSensitiveFinds: aBoolean [
{ #category : #accessing }
RubAbstractTextArea class >> defaultFindReplaceServiceClass [

^ defaultFindReplaceServiceClass ifNil: [ RubFindReplaceService ]
^ defaultFindReplaceServiceClass ifNil: [ DummyFindReplaceService ]
]

{ #category : #settings }
Expand Down
6 changes: 0 additions & 6 deletions src/Text-Edition/FindReplaceService.class.st
Expand Up @@ -163,12 +163,6 @@ FindReplaceService >> findText: aStringOrText isRegex: aBoolean entireWordsOnly:
self entireWordsOnly: forEntireWordsOnly
]

{ #category : #accessing }
FindReplaceService >> findTextSilently: aStringOrText [
findText := aStringOrText asText.
self changed: #findText
]

{ #category : #accessing }
FindReplaceService >> isRegex [
^ isRegex ifNil: [isRegex := false]
Expand Down

0 comments on commit ed7905e

Please sign in to comment.