author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 13 Dec 2014 09:02:13 +0000 | |
changeset 367 | bd7749edb1c6 |
child 368 | a94d9afd766b |
permissions | -rw-r--r-- |
367
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
Copyright (C) 2013-2014 Jan Vrany |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
This library is free software; you can redistribute it and/or |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
6 |
modify it under the terms of the GNU Lesser General Public |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
License as published by the Free Software Foundation; either |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
version 2.1 of the License. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
This library is distributed in the hope that it will be useful, |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
13 |
Lesser General Public License for more details. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
14 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
15 |
You should have received a copy of the GNU Lesser General Public |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
16 |
License along with this library; if not, write to the Free Software |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
17 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
18 |
" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
19 |
"{ Package: 'stx:goodies/smallsense' }" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
20 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
21 |
"{ NameSpace: SmallSense }" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
AbstractListDialog subclass:#AbstractSelectDialog |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
24 |
instanceVariableNames:'' |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
classVariableNames:'' |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
poolDictionaries:'' |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
category:'SmallSense-Core-Interface-Search' |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
!AbstractSelectDialog class methodsFor:'documentation'! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
copyright |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
33 |
" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
stx:goodies/smallsense - A productivity plugin for Smalltalk/X IDE |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
Copyright (C) 2013-2014 Jan Vrany |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
36 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
This library is free software; you can redistribute it and/or |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
38 |
modify it under the terms of the GNU Lesser General Public |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
License as published by the Free Software Foundation; either |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
version 2.1 of the License. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
42 |
This library is distributed in the hope that it will be useful, |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
43 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
44 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
45 |
Lesser General Public License for more details. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
You should have received a copy of the GNU Lesser General Public |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
License along with this library; if not, write to the Free Software |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
51 |
! ! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
52 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
53 |
!AbstractSelectDialog class methodsFor:'queries'! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
isAbstract |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
"Return if this class is an abstract class. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
True is returned here for myself only; false for subclasses. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
Abstract subclasses must redefine again." |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
60 |
^ self == SmallSense::AbstractSelectDialog. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
61 |
! ! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
62 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
63 |
!AbstractSelectDialog methodsFor:'searching'! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
64 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
65 |
matchingObjectPOsForPattern: pattern |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
66 |
| pos | |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
68 |
1 to: 3 do:[:i | |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
pos := self matchingObjectPOsForPattern: pattern relax: i. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |
pos notEmptyOrNil ifTrue:[ ^ pos ] |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
71 |
]. |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
"Created: / 13-12-2014 / 08:39:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
matchingObjectPOsForPattern: pattern relax: relax |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
77 |
self subclassResponsibility |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
78 |
|
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
"Created: / 13-12-2014 / 08:40:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
80 |
! ! |
bd7749edb1c6
Decoupling search logic from dialogs (part 2)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
81 |