Tools__CodeNavigationService.st
author Claus Gittinger <cg@exept.de>
Thu, 06 Jun 2013 19:41:36 +0200
changeset 12867 03a18d91ded1
parent 12486 0a82f2fcb6b3
child 12913 c5fdb1a82ed1
child 13170 c9b815af5777
permissions -rw-r--r--
faster quick senders menu.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10076
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     3
              All Rights Reserved
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10076
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     5
Permission is hereby granted, free of charge, to any person
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     6
obtaining a copy of this software and associated documentation
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     7
files (the 'Software'), to deal in the Software without
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     8
restriction, including without limitation the rights to use,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    10
copies of the Software, and to permit persons to whom the
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    11
Software is furnished to do so, subject to the following
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    12
conditions:
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    13
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    14
The above copyright notice and this permission notice shall be
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    15
included in all copies or substantial portions of the Software.
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    16
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    23
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    24
OTHER DEALINGS IN THE SOFTWARE.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
CodeViewService subclass:#CodeNavigationService
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
    31
	instanceVariableNames:'selectorEmphasis variableEmphasis currentEmphasis linesToRedraw
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
    32
		menuShown'
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    33
	classVariableNames:'DefaultVariableEmphasis DefaultSelectorEmphasis'
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
	poolDictionaries:''
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
	category:'Interface-CodeView'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!CodeNavigationService class methodsFor:'documentation'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
copyright
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
10076
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    42
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    43
              All Rights Reserved
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    44
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    45
Permission is hereby granted, free of charge, to any person
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    46
obtaining a copy of this software and associated documentation
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    47
files (the 'Software'), to deal in the Software without
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    48
restriction, including without limitation the rights to use,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    49
copy, modify, merge, publish, distribute, sublicense, and/or sell
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    50
copies of the Software, and to permit persons to whom the
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    51
Software is furnished to do so, subject to the following
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    52
conditions:
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
10076
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    54
The above copyright notice and this permission notice shall be
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    55
included in all copies or substantial portions of the Software.
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    56
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    57
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    58
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    59
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    60
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    61
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    62
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    63
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
6d9055a907ff changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9979
diff changeset
    64
OTHER DEALINGS IN THE SOFTWARE.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!CodeNavigationService class methodsFor:'accessing'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
label
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    "Answers short label - for UI"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    ^'Semi-modal Code Navigation'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "Created: / 07-03-2010 / 14:00:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10412
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    77
!
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    78
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    79
requiredServices
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    80
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    81
    ^#(#'Tools::CodeHighlightingService')
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    82
cc7a72f29805 Fixes for debugger
vrany
parents: 10361
diff changeset
    83
    "Created: / 27-07-2011 / 11:40:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!CodeNavigationService class methodsFor:'accessing - defaults'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
defaultSelectorEmphasis
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    89
    DefaultSelectorEmphasis isNil ifTrue:[
12486
0a82f2fcb6b3 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 12485
diff changeset
    90
        ^ Array with:(#backgroundColor -> (UserPreferences current selectorBackgroundColorForNavigationService))
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    91
    ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    92
    ^ DefaultSelectorEmphasis
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    93
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    94
    "Modified: / 21-08-2011 / 09:58:18 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
defaultVariableEmphasis
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
    98
    DefaultVariableEmphasis isNil ifTrue:[
12486
0a82f2fcb6b3 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 12485
diff changeset
    99
        ^ Array with:(#backgroundColor -> (UserPreferences current variableBackgroundColorForNavigationService))
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   100
    ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   101
    ^ DefaultVariableEmphasis
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    "Created: / 25-06-2010 / 13:56:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   104
    "Modified: / 21-08-2011 / 11:04:20 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
10651
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   107
!CodeNavigationService methodsFor:'change & update'!
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   108
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   109
update: aspect with: param from: sender
10661
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   110
    sender == textView modifiedChannel ifTrue:[
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   111
        codeView reallyModified ifTrue:[
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   112
            "/ no longer highlight - the info is wrong anyway !!
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   113
            self highlightClear.
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   114
        ].
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   115
    ].
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   116
10653
0f30edd43161 changed halt to breakPoint: in #update:with:from:
vrany
parents: 10651
diff changeset
   117
    "JV: I changed 'halt' to 'breakPoint: #cg'"
10651
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   118
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   119
    "Created: / 22-08-2011 / 16:22:19 / cg"
10653
0f30edd43161 changed halt to breakPoint: in #update:with:from:
vrany
parents: 10651
diff changeset
   120
    "Modified: / 25-08-2011 / 15:10:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10661
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   121
    "Modified: / 05-09-2011 / 05:15:42 / cg"
10651
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   122
! !
7ab02ade36e2 added: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10631
diff changeset
   123
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!CodeNavigationService methodsFor:'code services'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   126
browseClass:class 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   127
    self browser isNil ifTrue:[ ^ NewSystemBrowser browseClass:class ].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   129
        or:[ self browser navigationState modified ]) 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   130
            ifTrue:[
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   131
                self browser 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   132
                    spawnFullBrowserInClass:class
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   133
                    selector:nil
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   134
                    in:#newBuffer
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   135
            ]
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   136
            ifFalse:[ self browser switchToClass:class ]
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    "Created: / 15-02-2010 / 09:36:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    "Modified: / 25-07-2010 / 11:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   140
    "Modified: / 21-08-2011 / 10:07:30 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
browser
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ^codeView browserHolder value
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    "Created: / 06-03-2010 / 21:14:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!CodeNavigationService methodsFor:'event handling'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
button1Press
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   153
    |element|
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   155
    (element := codeView syntaxElementSelection) notNil ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   156
        element type == #selector ifTrue:[self button1PressForSelector: element value. ^true].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   157
        element type == #class    ifTrue:[self browseClass:element value. ^true].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   158
    ].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   159
    ^ false
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "Created: / 14-02-2010 / 18:43:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "Modified: / 06-03-2010 / 21:11:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10878
3424d00f9155 changed:
Claus Gittinger <cg@exept.de>
parents: 10727
diff changeset
   163
    "Modified: / 18-11-2011 / 14:58:02 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
button1PressForSelector: selector
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   167
    | impls |
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
10254
43001ebe1490 Merged with JV's branch
vrany
parents: 10076
diff changeset
   169
    impls := codeView implementorsOf: selector.
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   170
    "/ impls size = 1 ifTrue:[^codeView browseMethod: impls anyOne].
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   171
    [
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   172
        menuShown := codeView implementorsMenu: impls selector: selector.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   173
        self highlightClear.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   174
        menuShown showAtPointer.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   175
    ] ensure:[
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   176
        menuShown := nil
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   177
    ].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    "Created: / 14-02-2010 / 18:50:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10254
43001ebe1490 Merged with JV's branch
vrany
parents: 10076
diff changeset
   180
    "Modified: / 30-06-2011 / 19:34:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10271
44c51d135362 changed: #button1PressForSelector: bug fix
vrany
parents: 10254
diff changeset
   181
    "Modified: / 07-07-2011 / 17:16:23 / jv"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   182
    "Modified: / 21-08-2011 / 11:06:08 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
button2Press
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   186
    | element |
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   188
    (element := codeView syntaxElementSelection) notNil ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   189
        element type == #selector ifTrue:[self button2PressForSelector: element value. ^ true].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   190
    ].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   191
    ^ false
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    "Created: / 14-02-2010 / 18:43:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    "Modified: / 17-06-2011 / 08:58:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
button2PressForSelector: selector
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   198
    | senders |
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   200
    senders := codeView sendersOf: selector.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   201
    "/ senders size = 1 ifTrue:[ codeView browseMethod: senders anyOne. ^ self].
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   202
    [
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   203
        menuShown := codeView sendersMenu: senders selector: selector.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   204
        self highlightClear.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   205
        menuShown showAtPointer.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   206
    ] ensure:[
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   207
        menuShown := nil.
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   208
    ].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    "Created: / 14-02-2010 / 18:50:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10254
43001ebe1490 Merged with JV's branch
vrany
parents: 10076
diff changeset
   211
    "Modified: / 30-06-2011 / 19:34:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   212
    "Modified: / 21-08-2011 / 11:34:49 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   215
buttonMotion:button x:x y:y in:view 
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
     by the view."
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   219
    
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   220
    (view == textView and:[ textView sensor metaDown ]) ifTrue:[
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   221
        self highlightElementAtX:x y:y.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   222
        ^ true
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   223
    ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   224
    ^ false
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    "Created: / 06-03-2010 / 20:40:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   227
    "Modified (format): / 21-08-2011 / 10:07:15 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
buttonPress: button x:x y:y in: view
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   236
    (view == textView) ifTrue:[
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   237
        textView isQuickMenuModifierPressed ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   238
            button == 1      ifTrue: [^self button1Press].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   239
            button == #paste ifTrue: [^self button2Press].   
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   240
            button == 2      ifTrue: [^self button2Press]
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   241
        ] ifFalse:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   242
            button == 1 ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   243
                self highlightVariableAtX:x y:y.
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   244
            ]
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
        ]
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   246
    ].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    ^false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    "Created: / 06-03-2010 / 21:12:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    "Modified: / 25-06-2010 / 14:53:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   251
    "Modified (format): / 21-08-2011 / 10:06:54 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   254
buttonRelease: button x:x y:y in: view
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   255
    "Handles an event in given view (a subview of codeView).
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   256
     If the method returns true, the event will not be processed
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   257
     by the view."
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   258
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   259
    "/ if I show a quick senders/implementors menu, eat this event
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   260
    ^ menuShown notNil
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   261
!
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   262
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   263
isQuickMenuModifierPressed
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   264
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   265
        ^ textView sensor ctrlDown
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   266
    ].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   267
    ^ textView sensor metaDown
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   268
!
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   269
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   270
isQuickMenuModifierReleased
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   271
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   272
        ^ textView sensor ctrlDown not
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   273
    ].
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   274
    ^ textView sensor metaDown not
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   275
!
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   276
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
keyPress:key x:x y:y in:view 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
    "Handles an event in given view (a subview of codeView).
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   279
     If the method returns true, it has eaten the event and it will not be processed
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
     by the view."
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   281
12105
44e930e29b99 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 11741
diff changeset
   282
    <resource: #keyboard (#Control_L #Ctrl 
44e930e29b99 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 11741
diff changeset
   283
                          #CursorRight #CursorDown #CursorLeft #CursorUp)>
44e930e29b99 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 11741
diff changeset
   284
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   285
    |ev p|
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   286
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   287
    (view == textView) ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   288
        "/ ("ctrlDown" "key == #'Control_L' or:[ key == #Ctrl ]") ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   289
        (textView isQuickMenuModifierPressed) ifTrue:[
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   290
            "/ because it is delegated, the position is not correct
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   291
            ev := WindowGroup lastEventQuerySignal query.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   292
            p := view device translatePoint:(ev x @ ev y) fromView:ev view toView:view.
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   293
            view sensor 
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   294
                pushUserEvent:#highlightElementAtX:y: 
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   295
                for: self 
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   296
                withArguments:{p x. p y.}.
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   297
            ^ false "/ true. -- no, dont eat the key
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
        ].
10661
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   299
10709
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   300
"/        codeView reallyModified "textView modified" ifTrue:[
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   301
"/            self highlightClear. 
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   302
"/            codeView syntaxElements: nil.
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   303
"/            ^ false
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   304
"/        ].
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   305
         (key == #CursorRight
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   306
            or:[key == #CursorDown
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   307
            or:[key == #CursorLeft
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   308
            or:[key == #CursorUp]]]) ifTrue:[   
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   309
            view sensor pushUserEvent:#highlightVariableAtCursor for:self .
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   310
        ] ifFalse:[
10727
b2fc73a2b1fe Try to fix the redraw bug
vrany
parents: 10709
diff changeset
   311
            view sensor pushUserEvent:#highlightClear for:self .
10709
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   312
        ]
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   313
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
    ^ false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
    "Created: / 06-03-2010 / 20:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10661
367196dfc3f9 changed:
Claus Gittinger <cg@exept.de>
parents: 10653
diff changeset
   318
    "Modified: / 05-09-2011 / 05:17:30 / cg"
10727
b2fc73a2b1fe Try to fix the redraw bug
vrany
parents: 10709
diff changeset
   319
    "Modified: / 27-09-2011 / 19:24:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
keyRelease: key x:x y:y in: view
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
    "Handles an event in given view (a subview of codeView).
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   324
     If the method returns true, it has eaten the event and it will not be processed
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   327
    |ev p|
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   328
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   329
    (view == textView and:[textView isQuickMenuModifierReleased]) ifTrue:[
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   330
        "/    (view == textView and:[key == #'Control_L' or:[key == #Ctrl]]) ifTrue:[
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   331
        "/ because it is delegated, the position is not correct
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   332
        ev := WindowGroup lastEventQuerySignal query.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   333
        p := view device translatePoint:(ev x @ ev y) fromView:ev view toView:view.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   334
        self highlightClear. 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   335
"/        view sensor pushUserEvent:#highlightClear for:self. 
12353
9d725076871b changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12105
diff changeset
   336
        ^ false "/ true -- do not eat the event
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   337
    ].
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   338
    ^ false
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
    "Created: / 06-03-2010 / 21:03:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   341
    "Modified: / 21-08-2011 / 11:32:40 / cg"
10709
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   342
!
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   343
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   344
linesDeletedFrom: start to: end
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   345
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   346
    self highlightClear
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   347
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   348
    "Created: / 06-07-2011 / 17:14:36 / jv"
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   349
    "Created: / 16-09-2011 / 15:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   350
!
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   351
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   352
linesInsertedFrom: start to: end
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   353
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   354
    self highlightClear
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   355
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   356
    "Created: / 06-07-2011 / 17:14:36 / jv"
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   357
    "Created: / 16-09-2011 / 15:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   358
!
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   359
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   360
linesModifiedFrom: start to: end
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   361
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   362
    self highlightClear
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   363
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   364
    "Created: / 06-07-2011 / 17:14:36 / jv"
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   365
    "Created: / 16-09-2011 / 15:19:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   366
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   367
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
!CodeNavigationService methodsFor:'initialization'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
initialize
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
    super initialize.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    selectorEmphasis := self class defaultSelectorEmphasis.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
    variableEmphasis := self class defaultVariableEmphasis.
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   375
    linesToRedraw := OrderedCollection new.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   376
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   377
    "Created: / 25-06-2010 / 14:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   378
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   379
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   380
!CodeNavigationService methodsFor:'private'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
elementAtCursor
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
    ^self elementAtLine: textView cursorLine col: textView cursorCol - 1
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
    "Created: / 25-06-2010 / 14:39:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   388
elementAtLine:line col:colArg 
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   389
    |characterPosition syntaxElements index element col|
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   390
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   391
    "/ if beyond end of line, do not advance into next line
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   392
    col := colArg min:(textView listAt:line) size.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
    characterPosition := textView characterPositionOfLine:line col:col.
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   395
    syntaxElements := codeView syntaxElements.
11741
3b6f1c31139f changed:
Stefan Vogel <sv@exept.de>
parents: 11740
diff changeset
   396
    syntaxElements isEmptyOrNil ifTrue:[
3b6f1c31139f changed:
Stefan Vogel <sv@exept.de>
parents: 11740
diff changeset
   397
        ^ nil.
3b6f1c31139f changed:
Stefan Vogel <sv@exept.de>
parents: 11740
diff changeset
   398
    ].
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   399
    index := syntaxElements indexForInserting:characterPosition.
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   400
    index > syntaxElements size ifTrue:[^nil].
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   401
    element := syntaxElements at:index ifAbsent:nil.
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   402
    element notNil ifTrue:[
10709
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   403
        (characterPosition between: element start - 1 and: element stop) ifTrue:[^element].
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   404
    ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   405
    ^nil
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
    "Created: / 25-06-2010 / 14:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   408
    "Modified: / 21-08-2011 / 11:03:29 / cg"
10709
e3257bcab5de Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10661
diff changeset
   409
    "Modified: / 16-09-2011 / 17:04:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
elementAtX:x y:y 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
    |visibleLine line col|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   415
    codeView syntaxElements isNil ifTrue:[^nil].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   416
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    visibleLine := textView visibleLineOfY:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
    col := textView colOfX:x inVisibleLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
    line := textView visibleLineToAbsoluteLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
    ^self elementAtLine:line col:col
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
    "Created: / 25-06-2010 / 14:52:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
    "Modified: / 01-08-2010 / 08:50:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   424
    "Modified: / 21-08-2011 / 10:26:08 / cg"
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   425
!
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   426
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   427
foo
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   428
|characterPosition index element |
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   429
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   430
characterPosition := 1
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   431
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   432
    "Created: / 21-08-2011 / 10:48:05 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
highlighEmphasisFor: element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
10878
3424d00f9155 changed:
Claus Gittinger <cg@exept.de>
parents: 10727
diff changeset
   437
    element isNil ifTrue:[^nil].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   439
    element isSelector ifTrue:[^selectorEmphasis].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   440
    element isVariable ifTrue:[^variableEmphasis].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   441
    element isSelf     ifTrue:[^variableEmphasis].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
    ^nil
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
    "Created: / 25-06-2010 / 13:54:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10878
3424d00f9155 changed:
Claus Gittinger <cg@exept.de>
parents: 10727
diff changeset
   446
    "Modified: / 18-11-2011 / 14:58:05 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
highlightClear
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   451
    ^self highlightClear: true.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    "Modified: / 26-12-2007 / 12:28:05 / janfrog"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    "Created: / 25-06-2010 / 14:15:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10276
068f02c67fd7 changed:
Claus Gittinger <cg@exept.de>
parents: 10271
diff changeset
   455
    "Modified: / 08-07-2011 / 08:50:45 / cg"
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   456
    "Modified: / 20-07-2011 / 18:52:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   459
highlightClear: redraw
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   460
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   461
    codeView syntaxElementSelection == nil ifTrue:[ ^ self ].
10878
3424d00f9155 changed:
Claus Gittinger <cg@exept.de>
parents: 10727
diff changeset
   462
    textView list isNil ifTrue:[ ^ self ].
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   463
    textView list withIndexDo:[:line :lineNo | 
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   464
        line isText ifTrue:[ 
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   465
            (line hasEmphasis: currentEmphasis) ifTrue:[
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   466
                line emphasisAllRemove:currentEmphasis.
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   467
                linesToRedraw add: lineNo.
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   468
            ]
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   469
        ] 
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   470
    ].
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   471
    codeView syntaxElementSelection:nil.
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   472
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   473
    redraw ifTrue:[self redrawLines].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   475
    "Modified: / 26-12-2007 / 12:28:05 / janfrog"
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   476
    "Created: / 20-07-2011 / 18:52:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10878
3424d00f9155 changed:
Claus Gittinger <cg@exept.de>
parents: 10727
diff changeset
   477
    "Modified: / 18-11-2011 / 14:58:08 / cg"
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   478
!
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   479
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   480
highlightElement:element 
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   481
    |e|
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   482
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   483
    codeView syntaxElementSelection == element ifTrue:[ ^ self ]. "/ no change
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   484
    codeView syntaxElementSelection notNil ifTrue:[
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   485
        self highlightClear: false.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   486
    ].
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   487
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   488
    currentEmphasis := self highlighEmphasisFor:element.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   489
    element notNil ifTrue:[ 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   490
        codeView syntaxElementSelection:element.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   491
        e := element firstElementInChain.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   492
        [ e notNil ] whileTrue:[ 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   493
            self highlightWithoutClearFrom:e start to:e stop.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   494
            e := e nextElement 
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   495
        ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   496
    ].
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   497
    self redrawLines.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
    "Created: / 14-02-2010 / 16:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   500
    "Modified: / 20-07-2011 / 18:52:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   501
    "Modified: / 21-08-2011 / 10:22:58 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
highlightElementAtCursor
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
    self highlightElementAtLine: textView cursorLine col: textView cursorCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
    "Created: / 14-02-2010 / 16:17:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
    "Modified: / 06-03-2010 / 19:59:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
highlightElementAtLine:line col:col 
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   512
    |characterPosition syntaxElements index element|
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
    characterPosition := textView characterPositionOfLine:line col:col.
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   515
    syntaxElements := codeView syntaxElements.
11741
3b6f1c31139f changed:
Stefan Vogel <sv@exept.de>
parents: 11740
diff changeset
   516
    syntaxElements isEmptyOrNil ifTrue:[self highlightElement:nil. ^ self].
11740
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   517
    index := syntaxElements indexForInserting:characterPosition.
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   518
    index > syntaxElements size ifTrue:[self highlightElement:nil. ^ self].
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   519
    element := syntaxElements at:index.
fa674978dc41 changed:
Stefan Vogel <sv@exept.de>
parents: 10878
diff changeset
   520
    (characterPosition between: element start and: element stop) ifFalse:[element := nil].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
    self highlightElement:element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
    "Created: / 14-02-2010 / 16:17:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
    "Modified: / 01-08-2010 / 08:50:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
highlightElementAtX:x y:y 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    |visibleLine line col|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   530
    codeView syntaxElements isNil ifTrue:[^self].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
    visibleLine := textView visibleLineOfY:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
    col := textView colOfX:x inVisibleLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
    line := textView visibleLineToAbsoluteLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
    self highlightElementAtLine:line col:col
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
    "Created: / 14-02-2010 / 16:12:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
    "Modified: / 06-03-2010 / 20:06:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   538
    "Modified: / 21-08-2011 / 10:22:10 / cg"
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   539
!
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   540
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   541
highlightElementOrNil:e
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   542
    e notNil ifTrue:[
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   543
        "/ cg: only if selected !!
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   544
        "/ self halt.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   545
        self highlightElement:e.
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   546
    ] ifFalse:[
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   547
        self highlightClear
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   548
    ].
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   549
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   550
    "Created: / 25-06-2010 / 14:52:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   551
    "Created: / 21-08-2011 / 09:56:39 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
highlightLine:lineNo fromLine:startLine col:endLine toLine:startCol col:endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
    |line start end|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
    (lineNo between:startLine and:endLine) ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
        ^ self
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
    line := textView listAt:lineNo.
10291
af5825474e18 changed: #highlightLine:fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents: 10276
diff changeset
   561
    line isEmpty ifTrue:[^self].
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
    start := lineNo = startLine ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
                startCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
            ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
                line indexOfNonSeparator
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
            ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
    end := lineNo = endLine ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
                endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
            ] ifFalse:[ line size ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
    line 
10291
af5825474e18 changed: #highlightLine:fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents: 10276
diff changeset
   571
        emphasisFrom:(start max: 1)
af5825474e18 changed: #highlightLine:fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents: 10276
diff changeset
   572
        to:(end min: line size)
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   573
        add: currentEmphasis.
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   574
    linesToRedraw add: lineNo.
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
    "Created: / 25-06-2010 / 14:15:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10291
af5825474e18 changed: #highlightLine:fromLine:col:toLine:col:
Claus Gittinger <cg@exept.de>
parents: 10276
diff changeset
   577
    "Modified: / 08-07-2011 / 13:02:51 / cg"
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   578
    "Modified: / 20-07-2011 / 18:43:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   579
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   580
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   581
highlightVariable:e 
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   582
    (e notNil and:[ e isVariableOrSelf ]) ifTrue:[
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   583
        self highlightElement:e.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   584
    ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   585
        self highlightClear.
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   586
    ].
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   587
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   588
    "Modified: / 20-07-2011 / 18:54:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   589
    "Modified: / 21-08-2011 / 09:39:42 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   591
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
highlightVariableAtCursor
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   593
    self highlightElementOrNil:(self elementAtCursor)
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
    "Modified: / 25-06-2010 / 14:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   596
    "Modified: / 21-08-2011 / 09:56:56 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
highlightVariableAtX:x y:y 
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   600
    self highlightElementOrNil:(self elementAtX:x y:y).
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
    "Created: / 25-06-2010 / 14:52:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10631
7639ba8f13da fixed highlighting
Claus Gittinger <cg@exept.de>
parents: 10588
diff changeset
   603
    "Modified: / 21-08-2011 / 10:24:50 / cg"
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
highlightWithoutClearFrom: start to: end
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
    "Remove underlined emphasis"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
    |startLine startCol endLine endCol|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
    startLine := textView lineOfCharacterPosition:start.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
    startCol := start - (textView characterPositionOfLine:startLine col:1) + 1.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
    endLine := textView lineOfCharacterPosition:end.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    endCol := end - (textView characterPositionOfLine:endLine col:1) + 1.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
    self highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   616
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
    "Created: / 25-06-2010 / 14:15:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   619
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   620
highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
    textView list keysAndValuesDo:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
        [:lineNo :line|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
        |start end|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
        line isText ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
            [self highlightLine: lineNo fromLine: startLine col: endLine toLine: startCol col: endCol]].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
    "Created: / 25-06-2010 / 14:15:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   631
!CodeNavigationService methodsFor:'redrawing'!
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   632
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   633
redrawLines
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   634
    linesToRedraw do:[:lineNo|
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   635
        textView invalidateLine: lineNo.
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   636
    ].
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   637
    linesToRedraw := OrderedCollection new: 1
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   638
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   639
    "Created: / 20-07-2011 / 18:45:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10588
Claus Gittinger <cg@exept.de>
parents: 10412
diff changeset
   640
    "Modified (format): / 18-08-2011 / 16:01:34 / cg"
10361
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   641
! !
1443a20ddac2 Navigation redrawing optimized a bit...
vrany
parents: 10291
diff changeset
   642
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
!CodeNavigationService class methodsFor:'documentation'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
12486
0a82f2fcb6b3 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 12485
diff changeset
   645
version
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   646
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.23 2013-06-06 17:41:36 cg Exp $'
12486
0a82f2fcb6b3 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 12485
diff changeset
   647
!
0a82f2fcb6b3 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 12485
diff changeset
   648
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
version_CVS
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   650
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.23 2013-06-06 17:41:36 cg Exp $'
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
version_SVN
12867
03a18d91ded1 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12486
diff changeset
   654
    ^ '$Id: Tools__CodeNavigationService.st,v 1.23 2013-06-06 17:41:36 cg Exp $'
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
! !
12105
44e930e29b99 class: Tools::CodeNavigationService
Claus Gittinger <cg@exept.de>
parents: 11741
diff changeset
   656