author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 04 Sep 2013 11:33:19 +0100 | |
branch | jv |
changeset 13491 | b3afe831ff0a |
parent 13250 | 0decde6c459d |
parent 13445 | 72f632746eb4 |
child 13613 | 066908b0c801 |
permissions | -rw-r--r-- |
9981 | 1 |
" |
10075 | 2 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
3 |
All Rights Reserved |
|
9981 | 4 |
|
10075 | 5 |
Permission is hereby granted, free of charge, to any person |
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9981 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
CodeViewService subclass:#CodeCompletionService |
|
31 |
instanceVariableNames:'' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
category:'Interface-CodeView' |
|
35 |
! |
|
36 |
||
37 |
!CodeCompletionService class methodsFor:'documentation'! |
|
38 |
||
39 |
copyright |
|
40 |
" |
|
10075 | 41 |
COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague |
42 |
All Rights Reserved |
|
43 |
||
44 |
Permission is hereby granted, free of charge, to any person |
|
45 |
obtaining a copy of this software and associated documentation |
|
46 |
files (the 'Software'), to deal in the Software without |
|
47 |
restriction, including without limitation the rights to use, |
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
49 |
copies of the Software, and to permit persons to whom the |
|
50 |
Software is furnished to do so, subject to the following |
|
51 |
conditions: |
|
9981 | 52 |
|
10075 | 53 |
The above copyright notice and this permission notice shall be |
54 |
included in all copies or substantial portions of the Software. |
|
55 |
||
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
63 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9981 | 64 |
" |
65 |
! ! |
|
66 |
||
67 |
!CodeCompletionService class methodsFor:'accessing'! |
|
68 |
||
69 |
label |
|
13100 | 70 |
"Answers a short label - for UI" |
9981 | 71 |
|
72 |
^'Code Completion' |
|
73 |
||
74 |
"Created: / 07-03-2010 / 14:00:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
75 |
! ! |
|
76 |
||
77 |
!CodeCompletionService class methodsFor:'testing'! |
|
78 |
||
79 |
isAvailable |
|
80 |
||
81 |
"CodeCompletionService is superseded by SmallSense" |
|
82 |
||
10259 | 83 |
"^(Smalltalk at:#SmallSenseService) isNil" |
84 |
||
10274 | 85 |
"Sure, it is broken, but we need it!!" |
10302 | 86 |
"JV2011-07-09: And I preferr SmallSense: this should work for both |
87 |
unless SmallSense is loaded in your image" |
|
10259 | 88 |
|
10302 | 89 |
^(Smalltalk at:#SmallSenseService) isNil. |
9981 | 90 |
|
91 |
"Created: / 03-04-2011 / 23:08:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10274 | 92 |
"Modified: / 08-07-2011 / 08:42:52 / cg" |
10413 | 93 |
"Modified: / 27-07-2011 / 11:47:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
13204 | 94 |
! |
95 |
||
96 |
isUsefulFor:aCodeView |
|
97 |
"this filters useful services. |
|
98 |
Redefined to return true for myself - not for subclasses" |
|
99 |
||
100 |
^ self == Tools::CodeCompletionService |
|
101 |
||
102 |
"Created: / 22-07-2013 / 13:59:54 / cg" |
|
9981 | 103 |
! ! |
104 |
||
105 |
!CodeCompletionService methodsFor:'event handling'! |
|
106 |
||
107 |
keyPress: key x:x y:y in: view |
|
108 |
||
109 |
"Handles an event in given view (a subview of codeView). |
|
110 |
If the method returns true, the event will not be processed |
|
111 |
by the view." |
|
112 |
||
113 |
(view == textView and:[key == #'CodeCompletion']) ifTrue: |
|
114 |
[self complete. ^true]. |
|
115 |
^false |
|
116 |
||
117 |
"Created: / 07-03-2010 / 09:36:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
! ! |
|
119 |
||
120 |
!CodeCompletionService methodsFor:'private'! |
|
121 |
||
122 |
complete |
|
13445
72f632746eb4
class: Tools::CodeCompletionService
Claus Gittinger <cg@exept.de>
parents:
13204
diff
changeset
|
123 |
|cls| |
9981 | 124 |
|
125 |
codeView languageHolder value == SmalltalkLanguage instance |
|
126 |
ifFalse:[^self]. |
|
127 |
||
128 |
cls := codeView classHolder value. |
|
129 |
cls isNil ifTrue:[ |
|
130 |
self showInfo:'No class'. |
|
131 |
^ self. |
|
132 |
]. |
|
133 |
UserInformation handle:[:ex | |
|
134 |
codeView showInfo:(ex messageText). |
|
135 |
ex proceed. |
|
136 |
] do:[ |
|
137 |
codeView withWaitCursorDo:[ |
|
13445
72f632746eb4
class: Tools::CodeCompletionService
Claus Gittinger <cg@exept.de>
parents:
13204
diff
changeset
|
138 |
DoWhatIMeanSupport codeCompletionForClass:cls context:nil codeView:textView. |
9981 | 139 |
] |
140 |
]. |
|
141 |
^ self. |
|
142 |
||
143 |
"Modified: / 04-07-2006 / 18:48:26 / fm" |
|
144 |
"Modified: / 20-11-2006 / 12:30:59 / cg" |
|
145 |
"Created: / 07-03-2010 / 09:37:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
146 |
! ! |
|
147 |
||
148 |
!CodeCompletionService class methodsFor:'documentation'! |
|
149 |
||
150 |
version_CVS |
|
13445
72f632746eb4
class: Tools::CodeCompletionService
Claus Gittinger <cg@exept.de>
parents:
13204
diff
changeset
|
151 |
^ '$Header: /cvs/stx/stx/libtool/Tools__CodeCompletionService.st,v 1.9 2013-08-31 22:32:36 cg Exp $' |
9981 | 152 |
! |
153 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
154 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
155 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
156 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
157 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
158 |
|
9981 | 159 |
version_SVN |
13445
72f632746eb4
class: Tools::CodeCompletionService
Claus Gittinger <cg@exept.de>
parents:
13204
diff
changeset
|
160 |
^ '$Id: Tools__CodeCompletionService.st,v 1.9 2013-08-31 22:32:36 cg Exp $' |
9981 | 161 |
! ! |
13100 | 162 |