SmallSense__CodeNavigationService.st
author Claus Gittinger
Wed, 26 Feb 2014 19:28:14 +0100
changeset 176 df6d3225d1e4
parent 174 3e08d765d86f
parent 166 c7e0cc97c3f9
child 249 8bc64027b189
permissions -rw-r--r--
merge with 174
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'jv:smallsense' }"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: SmallSense }"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
Tools::CodeNavigationService subclass:#CodeNavigationService
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:'currentNodeHolder'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'SmallSense-Core-Services'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    12
Object subclass:#Navigator
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    13
	instanceVariableNames:'service button'
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    14
	classVariableNames:''
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    15
	poolDictionaries:''
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    16
	privateIn:CodeNavigationService
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    17
!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    18
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    19
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
!CodeNavigationService class methodsFor:'accessing'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
label
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
    "Answers a short label - for UI"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
    ^'SmallSense - Code Navigation'
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
    "Created: / 27-07-2013 / 22:46:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
    "Modified: / 23-09-2013 / 10:27:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    31
!CodeNavigationService methodsFor:'accessing'!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    32
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    33
browser
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    34
    ^ codeView browser.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    35
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    36
    "Created: / 24-09-2013 / 23:38:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    37
!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    38
148
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    39
codeView
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    40
    ^ codeView
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    41
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    42
    "Created: / 26-11-2013 / 22:58:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    43
!
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
    44
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    45
environment
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    46
    | browser |
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    47
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    48
    browser := self browser.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    49
    ^ browser notNil ifTrue:[browser environment] ifFalse:[Smalltalk]
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    50
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    51
    "Created: / 24-09-2013 / 23:38:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    52
! !
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
    53
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
!CodeNavigationService methodsFor:'event handling'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
button1Press
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
    | node |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
100
6d2fb43e661b Initial support for complete-as-you-type.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 99
diff changeset
    59
    node := currentNodeHolder value.
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    60
    node notNil ifTrue:[
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    61
        | navigator |
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    62
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    63
        navigator := Navigator new
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    64
                        service: self;
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    65
                        button: 1.
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    66
        navigator navigateTo: node.
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    67
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    68
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
    ^self.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    71
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    72
    "Created: / 14-02-2010 / 18:43:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    73
    "Modified: / 18-11-2011 / 14:58:02 / cg"
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
    74
    "Modified: / 24-09-2013 / 10:02:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
button1PressForMessageNode: node
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
    ^self button1PressForSelector: node parent selector.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
    "Created: / 21-02-2012 / 14:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
button1PressForVariableNode: node
149
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    85
    | name value |
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
149
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    87
    value := nil.
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    88
    node isGlobalVariable ifTrue:[
149
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    89
        name := node name asSymbolIfInterned.
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    90
        name notNil ifTrue:[
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    91
            value := Smalltalk at: node name asSymbol.
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
    92
        ].
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    93
        value notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    94
            value isBehavior ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    95
                self browseClass: value.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    96
            ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    97
                value inspect.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    98
            ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    99
        ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   100
    ]
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   101
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   102
    "Created: / 21-02-2012 / 14:30:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
149
751b7d697444 Fix in SmallSense::CodeNavigationService>>#button1PressForVariableNode: make sure symbol is passed to Smalltalk>>at:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 148
diff changeset
   103
    "Modified: / 06-12-2013 / 15:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   104
!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   105
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   106
button2Press
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   107
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   108
    | sel |
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   109
    sel := codeView syntaxElementSelection.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   110
    (sel notNil and:[sel node isMessage]) ifTrue:[^self button2PressForSelector: sel node selector].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   111
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   112
    "Created: / 14-02-2010 / 18:43:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   113
    "Modified: / 08-03-2012 / 16:49:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   114
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   115
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   116
!CodeNavigationService methodsFor:'initialization'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   117
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   118
initialize
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   119
    "Invoked when a new instance is created."
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   120
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   121
    "/ please change as required (and remove this comment)
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   122
    "/ 
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   123
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   124
    super initialize.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   125
    currentNodeHolder := ValueHolder new.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   126
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   127
    "Modified: / 23-09-2013 / 03:51:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   128
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   129
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   130
!CodeNavigationService methodsFor:'private'!
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   131
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   132
highlightElement:element
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   133
    super highlightElement:element.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   134
    element notNil ifTrue:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   135
        currentNodeHolder value: element node.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   136
    ] ifFalse:[
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   137
        currentNodeHolder value: nil.
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   138
    ].
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   139
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   140
    "Created: / 23-09-2013 / 03:52:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   141
!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   142
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   143
showMenu: menu
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   144
    menuShown := menu.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   145
    menuShown notNil ifTrue:[
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   146
        menuShown showAtPointer
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   147
    ].
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   148
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   149
    "Created: / 24-09-2013 / 23:43:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
99
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   150
! !
6943778c2db7 SyntaxHighlightingService renamed to CodeHighlightingService to match those in tools.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
   151
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   152
!CodeNavigationService::Navigator methodsFor:'accessing'!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   153
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   154
browser
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   155
    ^ service browser
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   156
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   157
    "Created: / 24-09-2013 / 23:37:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   158
!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   159
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   160
button
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   161
    ^ button
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   162
!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   163
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   164
button:something
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   165
    button := something.
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   166
!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   167
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   168
environment
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   169
    ^ service environment
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   170
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   171
    "Created: / 24-09-2013 / 23:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   172
!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   173
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   174
service
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   175
    ^ service
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   176
!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   177
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   178
service:something
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   179
    service := something.
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   180
! !
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   181
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   182
!CodeNavigationService::Navigator methodsFor:'navigation'!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   183
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   184
navigateTo: node
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   185
    node navigateToUsing: self
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   186
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   187
    "Created: / 24-09-2013 / 10:03:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   188
! !
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   189
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   190
!CodeNavigationService::Navigator methodsFor:'navigation - Java'!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   191
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   192
navigateToMessageSend: node
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   193
    | binding className selector toolbox |
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   194
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   195
    binding := node binding .
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   196
    binding isNil ifTrue:[ ^ nil ].
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   197
    className := binding declaringClass compoundName asStringWith: $/.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   198
    selector := binding selector , binding signature.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   199
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   200
    toolbox := JavaToolbox new
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   201
                browser: self browser;
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   202
                environment: self environment;
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   203
                yourself.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   204
    button == 1 ifTrue:[
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   205
         service showMenu: (toolbox implementorMenuFor: selector inClassNamed: className).
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   206
         ^ self.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   207
    ].
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   208
    button == 1 ifTrue:[
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   209
         service showMenu: (toolbox sendersMenuFor: selector inClassNamed: className).
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   210
         ^ self.
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   211
    ].
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   212
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   213
    "Created: / 24-09-2013 / 23:10:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   214
    "Modified: / 25-09-2013 / 10:01:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   215
!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   216
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   217
navigateToTypeReference: node
166
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   218
    | classType className classes |
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   219
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   220
    classType := node resolvedType.
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   221
    classType notNil ifTrue:[
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   222
        className := node resolvedType leafComponentType compoundName asStringWith: $/.
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   223
    ] ifFalse:[ 
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   224
        | unit |
106
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   225
166
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   226
        unit := service codeView syntaxElements tree.
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   227
        "/ Search imports...
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   228
        unit imports do:[:import | 
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   229
            import tokens last = node token ifTrue:[ 
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   230
                className := import tokens asStringWith:$/.
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   231
            ].
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   232
        ].
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   233
        "/ If not imported, Try compilation unit's package...
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   234
        className isNil ifTrue:[ 
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   235
            className := (unit currentPackage tokens asStringWith: $/) , '/' , node token.
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   236
        ].
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   237
    ].
130
1274cc0394cb SmallSense::CodeNavigationService - fix for new Java class naming scheme
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   238
    "/ Kludge - support both old and new Java class naming scheme
1274cc0394cb SmallSense::CodeNavigationService - fix for new Java class naming scheme
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   239
    classes := (JavaClass canUnderstand: #binaryName) 
1274cc0394cb SmallSense::CodeNavigationService - fix for new Java class naming scheme
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   240
                    ifTrue:[self environment allClasses select:[:cls | cls isJavaClass and:[cls binaryName = className]]]
1274cc0394cb SmallSense::CodeNavigationService - fix for new Java class naming scheme
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   241
                    ifFalse:[self environment allClasses select:[:cls | cls isJavaClass and:[cls name = className]]].
1274cc0394cb SmallSense::CodeNavigationService - fix for new Java class naming scheme
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 106
diff changeset
   242
106
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   243
    classes isEmpty ifTrue:[
148
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
   244
        service codeView textView flash.
b06bb9f85971 Fixes for Java - flash code view when CTRL-click on type name which could not be resolved.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 133
diff changeset
   245
        ^ self.
106
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   246
    ].
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   247
    classes size == 1 ifTrue:[
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   248
        service browseClass: classes anElement.    
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   249
        ^ self.
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   250
    ].
1ab781eac004 Even more support for Java
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 105
diff changeset
   251
    self halt: 'Not yet supported'.
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   252
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   253
    "Created: / 24-09-2013 / 10:16:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
166
c7e0cc97c3f9 Small fix in code navigation for Java.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 149
diff changeset
   254
    "Modified: / 15-02-2014 / 23:27:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
102
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   255
! !
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   256
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   257
!CodeNavigationService::Navigator methodsFor:'navigation - Smalltalk'!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   258
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   259
navigateToMessageNode: node
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   260
    "/ Implementors
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   261
    button == 1 ifTrue:[
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   262
        "/ Use legacy code...
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   263
        service button1PressForSelector: node selector.         
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   264
        ^ self
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   265
    ].
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   266
    button == 2 ifTrue:[
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   267
        "/ Use legacy code...
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   268
        service button2PressForSelector: node selector.         
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   269
        ^ self                                                  
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   270
    ].
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   271
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   272
    "Created: / 24-09-2013 / 10:06:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   273
!
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   274
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   275
navigateToVariableNode: node
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   276
    "/ Use legacy code for now...
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   277
    button == 1 ifTrue:[
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   278
        service button1PressForVariableNode: node .         
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   279
    ]
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   280
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   281
    "Created: / 24-09-2013 / 10:06:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   282
! !
538fc4ef040c CodeNavigation service refactored to support Java (not yet done, though)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 100
diff changeset
   283
105
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   284
!CodeNavigationService class methodsFor:'documentation'!
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   285
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   286
version_HG
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   287
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   288
    ^ '$Changeset: <not expanded> $'
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   289
! !
d925e1672ac7 Initial support for senders/implementors menu for Java invocations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 102
diff changeset
   290