Tools__CodeNavigationService.st
author Claus Gittinger <cg@exept.de>
Fri, 01 Jul 2011 15:30:32 +0200
changeset 9998 dc88261b0fc2
parent 9979 00b306851c88
child 10076 6d9055a907ff
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9979
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
	      All Rights Reserved
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ NameSpace: Tools }"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
CodeViewService subclass:#CodeNavigationService
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:'selectorEmphasis variableEmphasis currentEmphasis'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Interface-CodeView'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!CodeNavigationService class methodsFor:'documentation'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 2006 by eXept Software AG
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
	      All Rights Reserved
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
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
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
!CodeNavigationService class methodsFor:'accessing'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
label
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    "Answers short label - for UI"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    ^'Semi-modal Code Navigation'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    "Created: / 07-03-2010 / 14:00:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
!CodeNavigationService class methodsFor:'accessing - defaults'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
defaultSelectorEmphasis
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    ^ Array with:#backgroundColor 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
                -> (Color white blendWith:(Color 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
                                redByte:100
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
                                greenByte:180
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
                                blueByte:255))
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
defaultVariableEmphasis
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    ^ Array with:#backgroundColor 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
                -> (Color gray: 90)
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Created: / 25-06-2010 / 13:56:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
!CodeNavigationService methodsFor:'code services'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
browseClass: class
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    self browser ifNil: [^NewSystemBrowser browseClass:class].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
        or:[self browser navigationState modified])  
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
        ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
            [self browser 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
                spawnFullBrowserInClass: class selector:nil in:#newBuffer]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
        ifFalse:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
            [self browser 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
                switchToClass: class]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    "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
    82
    "Modified: / 25-07-2010 / 11:00:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
browseMethod: method
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
    self browseMethod: method label: nil.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    "Created: / 14-02-2010 / 19:41:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
browseMethod: method label: label
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    self browser ifNil: [^NewSystemBrowser openInMethod:method].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
        or:[self browser navigationState modified])  
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
        ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
            [self browser 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
                spawnFullBrowserInClass: method mclass 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
                selector:method selector 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
                in:#newBuffer]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
        ifFalse:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
            [self browser 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
                switchToClass: method containingClass 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
                selector: method selector].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "Modified: / 19-02-2008 / 10:15:17 / janfrog"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    "Modified: / 25-07-2010 / 13:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
browseMethods: methods label: label
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    methods size = 1 ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
        [^self browseMethod: methods anyOne label: label].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    self browser 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
        ifNil: [NewSystemBrowser browseMethods: methods title: label]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
        ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    "Created: / 26-12-2007 / 11:32:04 / janfrog"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
browser
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    ^codeView browserHolder value
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "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
   130
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
implementorsOf: selector
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    selector ifNil:[^#()].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    ^SystemBrowser
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
        findImplementorsOf: selector
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
        in: Smalltalk allClasses
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
        ignoreCase: false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    "Created: / 26-12-2007 / 11:37:11 / janfrog"
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
sendersOf: selector
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ^SystemBrowser
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
        findSendersOf: selector
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        in: Smalltalk allClasses
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        ignoreCase: false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
    "Created: / 26-12-2007 / 11:37:22 / janfrog"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
!CodeNavigationService methodsFor:'event handling'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
button1Press
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    codeView syntaxElementSelection ifNil:[^self].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    codeView syntaxElementSelection type == #selector ifTrue:[^self button1PressForSelector: codeView syntaxElementSelection value].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    codeView syntaxElementSelection type == #class    ifTrue:[^self browseClass:codeView syntaxElementSelection value].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
    "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
   163
    "Modified: / 06-03-2010 / 21:11:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    | impls menu |
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    impls := self implementorsOf: selector.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    impls size = 1 ifTrue:[^self browseMethod: impls anyOne].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    menu := self implementorsMenu: impls selector: selector.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    self highlightClear.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    menu showAtPointer.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    "Created: / 14-02-2010 / 18:50:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
button2Press
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    | sel |
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    sel := codeView syntaxElementSelection.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    (sel notNil and:[sel type == #selector]) ifTrue:[^self button2PressForSelector: sel value].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
    "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
   185
    "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
   186
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
button2PressForSelector: selector
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    | senders menu |
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    senders := self implementorsOf: selector.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    senders size = 1 ifTrue:[^self browseMethod: senders anyOne].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    menu := self sendersMenu: senders selector: selector.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    self highlightClear.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    menu showAtPointer.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    "Created: / 14-02-2010 / 18:50:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
buttonMotion: button x:x y:y in: view
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    (view == textView and:[textView sensor ctrlDown]) ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
        [self highlightElementAtX:x y:y. ^true].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    ^false
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: / 06-03-2010 / 20:40:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
buttonPress: button x:x y:y in: view
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    (view == textView) ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
        [codeView sensor ctrlDown ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
            [button == 1      ifTrue: [self button1Press.^true].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
            button == #paste ifTrue: [self button2Press.^true].   
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
            button == 2      ifTrue: [self button2Press.^true]].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
        button == 1 ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
            self highlightVariableAtX:x y:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        ]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
        ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    ^false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    "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
   231
    "Modified: / 25-06-2010 / 14:53:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
keyPress:key x:x y:y in:view 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
    
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    (view == textView) ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
        (key == #'Control_L' or:[ key == #Ctrl ]) ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
            self highlightElementAtX:x y:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
            ^ true
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
        ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
        self highlightVariableAtCursor.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
        ^ false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    ].
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 / 20:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    "Modified: / 25-06-2010 / 14:46:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
keyRelease: key x:x y:y in: view
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
    "Handles an event in given view (a subview of codeView).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
     If the method returns true, the event will not be processed
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
     by the view."
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
    (view == textView and:[key == #'Control_L' or:[key == #Ctrl]]) ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
        [self highlightClear. textView redraw. ^true].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    ^false
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    "Created: / 06-03-2010 / 21:03:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
!CodeNavigationService methodsFor:'initialization'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
initialize
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    super initialize.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
    selectorEmphasis := self class defaultSelectorEmphasis.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
    variableEmphasis := self class defaultVariableEmphasis.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
    "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
   275
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
!CodeNavigationService methodsFor:'menus-dynamic'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
implementorsMenu: implementors selector: selector  
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    | menu|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
    menu := Menu new.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    implementors isNilOrEmptyCollection ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
        menu addItem:(MenuItem label:'No implementors found') disable
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
    ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
        menu addItem:(MenuItem 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
                    label:(selector storeString , (' (all implementors) ') asText allItalic)
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
                    value:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
                        self browseMethods:implementors
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
                            label:'Implementors of ' , selector storeString
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
                    ]).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
        menu addSeparator.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
        implementors do:[:mth | 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
            menu 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
                addItem:(MenuItem label:(selector storeString 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
                                , (' in ' , mth containingClass name asText allBold))
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
                        value:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
        ]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    ^ menu
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
sendersMenu: senders  selector: selector  
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    | menu|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
    menu := Menu new.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    senders isNilOrEmptyCollection ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
        menu addItem:(MenuItem label:'No senders found') disable
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
        menu addItem:(MenuItem 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
                    label:(selector storeString , (' (all senders)') asText allItalic)
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
                    value:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
                        self browseMethods:senders
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
                            label:'Senders of ' , selector storeString
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
                    ]).
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
        menu addSeparator.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
        senders do:[:mth | 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
            menu 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
                addItem:(MenuItem label:(mth selector storeString 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
                                , (' in ' , mth containingClass name asText allBold))
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
                        value:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
        ]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    ^ menu
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
    "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
    "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
    "Modified: / 01-08-2010 / 11:09:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
!CodeNavigationService methodsFor:'private'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
elementAtCursor
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
    ^self elementAtLine: textView cursorLine col: textView cursorCol - 1
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    "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
   340
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
elementAtLine:line col:col 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
    |characterPosition index element |
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
    characterPosition := textView characterPositionOfLine:line col:col.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
    index := SortedCollection binarySearch: (codeView syntaxElements) forIndexOf: characterPosition.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
    index > (codeView syntaxElements) size ifTrue:[^nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
    element := (codeView syntaxElements) at: index.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
    (characterPosition between: element start and: element stop) ifFalse:[^nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
    ^element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
    "Created: / 25-06-2010 / 14:40:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
elementAtX:x y:y 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
    |visibleLine line col|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
    codeView syntaxElements ifNil:[^nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
    visibleLine := textView visibleLineOfY:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
    col := textView colOfX:x inVisibleLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
    line := textView visibleLineToAbsoluteLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   362
    ^self elementAtLine:line col:col
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   363
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   364
    "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
   365
    "Modified: / 01-08-2010 / 08:50:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
highlighEmphasisFor: element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   369
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
    element ifNil:[^nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
    element type == #selector ifTrue:[^selectorEmphasis].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    element type == #variable ifTrue:[^variableEmphasis].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   374
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   375
    ^nil
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 / 13:54:42 / 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
highlightClear
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   381
    |textView|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   382
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   383
    codeView syntaxElementSelection == nil ifTrue:[^ self].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   384
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   385
    textView := codeView textView.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   386
    textView list ifNil:[ ^ self ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   387
    textView list do:[:line | 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   388
        line isText ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   389
            line emphasisAllRemove: currentEmphasis
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
        ]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   391
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   392
    textView redraw.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   393
    codeView syntaxElementSelection:nil.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   394
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   395
    "Modified: / 26-12-2007 / 12:28:05 / janfrog"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   396
    "Created: / 25-06-2010 / 14:15:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   397
    "Modified: / 30-06-2011 / 11:07:05 / cg"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   398
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   399
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   400
highlightElement: element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   401
    codeView syntaxElementSelection == element ifTrue:[^ self].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   402
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   403
    self highlightClear.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   404
    currentEmphasis := self highlighEmphasisFor: element.         
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   405
    element 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
       ifNotNil:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
            [|e|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
            codeView syntaxElementSelection: element.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   409
            e := element.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   410
            [e isNil] whileFalse:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   411
                [self highlightWithoutClearFrom: e start to: e stop.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   412
                e := e next].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   413
            e := element prev.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   414
            [e isNil] whileFalse:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   415
                [self highlightWithoutClearFrom: e start to: e stop.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   416
                e := e prev]].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    textView invalidate
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   419
    "Created: / 14-02-2010 / 16:18:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   420
    "Modified: / 25-06-2010 / 14:18:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   421
    "Modified: / 30-06-2011 / 11:06:42 / cg"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   422
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   423
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
highlightElementAtCursor
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   425
    self highlightElementAtLine: textView cursorLine col: textView cursorCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
    "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
   428
    "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
   429
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
highlightElementAtLine:line col:col 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
    |characterPosition index element |
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
    characterPosition := textView characterPositionOfLine:line col:col.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
    index := SortedCollection binarySearch: (codeView syntaxElements) forIndexOf: characterPosition.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
    index > (codeView syntaxElements) size ifTrue:[^self highlightElement: nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
    element := (codeView syntaxElements) at: index.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
    (characterPosition between: element start and: element stop) ifFalse:[^self highlightElement: nil].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    self highlightElement:element
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
    "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
   443
    "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
   444
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
highlightElementAtX:x y:y 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
    |visibleLine line col|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    codeView syntaxElements ifNil:[^self].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
    visibleLine := textView visibleLineOfY:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
    col := textView colOfX:x inVisibleLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    line := textView visibleLineToAbsoluteLine:visibleLine.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    self highlightElementAtLine:line col:col
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
    "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
   456
    "Modified: / 06-03-2010 / 20:06:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
highlightLine:lineNo fromLine:startLine col:endLine toLine:startCol col:endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    |line start end|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
    (lineNo between:startLine and:endLine) ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
        ^ self
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
    line := textView listAt:lineNo.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
    start := lineNo = startLine ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
                startCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   468
            ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   469
                line indexOfNonSeparator
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
            ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
    end := lineNo = endLine ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   472
                endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
            ] ifFalse:[ line size ].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
    line 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
        emphasisFrom:start
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
        to:end
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
        add: currentEmphasis
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
    "Created: / 25-06-2010 / 14:15:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
    "Modified: / 03-09-2010 / 22:39:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
highlightVariable:e 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
    (e notNil and:[ e type == #variable ]) ifTrue:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
        self highlightElement:e.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
    ] ifFalse:[
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
        self highlightClear.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
    ]
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   490
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
highlightVariableAtCursor
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
    |e|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
    e := self elementAtCursor.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
    self highlightVariable: e
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
    "Modified: / 25-06-2010 / 14:53:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
highlightVariableAtX:x y:y 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
    |e|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
    e := self elementAtX:x y:y.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
    self highlightVariable:e.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    "Created: / 25-06-2010 / 14:52:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
highlightWithoutClearFrom: start to: end
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
    "Remove underlined emphasis"
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
    |startLine startCol endLine endCol|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   514
    startLine := textView lineOfCharacterPosition:start.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
    startCol := start - (textView characterPositionOfLine:startLine col:1) + 1.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
    endLine := textView lineOfCharacterPosition:end.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
    endCol := end - (textView characterPositionOfLine:endLine col:1) + 1.
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
    self highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
    "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
   521
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
highlightWithoutClearFromLine: startLine col: startCol toLine: endLine col: endCol 
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
    textView list keysAndValuesDo:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
        [:lineNo :line|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
        |start end|
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
        line isText ifTrue:
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
            [self highlightLine: lineNo fromLine: startLine col: endLine toLine: startCol col: endCol]].
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
    "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
   532
! !
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
!CodeNavigationService class methodsFor:'documentation'!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
version_CVS
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeNavigationService.st,v 1.1 2011-07-01 13:20:03 cg Exp $'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
!
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
version_SVN
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
    ^ '§Id: Tools__CodeNavigationService.st 7788 2011-06-17 07:57:48Z vranyj1 §'
00b306851c88 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
! !