8000 search text: rename some classes and methods [feenkcom/gtoolkit#4504] · feenkcom/Brick@9410f39 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 9410f39

Browse files
committed
search text: rename some classes and met 8000 hods [feenkcom/gtoolkit#4504]
add class comments
1 parent 5cb3f7a commit 9410f39

16 files changed

+186
-79
lines changed

src/Brick/BrEditorSearchTextAsyncFutureComputation.class.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"
2+
I am a {{gtClass:BrEditorSearchTextComputation}}.
3+
I search all text places using a {{gtClass:TAsyncFuture}}.
4+
5+
"
16
Class {
27
#name : #BrEditorSearchTextAsyncFutureComputation,
38
#superclass : #BrEditorSearchTextComputation,

src/Brick/BrEditorSearchTextComputation.class.st

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"
2+
I am an abstract class.
3+
I am responsible for searching {{gtClass:BrEditorSearchTextPattern}} places in a given {{gtClass:BlText}}.
4+
I am used by {{gtClass:BrEditorSearchTextMarker}}.
5+
"
16
Class {
27
#name : #BrEditorSearchTextComputation,
38
#superclass : #Object,

src/Brick/BrEditorSearchTextEditorElementSource.class.st

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
"
2+
I am {{gtClass:BrEditorSearchTextSource}}.
3+
I know how to access {{gtMethod:BrEditor>>#text}}.
4+
"
15
Class {
26
#name : #BrEditorSearchTextEditorElementSource,
37
#superclass : #BrEditorSearchTextSource,

src/Brick/BrEditorSearchTextFinishedAnnouncement.class.st

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"
2+
I notify that a search text activity is finished.
3+
I may be announced from a non-UI process.
4+
Note, that a given {{gtClass:BlText}} in which a searched happened may not be completelly marked yet.
5+
6+
"
17
Class {
28
#name : #BrEditorSearchTextFinishedAnnouncement,
39
#superclass : #Announcement,
@@ -37,7 +43,7 @@ BrEditorSearchTextFinishedAnnouncement >> gtFoundItemsFor: aView [
3743

3844
{ #category : #accessing }
3945
BrEditorSearchTextFinishedAnnouncement >> items [
40-
<return: #Collection of: #BrEditorSearchTextPatternItem>
46+
<return: #Collection of: #BrEditorSearchTextItem>
4147
^ items ifNil: [ #() ]
4248
]
4349

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
"
2+
I represent a place in a {{gtClass:BlText}} where a given {{gtClass:BrEditorSearchTextPattern}} was found.
3+
4+
"
15
Class {
2-
#name : #BrEditorSearchTextPatternItem,
6+
#name : #BrEditorSearchTextItem,
37
#superclass : #Object,
48
#instVars : [
59
'pattern',
@@ -15,47 +19,47 @@ Class {
1519
}
1620

1721
{ #category : #accessing }
18-
BrEditorSearchTextPatternItem >> absoluteStartIndex [
22+
BrEditorSearchTextItem >> absoluteStartIndex [
1923
^ absoluteStartIndex
2024
]
2125

2226
{ #category : #accessing }
23-
BrEditorSearchTextPatternItem >> absoluteStartIndex: anInteger [
27+
BrEditorSearchTextItem >> absoluteStartIndex: anInteger [
2428
absoluteStartIndex := anInteger
2529
]
2630

2731
{ #category : #accessing }
28-
BrEditorSearchTextPatternItem >> absoluteStopIndex [
32+
BrEditorSearchTextItem >> absoluteStopIndex [
2933
^ absoluteStopIndex
3034
]
3135

3236
{ #category : #accessing }
33-
BrEditorSearchTextPatternItem >> absoluteStopIndex: anObject [
37+
BrEditorSearchTextItem >> absoluteStopIndex: anObject [
3438
absoluteStopIndex := anObject
3539
]
3640

3741
{ #category : #accessing }
38-
BrEditorSearchTextPatternItem >> isSelected [
42+
BrEditorSearchTextItem >> isSelected [
3943
^ isSelected ifNil: [ false ]
4044
]
4145

4246
{ #category : #accessing }
43-
BrEditorSearchTextPatternItem >> isSelected: aBoolean [
47+
BrEditorSearchTextItem >> isSelected: aBoolean [
4448
isSelected := aBoolean
4549
]
4650

4751
{ #category : #accessing }
48-
BrEditorSearchTextPatternItem >> pattern [
52+
BrEditorSearchTextItem >> pattern [
4953
^ pattern
5054
]
5155

5256
{ #category : #accessing }
53-
BrEditorSearchTextPatternItem >> pattern: anObject [
57+
BrEditorSearchTextItem >> pattern: anObject [
5458
pattern := anObject
5559
]
5660

5761
{ #category : #printing }
58-
BrEditorSearchTextPatternItem >> printOn: aStream [
62+
BrEditorSearchTextItem >> printOn: aStream [
5963
super printOn: aStream.
6064

6165
aStream
@@ -70,52 +74,52 @@ BrEditorSearchTextPatternItem >> printOn: aStream [
7074
]
7175

7276
{ #category : #accessing }
73-
BrEditorSearchTextPatternItem >> startIndex [
77+
BrEditorSearchTextItem >> startIndex [
7478
^ startIndex
7579
]
7680

7781
{ #category : #accessing }
78-
BrEditorSearchTextPatternItem >> startIndex: anObject [
82+
BrEditorSearchTextItem >> startIndex: anObject [
7983
startIndex := anObject
8084
]
8185

8286
{ #category : #accessing }
83-
BrEditorSearchTextPatternItem >> stopIndex [
87+
BrEditorSearchTextItem >> stopIndex [
8488
^ stopIndex
8589
]
8690

8791
{ #category : #accessing }
88-
BrEditorSearchTextPatternItem >> stopIndex: anObject [
92+
BrEditorSearchTextItem >> stopIndex: anObject [
8993
stopIndex := anObject
9094
]
9195

9296
{ #category : #acessing }
93-
BrEditorSearchTextPatternItem >> substring [
97+
BrEditorSearchTextItem >> substring [
9498
^ self subtext asString
9599
]
96100

97101
{ #category : #acessing }
98-
BrEditorSearchTextPatternItem >> subtext [
102+
BrEditorSearchTextItem >> subtext [
99103
^ self text from: self startIndex to: self stopIndex
100104
]
101105

102106
{ #category : #accessing }
103-
BrEditorSearchTextPatternItem >> text [
107+
BrEditorSearchTextItem >> text [
104108
^ text
105109
]
106110

107111
{ #category : #accessing }
108-
BrEditorSearchTextPatternItem >> text: anObject [
112+
BrEditorSearchTextItem >> text: anObject [
109113
text := anObject
110114
]
111115

112116
{ #category : #accessing }
113-
BrEditorSearchTextPatternItem >> textAttribute [
117+
BrEditorSearchTextItem >> textAttribute [
114118
<return: #BrEditorSearchTextMark>
115119
^ textAttribute
116120
]
117121

118122
{ #category : #accessing }
119-
BrEditorSearchTextPatternItem >> textAttribute: aBrEditorSearchTextMark [
123+
BrEditorSearchTextItem >> textAttribute: aBrEditorSearchTextMark [
120124
textAttribute := aBrEditorSearchTextMark
121125
]

src/Brick/BrEditorSearchTextMarker.class.st

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
"
2+
I am a core class for the search text activity.
3+
I {{gtMethod:BrEditorSearchTextMarker>>#mark: | label=mark}} all places for a given {{gtMethod:BrEditorSearchTextMarkerContext >> #pattern | label=#selector}}.
4+
Main methods:
5+
- {{gtMethod:BrEditorSearchTextMarker>>#mark: | label=#selector}},
6+
- {{gtMethod:BrEditorSearchTextMarker>>#markNext: | label=#selector}},
7+
- {{gtMethod:BrEditorSearchTextMarker>>#markPrevious: | label=#selector}},
8+
- {{gtMethod:BrEditorSearchTextMarker>>#unmark: | label=#selector}}.
9+
10+
"
111
Class {
212
#name : #BrEditorSearchTextMarker,
313
#superclass : #Object,
@@ -46,8 +56,8 @@ BrEditorSearchTextMarker >> markNext: aMarkContext [
4656
aMarkContext editorModelTextDo: [ :aCurrentText |
4757
| aCurrentItem aNewItem |
4858

49-
aCurrentItem := aMarkContext selectedPatternItem.
50-
aNewItem := a F438 MarkContext computeNextPatternItem.
59+
aCurrentItem := aMarkContext selectedItem.
60+
aNewItem := aMarkContext computeNextItem.
5161

5262
self switchText: aCurrentText attributeFor: aCurrentItem.
5363
self switchText: aCurrentText attributeFor: aNewItem.
@@ -60,8 +70,8 @@ BrEditorSearchTextMarker >> markPrevious: aMarkContext [
6070
aMarkContext editorModelTextDo: [ :aCurrentText |
6171
| aCurrentItem aNewItem |
6272

63-
aCurrentItem := aMarkContext selectedPatternItem.
64-
aNewItem := aMarkContext computePreviousPatternItem.
73+
aCurrentItem := aMarkContext selectedItem.
74+
aNewItem := aMarkContext computePreviousItem.
6575

6676
self switchText: aCurrentText attributeFor: aCurrentItem.
6777
self switchText: aCurrentText attributeFor: aNewItem.
@@ -71,7 +81,7 @@ BrEditorSearchTextMarker >> markPrevious: aMarkContext [
7181

7282
{ #category : #'api - styling' }
7383
BrEditorSearchTextMarker >> markText: aText context: aMarkContext [
74-
<return: #Collection of: #BrEditorSearchTextPatternItem>
84+
<return: #Collection of: #BrEditorSearchTextItem>
7585
| someIndexes |
7686
someIndexes := aMarkContext pattern findAllIndexesIn: aText.
7787
^ self
@@ -82,14 +92,14 @@ BrEditorSearchTextMarker >> markText: aText context: aMarkContext [
8292

8393
{ #category : #'api - styling' }
8494
BrEditorSearchTextMarker >> markText: aText indexes: someItems context: aMarkContext [
85-
<return: #Collection of: #BrEditorSearchTextPatternItem>
95+
<return: #Collection of: #BrEditorSearchTextItem>
8696
aText clearAttributes: [ :eachAttribute |
8797
eachAttribute class = BrEditorSearchTextMark ].
8898

8999
someItems
90100
doWithIndex: [ :eachItem :eachIndex |
91101
| isCurrentItem anAttribute |
92-
isCurrentItem := aMarkContext isCurrentPatternItem: eachItem index: eachIndex.
102+
isCurrentItem := aMarkContext isSelectedItem: eachItem index: eachIndex.
93103
eachItem isSelected: isCurrentItem.
94104
anAttribute := BrEditorSearchTextMark new
95105
index: eachIndex;

0 commit comments

Comments
 (0)
0