Tools__CodeView2.st
author Jan Vrany <jan.vrany@labware.com>
Thu, 06 May 2021 09:04:23 +0100
branchjv
changeset 19599 b49de95fc5a5
parent 18226 346376844040
child 19601 e9573cd4c02a
permissions -rw-r--r--
Flush session changes after a package has been filed out to Tonel repository ...so modified (and filed-out) classes won't show up as modified in tools. This follows the behavior of a regular commit when using CVS or Mercurial.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
18226
346376844040 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17998
diff changeset
     3
 COPYRIGHT (c) 2015-2018 Jan Vrany
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     4
              All Rights Reserved
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     5
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     6
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     7
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     8
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     9
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    10
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    11
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    12
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    13
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    14
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    15
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    16
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    17
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    18
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    19
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    20
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    21
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    22
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    23
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    24
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    25
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"{ Package: 'stx:libtool' }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
"{ NameSpace: Tools }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
SimpleView subclass:#CodeView2
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    32
	instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    33
		classHolder browserHolder codeAspect modifiedChannel
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    34
		showGutterChannel showAcceptCancelBarChannel modeHolder services
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    35
		servicesFromClient syntaxElements currentParseNodeHolder
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    36
		currentBlockNodeHolder syntaxElementSelection highlightEmphasis
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    37
		diffMode synchronizedCodeViews'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    38
	classVariableNames:'TraceSelectors'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    39
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    40
	category:'Interface-CodeView'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    43
AbstractBackground subclass:#AnnotationShowingScrollerBackground
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
    44
	instanceVariableNames:'annotations breakpoints textView'
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    45
	classVariableNames:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    46
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    47
	privateIn:CodeView2
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    48
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    49
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
SimpleView subclass:#GutterView
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    51
	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    52
		widthAnnotations widthDiffInfo numberOfLines acceptColor
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    53
		cancelColor diffColor menuHolder currentBlockNodeHolder
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    54
		showLineNumbers blockWaitingForPossibleDoubleClick'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    55
	classVariableNames:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    56
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    57
	privateIn:CodeView2
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
CodeView subclass:#TextView
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    61
	instanceVariableNames:'listOriginal codeView gutterView diffMode deletedLines
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    62
		insertedLines lastFirstLine changedLines scrollInProgress
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    63
		originDiffText emptyLines changedDiffText suppressNotifications
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    64
		reallyModifiedChannel'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    65
	classVariableNames:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    66
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    67
	privateIn:CodeView2
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
copyright
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    74
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
18226
346376844040 Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17998
diff changeset
    75
 COPYRIGHT (c) 2015-2018 Jan Vrany
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    76
              All Rights Reserved
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    77
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    78
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    79
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    80
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    81
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    82
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    83
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    84
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    85
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    86
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    87
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    88
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    89
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    90
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    91
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    92
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    93
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    94
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    95
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    96
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    97
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
!CodeView2 class methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    "Invoked at system start or when the class is dynamically loaded."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    "/ please change as required (and remove this comment)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    TraceSelectors := IdentitySet new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "Modified: / 14-02-2010 / 15:36:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!CodeView2 class methodsFor:'debugging'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
trace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    TraceSelectors add: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "Created: / 14-02-2010 / 09:26:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
untrace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    TraceSelectors remove: aSelector ifAbsent:[]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    "Created: / 14-02-2010 / 09:50:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
untraceAll
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    TraceSelectors := IdentitySet new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    "Created: / 14-02-2010 / 09:53:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!CodeView2 class methodsFor:'examples'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
example1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
    | window codeView |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    window := StandardSystemView new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    window extent: 300 @ 300.              
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    window label: 'CodeView2 example1'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    codeView := Tools::CodeView2 in: window.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
    codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
        origin: 0.1 @ 0.1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
        corner: 0.9 @ 0.9.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    window open.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    "Created: / 02-09-2009 / 21:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
!CodeView2 class methodsFor:'menu specs'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   160
debugMenu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   161
    "This resource specification was automatically generated
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   162
     by the MenuEditor of ST/X."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   163
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   164
    "Do not manually edit this!! If it is corrupted,
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   165
     the MenuEditor may not be able to read the specification."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   166
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   167
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   168
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   169
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   170
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   171
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   172
    <resource: #menu>
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   173
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   174
    ^ 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   175
     #(Menu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   176
              (
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   177
               (MenuItem
16613
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   178
                  label: 'Inspect View'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   179
                  itemValue: inspectView
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   180
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   181
                )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   182
               (MenuItem
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   183
                  label: 'Inspect Syntax Elements'
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   184
                  itemValue: inspectSyntaxElements
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   185
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   186
                )
16613
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   187
"/               (MenuItem
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   188
"/                  label: 'Inspect Selected Selector'
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   189
"/                  itemValue: inspectSelectedSelector
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   190
"/                  translateLabel: true
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   191
"/                )
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   192
               )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   193
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   194
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   195
            )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   196
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   197
    "Created: / 08-07-2011 / 13:36:02 / cg"
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   198
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   199
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "This resource specification was automatically generated
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
     by the MenuEditor of ST/X."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    "Do not manually edit this!! If it is corrupted,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
     the MenuEditor may not be able to read the specification."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   212
    UserPreferences current eclipseStyleMenus ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   213
        ^ self editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   214
    ].
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   215
    ^ self editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   216
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   217
    "Modified: / 08-07-2011 / 13:23:35 / cg"
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   218
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   219
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   220
editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   221
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   222
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   223
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   224
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   225
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   226
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   227
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   228
    "
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   229
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_eclipseStyle
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   230
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   231
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   232
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    <resource: #menu>
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   235
    ^ 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
     #(Menu
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   237
        (
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   238
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   239
            label: 'Implementors...'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   240
            itemValue: browseImplementorsOfIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   241
            isVisible: hasLanguageToolbox
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   242
            submenuChannel: implementorsMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   243
            shortcutKey: ImplementorsOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   244
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   245
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   246
            label: 'Senders...'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   247
            itemValue: browseSendersOfIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   248
            isVisible: hasLanguageToolbox
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   249
            submenuChannel: sendersMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   250
            shortcutKey: SendersOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   251
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   252
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   253
            label: 'Refactor'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   254
            nameKey: refactor
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   255
            isVisible: false
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   256
            shortcutKey: Shift
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   257
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   258
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   259
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   260
            isVisible: hasLanguage
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   261
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   262
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   263
            enabled: canAccept
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   264
            label: 'Accept'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   265
            itemValue: accept
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   266
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   267
            shortcutKey: Accept
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   268
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   269
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   270
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   271
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   272
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   273
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   274
            enabled: canCut
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   275
            label: 'Cut'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   276
            itemValue: cut
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   277
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   278
            shortcutKey: Cut
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   279
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   280
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   281
            enabled: hasSelectionForCopy
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   282
            label: 'Copy'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   283
            itemValue: copySelection
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   284
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   285
            shortcutKey: Copy
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   286
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   287
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   288
            enabled: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   289
            label: 'Paste'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   290
            itemValue: pasteOrReplace
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   291
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   292
            shortcutKey: Paste
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   293
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   294
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   295
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   296
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   297
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   298
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   299
            enabled: hasUndoAction
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   300
            label: 'Undo'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   301
            itemValue: undo
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   302
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   303
            shortcutKey: Undo
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   304
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   305
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   306
            enabled: hasRedoAction
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   307
            label: 'Redo'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   308
            itemValue: redo
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   309
            isVisible: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   310
            shortcutKey: Redo
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   311
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   312
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   313
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   314
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   315
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   316
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   317
            label: 'Do it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   318
            itemValue: doIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   319
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   320
            shortcutKey: DoIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   321
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   322
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   323
            label: 'Print it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   324
            itemValue: printIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   325
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   326
            shortcutKey: PrintIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   327
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   328
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   329
            label: 'Inspect it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   330
            itemValue: inspectIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   331
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   332
            shortcutKey: InspectIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   333
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   334
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   335
            label: 'Profile it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   336
            itemValue: profileIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   337
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   338
            shortcutKey: InspectIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   339
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   340
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   341
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   342
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   343
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   344
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   345
            label: 'Show Gutter'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   346
            nameKey: ShowGutter
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   347
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   348
            indication: showGutterChannel
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   349
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   350
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   351
            label: 'More'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   352
            nameKey: More
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   353
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   354
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   355
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   356
            label: 'Services'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   357
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   358
            submenuChannel: servicesMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   359
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   360
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   361
            label: 'Debug'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   362
            isVisible: true
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   363
            submenuChannel: debugMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   364
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   365
         )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   366
        nil
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   367
        nil
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
      )
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   369
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   370
    "Modified: / 06-02-2018 / 20:09:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   371
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   372
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   373
editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   374
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   375
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   376
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   377
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   378
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   379
11241
e3d6bdc7a790 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11220
diff changeset
   380
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   381
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   382
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   383
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   384
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   385
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   386
    <resource: #menu>
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   387
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   388
    ^ 
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   389
     #(Menu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   390
        (
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   391
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   392
            enabled: hasUndoAction
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   393
            label: 'Undo'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   394
            itemValue: undo
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   395
            isVisible: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   396
            shortcutKey: Undo
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   397
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   398
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   399
            enabled: canDoAgain
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   400
            label: 'Again'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   401
            itemValue: again
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   402
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   403
            shortcutKey: Again
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   404
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   405
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   406
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   407
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   408
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   409
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   410
            enabled: canCut
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   411
            label: 'Cut'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   412
            itemValue: cut
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   413
            isVisible: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   414
            shortcutKey: Cut
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   415
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   416
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   417
            enabled: hasSelectionForCopy
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   418
            label: 'Copy'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   419
            itemValue: copySelection
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   420
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   421
            shortcutKey: Copy
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   422
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   423
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   424
            label: 'Paste'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   425
            itemValue: pasteOrReplace
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   426
            isVisible: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   427
            shortcutKey: Paste
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   428
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   429
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   430
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   431
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   432
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   433
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   434
            label: 'DoIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   435
            itemValue: doIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   436
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   437
            shortcutKey: DoIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   438
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   439
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   440
            label: 'PrintIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   441
            itemValue: printIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   442
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   443
            shortcutKey: PrintIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   444
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   445
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   446
            label: 'InspectIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   447
            itemValue: inspectIt
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   448
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   449
            shortcutKey: InspectIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   450
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   451
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   452
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   453
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   454
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   455
         (MenuItem
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   456
            enabled: canAccept
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   457
            label: 'Accept'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   458
            itemValue: accept
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   459
            isVisible: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   460
            shortcutKey: Accept
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   461
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   462
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   463
            label: '-'
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   464
            isVisible: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   465
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   466
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   467
            label: 'Refactor'
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   468
            nameKey: refactor
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   469
            isVisible: false
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   470
            shortcutKey: Shift
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   471
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   472
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   473
            label: 'Services'
11241
e3d6bdc7a790 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11220
diff changeset
   474
            isVisible: false
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   475
            submenuChannel: servicesMenu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   476
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   477
         (MenuItem
11353
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   478
            label: '='
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   479
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   480
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   481
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   482
            label: 'More'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   483
            nameKey: More
17998
04e977f44a35 `CodeView2`: do not who menu items related to editing when view is read-only.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17763
diff changeset
   484
            isVisible: true
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   485
            shortcutKey: Ctrl
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   486
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   487
         )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   488
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   489
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   490
      )
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   491
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
!CodeView2 methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   494
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
acceptAction:aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   496
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   497
    textView acceptAction: aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
    "Modified: / 01-08-2010 / 20:40:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   501
16968
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   502
acceptEnabled:aBoolean
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   503
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   504
    textView acceptEnabled:aBoolean
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   505
!
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   506
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   507
breakpoints
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   508
    |s|
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   509
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   510
    (s := self breakpointService) notNil ifTrue:[
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   511
        ^ s breakpoints
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   512
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   513
    ^ nil
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   514
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   515
    "Created: / 06-07-2011 / 18:05:35 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   516
    "Modified: / 06-10-2011 / 14:13:53 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   517
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   518
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   519
browser
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   520
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   521
    ^self browserHolder value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   522
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   523
    "Created: / 07-07-2011 / 12:25:59 / Jan Vrany <jan.vrant@fit.cvut,cz>"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   524
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   525
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
codeAspect
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   527
    ^ textView codeAspect
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   528
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   529
    "Modified: / 27-07-2012 / 22:22:27 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   530
    "Modified: / 27-09-2013 / 10:01:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   533
codeAspect: aSymbol
14638
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   534
    "tell the textView what is shown, so it can adjust the
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   535
     syntaxhighlighter.
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   536
     See SyntaxHighlighter codeAspectXXX for possible aspects."
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   537
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   538
    ^ textView codeAspect: aSymbol
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   539
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   540
    "Modified: / 27-07-2012 / 22:32:19 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   541
    "Modified: / 27-09-2013 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   544
compilerClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   545
    ^textView compilerClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   546
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   547
    "Created: / 10-05-2012 / 23:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   548
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   549
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   550
compilerClass: aClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   551
    textView compilerClass: aClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   552
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   553
    "Created: / 10-05-2012 / 23:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   554
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   555
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
    ^textView contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
    "Created: / 14-02-2010 / 22:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
contents: aStringOrStringCollection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
    textView contents: aStringOrStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
    "/self update:#value with: aStringOrStringCollection from: textView model
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
10330
212b120c198f Improvements in diffing tools
vrany
parents: 10326
diff changeset
   568
    "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   571
contents: aStringOrStringCollection clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   572
    "Set the contents. If clearPrevous is true, then
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   573
     previous original text is cleared and set to given one.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   574
     (so the text is considered not modified)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   575
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   576
    textView contents: aStringOrStringCollection clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   577
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   578
    "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   579
    "Created: / 17-02-2012 / 00:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   580
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   581
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   582
currentParseNode
14101
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   583
    |sel|
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   584
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   585
    sel := self syntaxElementSelection.
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   586
    sel isNil ifTrue:[^ nil].
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   587
    ^ sel node
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   588
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   589
    "Created: / 21-02-2012 / 14:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14057
94bd4556cf5d Fixes in CodeNavigationService - semi-modal navigation should work again.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14050
diff changeset
   590
    "Modified: / 25-02-2014 / 22:06:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   591
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   592
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   593
delegate: anObject
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   594
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   595
    super delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   596
    self textView delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   597
    self gutterView delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   598
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   599
    "Created: / 11-05-2012 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   600
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   601
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
diffMode:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
    diffMode := aBoolean.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   608
    textView diffMode: aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   610
    "Modified: / 08-04-2011 / 20:50:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   611
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
14194
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   613
editedLanguage: aProgrammingLanguage
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   614
    self languageHolder value: aProgrammingLanguage
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   615
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   616
    "Created: / 09-04-2014 / 14:49:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   617
!
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   618
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   619
editedMethodOrClass:aMethodOrClass
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   620
    textView editedMethodOrClass:aMethodOrClass.
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   621
    aMethodOrClass isBehavior ifFalse:[
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   622
        self methodHolder value:aMethodOrClass
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   623
    ].
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   624
!
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   625
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   627
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
    ^textView font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   629
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   630
    "Created: / 16-02-2010 / 10:26:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   631
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   632
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   633
font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   634
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   635
    ^textView font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   636
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   637
    "Created: / 16-02-2010 / 10:26:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   638
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   639
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
mode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
    ^self modeHolder value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
    "Created: / 13-06-2011 / 10:49:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
mode: aSymbol
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   648
    "is this the same as codeAspect ?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   649
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
    self assert: (#(expression method) includes: aSymbol).    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   651
    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   652
    ^self modeHolder value: aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
    "Created: / 13-06-2011 / 10:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
    "Modified: / 15-06-2011 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   656
    "Modified (comment): / 27-07-2012 / 22:19:49 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   659
model
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   660
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   661
    ^textView model.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   662
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   663
    "Created: / 27-07-2011 / 12:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   664
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   665
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   666
model: aValueModel
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   667
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   668
    |oldValue newValue|
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   669
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   670
    textView model notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   671
        oldValue := textView model value.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   672
        textView model removeDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   673
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   674
    textView model: aValueModel.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   675
    textView model notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   676
        textView model addDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   677
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   678
    newValue := textView model value.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   679
    oldValue ~~ newValue ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   680
        self update:#value with:newValue from:textView model.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   681
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   682
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   683
    "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   684
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   685
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   686
modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   687
    "return true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   688
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   689
    ^ self modifiedChannel value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   690
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   691
    "Modified: / 07-07-2011 / 12:15:43 / Jan Vrany <jan.vrant@fit.cvut,cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   693
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
modified:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
    "set/clear the modified flag"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   697
    self modifiedChannel value:aBoolean
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   698
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   699
    "Modified: / 14-02-1997 / 16:44:05 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   700
    "Modified: / 07-07-2011 / 12:15:39 / Jan Vrany <jan.vrant@fit.cvut,cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   703
services
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   704
    ^ services ? #()
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   705
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   706
    "Created: / 05-08-2011 / 10:14:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   707
    "Modified (format): / 06-10-2011 / 14:11:11 / cg"
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   708
!
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   709
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   710
services:aCollectionOfServices
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   711
    "allow setting of the services (instances);
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   712
     this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   713
     services"
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   714
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   715
    services notEmptyOrNil ifTrue:[ 
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   716
        services do:[:service | service unregister ].
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   717
        services := #().
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   718
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   719
    servicesFromClient := true.
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   720
    services := aCollectionOfServices.
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   721
    services notEmptyOrNil ifTrue:[ 
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   722
        services do:[:service | service registerIn: self ].
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   723
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   724
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   725
    "Created: / 06-10-2011 / 14:15:36 / cg"
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   726
    "Modified: / 13-06-2014 / 14:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   727
!
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   728
14519
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   729
servicesFromClient
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   730
    ^ servicesFromClient ? false
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   731
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   732
    "Modified: / 17-06-2014 / 10:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   733
!
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   734
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   735
showAcceptCancelBar
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   736
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   737
    ^showAcceptCancelBarChannel value
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   738
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   739
    "Created: / 10-10-2011 / 16:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   740
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   741
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
showGutter
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
    ^showGutterChannel value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
    "Created: / 23-06-2010 / 19:37:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
synchronizeWith: aCodeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
    self assert: aCodeView ~= self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
    (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
    synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   757
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   758
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   759
unsynchronizeWith: aCodeView
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   760
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   761
    self assert: aCodeView ~= self.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   762
    (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   763
    synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   764
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   765
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   766
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   767
    "Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
14050
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   770
!CodeView2 methodsFor:'accessing-behavior'!
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   771
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   772
readOnly:aBoolean
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   773
    "ignored here; present for compatibility with some textView subclasses,
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   774
     so that UIPainter can handle it in its TextView spec (which contains a
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   775
     readOnly field)"
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   776
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   777
    super readOnly:aBoolean.
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   778
    textView readOnly: aBoolean. 
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   779
    gutterView readOnly: aBoolean.
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   780
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   781
    "Created: / 21-02-2014 / 11:45:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   782
! !
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   783
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
   784
!CodeView2 methodsFor:'accessing-code component'!
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   785
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   786
klass
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   787
    "the class or the class of the method being shown."
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   788
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   789
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   790
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   791
    (v := self classHolder value) notNil ifTrue:[^v].
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   792
    (v := self method) notNil ifTrue:[^v mclass].
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   793
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   794
    ^nil
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   795
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   796
    "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   797
    "Modified: / 22-07-2013 / 13:34:05 / cg"
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
   798
!
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   799
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   800
klass: aClass
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   801
    "the class or the class of the method being shown"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   802
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   803
    "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   804
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   805
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   806
language
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   807
    "return the value in 'languageHolder', the programmingLanguage of the class
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   808
     or method being shown.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   809
     BAD name: confusion with the national language.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   810
     why not call this 'programmingLanguage' ?"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   811
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   812
    | v m c |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   813
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   814
    (v := self languageHolder value) notNil ifTrue:[^v].
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   815
    (m := self method) notNil ifTrue:[^m programmingLanguage].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   816
    (c := self classHolder value) notNil ifTrue:[^c programmingLanguage].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   817
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   818
    "/No, no default language, please (for workspaces, etc.).
10967
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   819
    "/^SmalltalkLanguage instance
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   820
    ^nil
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   821
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   822
    "Modified: / 07-12-2011 / 16:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   823
    "Modified: / 22-07-2013 / 13:34:17 / cg"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   824
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   825
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   826
language: newValue
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   827
    "set the value in 'languageHolder', the programmingLanguage of the class
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   828
     or method being shown.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   829
     BAD name: confusion with the national language.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   830
     why not call this 'programmingLanguage' ?"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   831
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   832
    self languageHolder value: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   833
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   834
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   835
method
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   836
    "the method being shown, or nil"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   837
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   838
    ^self methodHolder value
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   839
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   840
    "Created: / 27-07-2011 / 13:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   841
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   842
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   843
method: aMethod
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   844
    "the method being shown, or nil"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   845
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   846
    ^self methodHolder value: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   847
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   848
    "Created: / 27-07-2011 / 13:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   849
! !
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   850
15875
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   851
!CodeView2 methodsFor:'accessing-look'!
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   852
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   853
backgroundColor:aColor
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   854
    textView backgroundColor:aColor
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   855
!
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   856
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   857
viewBackground:newViewBackground
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   858
    textView viewBackground:newViewBackground
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   859
! !
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   860
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
!CodeView2 methodsFor:'aspects'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   862
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
browserHolder
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
   864
    browserHolder isNil ifTrue:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
        browserHolder := ValueHolder new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
    ^browserHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
    "Modified: / 14-02-2010 / 19:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
   870
    "Modified: / 18-11-2011 / 14:58:15 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   871
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
browserHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    browserHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
    "return/create the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
    classHolder isNil ifTrue:[
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   881
        classHolder := ValueHolder with: nil.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
    ^ classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   886
    "Modified: / 27-07-2011 / 13:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
classHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
    "set the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
        oldValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   896
        classHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
    ].
14521
6625c6f46bf3 Fixed stupid bug in CodeVIew2>>classHolder: - send correct old classHolder with change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14520
diff changeset
   898
    old := classHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
    classHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   903
    newValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
        self update:#value with:newValue from:classHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
    self changed: #classHolder with: old -> classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
14521
6625c6f46bf3 Fixed stupid bug in CodeVIew2>>classHolder: - send correct old classHolder with change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14520
diff changeset
   910
    "Modified: / 17-06-2014 / 13:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   913
currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   914
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   915
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   916
    currentBlockNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   917
        currentBlockNodeHolder := ValueHolder new.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   918
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   919
    ^ currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   920
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   921
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   922
currentBlockNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   923
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   924
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   925
    currentBlockNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   926
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   927
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   928
currentParseNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   929
    "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   930
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   931
    currentParseNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   932
        currentParseNodeHolder := ValueHolder new.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   933
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   934
    ^ currentParseNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   935
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   936
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   937
currentParseNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   938
    "set the 'currentParseNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   939
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   940
    currentParseNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   941
    gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   942
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   943
    "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   944
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   945
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
    languageHolder isNil ifTrue:[
17039
8ba8072d1b4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16968
diff changeset
   948
        "/ cg: I don't like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   949
        "/ has to explicitely clear the valueholder. I guess, it is better for the few
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   950
        "/ others to explicitely set it, if they do not provide syntaxHighlighter per method
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   951
        "/ or class.
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   952
        languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
    ^ languageHolder
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   956
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
   957
    "Modified: / 19-07-2012 / 16:51:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   959
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   960
languageHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
    "set the 'languageHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   962
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   963
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   964
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
        oldValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
        languageHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
    languageHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    old := languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
    newValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
        self update:#value with:newValue from:languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   979
    self changed: #languageHolder with: old -> languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
    "Modified: / 17-06-2011 / 12:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
   982
    "Modified: / 19-07-2012 / 16:51:08 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   983
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   984
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
    "return/create the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
    methodHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
        methodHolder := ValueHolder new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   990
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
    ^ methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
methodHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
    "set the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1000
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1001
        oldValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1002
        methodHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1004
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1005
    methodHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1006
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1007
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1008
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
    newValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1010
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
        self update:#value with:newValue from:methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
    self changed: #methodHolder with: old -> methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1016
    "Modified: / 17-06-2011 / 12:55:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1017
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1018
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1019
modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1020
    "return/create the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1021
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
  1022
    "is this the codeAspect?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1023
    modeHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1024
        modeHolder := #expression asValue.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1025
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1026
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
    ^ modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
    "Modified: / 13-06-2011 / 10:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
  1030
    "Modified (comment): / 27-07-2012 / 22:22:19 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
modeHolder:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
    "set the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1036
    |oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
        oldValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
        modeHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1041
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1042
    modeHolder := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
    newValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1047
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1048
        self update:#value with:newValue from:modeHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1049
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1050
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1051
    self changed: #modeHolder with: modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1052
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1053
    "Modified: / 17-06-2011 / 12:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1054
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
!CodeView2 methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
update:aspect with:param from:sender
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1059
    sender == methodHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1060
        textView editedMethodOrClass: methodHolder value.
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1061
    ].
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1062
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1063
    sender == classHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1064
        methodHolder value isNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1065
            textView editedMethodOrClass: classHolder value.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1066
        ].
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1067
    ].
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1068
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1069
    sender == languageHolder ifTrue:[
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  1070
        "/ languageHolder value class == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  1071
        "/ languageHolder value  == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1072
        textView editedLanguage: languageHolder value.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1073
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1074
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1075
    sender == modeHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1076
        codeAspect := modeHolder value
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1077
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1079
    sender == showGutterChannel ifTrue: [
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1080
        self updateGutterVisibility.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1081
        ^self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1082
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1084
    services do:[:each |
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1085
        each isEnabled ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1086
            each update:aspect with:param from:sender
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1087
        ]
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1088
    ].
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1089
    "/ self updateScrollersViewBackground.
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1090
    
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
    super update:aspect with:param from:sender
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1093
    "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1094
    "Modified: / 06-10-2011 / 14:14:36 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1095
    "Modified: / 27-09-2013 / 10:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1098
updateGutter
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1099
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1100
    self showGutterChannel value ifTrue:[        
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1101
        gutterView invalidate.
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1102
    ]
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1103
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1104
    "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1105
!
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1106
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
updateGutterVisibility
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
    self showGutterChannel value ifTrue:[        
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
        textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
        gutterView beVisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
    ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
        textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
        gutterView beInvisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
    "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1118
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1119
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1120
updateScrollersViewBackground
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1121
    "this changes the scroller's background, to show the positions of
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1122
     warnings, for easy location of interesting spots"
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1123
     
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1124
    |allAnnotations allBreakpoints scroller newBackground verticalScrollBar|
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1125
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1126
    allAnnotations := OrderedCollection new.
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1127
    allBreakpoints := OrderedCollection new.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1128
    services do:[:eachService |
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1129
        allAnnotations addAll:(eachService annotations ? #()).
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1130
        eachService isBreakpointService ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1131
            allBreakpoints addAll:(eachService breakpoints ? #()).
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1132
        ].    
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1133
    ].
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1134
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1135
    verticalScrollBar := textViewScroller verticalScrollBar.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1136
    verticalScrollBar notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1137
        scroller := verticalScrollBar thumb.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1138
    ].
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1139
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1140
    (allAnnotations isEmpty and:[allBreakpoints isEmpty]) ifTrue:[
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1141
        "/ nothing special to show
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1142
        scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1143
            scroller viewBackground isColor ifTrue:[^ self].
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1144
            scroller initStyle
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1145
        ].
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1146
    ] ifFalse:[
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1147
        "/ yep, there are some annotations
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1148
        newBackground := AnnotationShowingScrollerBackground new.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1149
        newBackground textView:textView.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1150
        newBackground annotations:allAnnotations; breakpoints:allBreakpoints.
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1151
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1152
        scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1153
            scroller viewBackground:newBackground.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1154
        ].
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1155
    ].
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1156
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1157
    scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1158
        scroller invalidate.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1159
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
!CodeView2 methodsFor:'channels'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
modifiedChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
    "return the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1167
    ^ textView modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1168
"/    ^ modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1169
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1170
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
modifiedChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1176
    textView modifiedChannel removeDependent:self.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1177
    textView modifiedChannel:aValueHolder.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1178
    textView modifiedChannel addDependent:self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1179
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1180
"/    |prev|
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1181
"/
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1182
"/    prev := modifiedChannel.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1183
"/    modifiedChannel := aValueHolder.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1184
"/    self setupChannel:aValueHolder for:nil withOld:prev
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1185
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1186
    "Created: / 30-01-1998 / 14:51:32 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1187
    "Modified: / 07-07-2011 / 12:07:43 / Jan Vrany <jan.vrant@fit.cvut,cz>"
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1188
    "Modified: / 05-09-2011 / 05:13:27 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1189
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
10785
vrany
parents: 10784
diff changeset
  1191
reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1192
    "return the valueHolder holding true if text was modified"
vrany
parents: 10784
diff changeset
  1193
vrany
parents: 10784
diff changeset
  1194
    ^ textView reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1195
vrany
parents: 10784
diff changeset
  1196
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1197
    "Created: / 08-10-2011 / 12:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1198
!
vrany
parents: 10784
diff changeset
  1199
vrany
parents: 10784
diff changeset
  1200
reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1201
vrany
parents: 10784
diff changeset
  1202
    ^ textView reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1203
vrany
parents: 10784
diff changeset
  1204
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1205
    "Created: / 08-10-2011 / 12:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1206
!
vrany
parents: 10784
diff changeset
  1207
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1208
showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1209
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1210
    ^showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1211
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1212
    "Created: / 10-10-2011 / 16:23:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1213
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1214
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1215
showAcceptCancelBarChannel:aValueHolder
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1216
    "set the valueHolder holding true if text was modified"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1217
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1218
    |prev|
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1219
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1220
    prev := showAcceptCancelBarChannel.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1221
    showAcceptCancelBarChannel := aValueHolder.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1222
    self setupChannel:aValueHolder for:nil withOld:prev.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1223
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1224
    "Created: / 10-10-2011 / 16:24:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1225
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1226
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    ^showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
    "Created: / 23-06-2010 / 19:02:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
showGutterChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
    |prev|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1238
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
    prev := showGutterChannel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
    showGutterChannel := aValueHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
    self setupChannel:aValueHolder for:nil withOld:prev
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1242
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
    "Created: / 23-06-2010 / 19:03:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1244
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1245
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1246
!CodeView2 methodsFor:'code services'!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1247
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1248
browseMethod: method
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1249
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1250
    self browseMethod: method label: nil.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1251
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1252
    "Created: / 14-02-2010 / 19:41:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1253
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1254
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1255
browseMethod: method label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1256
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1257
    self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1258
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1259
        or:[self browser navigationState modified])  
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1260
        ifTrue:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1261
            [self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1262
                spawnFullBrowserInClass: method mclass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1263
                selector:method selector 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1264
                in:#newBuffer]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1265
        ifFalse:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1266
            [self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1267
                switchToClass: method containingClass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1268
                selector: method selector].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1269
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1270
    "Modified: / 19-02-2008 / 10:15:17 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1271
    "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1272
    "Modified: / 25-07-2010 / 13:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1273
    "Modified: / 18-11-2011 / 14:58:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1274
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1275
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1276
browseMethods: methods label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1277
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1278
    methods size = 1 ifTrue:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1279
        [^self browseMethod: methods anyOne label: label].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1280
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1281
    self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1282
        ifNil: [NewSystemBrowser browseMethods: methods title: label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1283
        ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1284
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1285
    "Created: / 26-12-2007 / 11:32:04 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1286
    "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1287
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1288
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1289
extractSelectorAndSelectedText
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1290
    textView hasSelection ifTrue:[ 
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1291
        ^ self extractSelectorAndSelectedTextFrom:  textView selectionAsString
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1292
    ]. 
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1293
    syntaxElementSelection notNil ifTrue:[ 
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1294
        | node |
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1295
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1296
        node := syntaxElementSelection node.
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1297
        node isSelector ifTrue:[ 
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1298
            ^ Array with: node value with: node value
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1299
        ].
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1300
    ].
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1301
    ^ nil
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1302
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1303
    "Created: / 13-11-2017 / 21:53:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1304
!
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1305
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1306
extractSelectorAndSelectedTextFrom: givenSelectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1307
    | selector selectedText compilerClass na |
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1308
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1309
    selectedText := givenSelectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1310
    compilerClass := self language compilerClass.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1311
    selectedText size > 0 ifTrue:[
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1312
        "/ self windowGroup withWaitCursorDo:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1313
            "/ hack, for now and expecco; must ask the Parser eventually...
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1314
            (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1315
                "/ selector is in one piece anyway
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1316
                (selectedText includes:$_) ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1317
                    "/ zero or one args - sigh (need to parse more to figure this out)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1318
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1319
                    selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1320
                ] ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1321
                    "/ count _#s plus one arg - sigh
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1322
                    na := (selectedText occurrencesOf:$_) + 1. 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1323
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1324
                ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1325
            ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1326
                selector := SystemBrowser extractSelectorFrom:selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1327
            ].
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1328
        "/ ]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1329
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1330
    ^Array with: selector with: selectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1331
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1332
    "Created: / 30-06-2011 / 19:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1333
    "Modified: / 05-03-2012 / 09:04:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1334
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1335
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1336
implementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1337
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1338
    selector isNil ifTrue:[^#()].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1339
    ^SystemBrowser
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1340
        findImplementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1341
        in: Smalltalk allClasses
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1342
        ignoreCase: false
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1343
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1344
    "Created: / 26-12-2007 / 11:37:11 / janfrog"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1345
    "Modified: / 18-11-2011 / 14:58:17 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1346
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1347
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1348
sendersOf: selector
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1349
    |senderBlock|
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1350
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1351
    selector isNil ifTrue:[^#()].
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1352
    selector knownAsSymbol ifFalse:[^#()].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1353
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1354
    "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1355
    senderBlock := SystemBrowser searchBlockForSymbol:selector asSymbol.
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1356
    senderBlock == false ifTrue:[ ^ #() ].
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1357
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1358
    ^ SystemBrowser
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1359
        allMethodsIn:Smalltalk allClasses
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1360
        where:senderBlock.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1361
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1362
    "/ exact, but much slower
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1363
"/    ^SystemBrowser
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1364
"/        findSendersOf: selector
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1365
"/        in: Smalltalk allClasses
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1366
"/        ignoreCase: false
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1367
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1368
    "Created: / 26-12-2007 / 11:37:22 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1369
    "Modified: / 30-06-2011 / 19:32:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1370
    "Modified: / 18-11-2011 / 14:58:19 / cg"
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1371
    "Modified: / 04-06-2014 / 11:10:47 / az"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1372
! !
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1373
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
!CodeView2 methodsFor:'delegation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1375
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1376
doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1377
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1378
    ((textView respondsTo: aMessage selector) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1379
    and:[(TraceSelectors includes:aMessage selector) not])
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1380
        ifTrue:[^aMessage sendTo: textView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1381
    ^super doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1382
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1383
    "Created: / 13-02-2010 / 23:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1384
    "Modified: / 14-02-2010 / 09:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1385
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1386
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1387
hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1389
    ^textView hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1391
    "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1393
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1394
!CodeView2 methodsFor:'delegation-drawing'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1395
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1396
drawLine:lineNo in: view atX:x y:yBaseline width: w height:hFont ascent:aFont
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1397
    from:startCol to:endColOrNil with:fg and:bg
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1398
    "See the comment in
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1399
     CodeViewService>>drawLine:in:atX..."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1400
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  1401
    self servicesDo:[:each|
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1402
        each drawLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:aFont
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1403
             from:startCol to:endColOrNil with:fg and:bg
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1404
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1405
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1406
    "Created: / 17-06-2011 / 13:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1407
    "Modified: / 06-10-2011 / 14:14:04 / cg"
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  1408
    "Modified: / 27-11-2014 / 15:37:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1409
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1410
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1411
redrawVisibleLine: visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1412
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1413
    "Created: / 07-03-2010 / 14:44:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1414
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
redrawVisibleLine:visLine col:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1417
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
    "Modified: / 05-11-2007 / 17:35:53 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1419
    "Modified: / 07-03-2010 / 14:45:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1420
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1421
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1422
redrawVisibleLine:visLine from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1423
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1424
    "Modified: / 07-03-2010 / 14:46:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1425
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1426
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1427
redrawVisibleLine:visLine from:startCol to:endCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1428
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1429
    "Modified: / 07-03-2010 / 14:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1430
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1432
!CodeView2 methodsFor:'delegation-events'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1433
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1434
buttonMotion: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1435
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1436
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1438
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1439
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1440
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1441
            service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1442
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1443
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
    "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1445
    "Modified: / 06-10-2011 / 14:13:57 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1446
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1447
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1448
buttonMultiPress: button x:x y:y in: view
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1449
    "Delegates events to services. Answers true iff at least
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1450
     one service handler method returns true. In that case,
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1451
     the event is is NOT processes by the view."
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1452
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1453
    ^ services
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1454
        contains:[:service |
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  1455
            service isEnabled 
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  1456
            and:[ ((service buttonMultiPress: button x:x y:y in: view) == true) ]
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1457
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1458
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1459
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1460
    "Modified: / 06-10-2011 / 14:14:00 / cg"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1461
    "Modified (format): / 05-03-2012 / 08:56:02 / cg"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1462
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1463
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1464
buttonPress: button x:x y:y in: view
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1465
    "Delegates events to services. Answers true iff at least
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1466
     one service handler method returns true. In that case,
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1467
     the event is is NOT processes by the view."
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1468
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1469
    ^ services
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1470
        contains:[:service |
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1471
            service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ]
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1472
        ].
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1473
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1474
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1475
    "Modified: / 06-10-2011 / 14:14:00 / cg"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1476
    "Modified (format): / 05-03-2012 / 08:56:02 / cg"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1477
!
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1478
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1479
buttonRelease: button x:x y:y in: view
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1480
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1481
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1482
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1483
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1484
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1485
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1486
            service isEnabled and:[ ((service buttonRelease: button x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1487
        ].
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1488
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1489
15170
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1490
highlightClassVariable:name
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1491
    "interface from browser (when a class var is selected)"
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1492
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1493
    services do:[:each|
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1494
        each highlightClassVariable:name
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1495
    ].
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1496
!
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1497
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1498
highlightInstanceVariable:name
15170
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1499
    "interface from browser (when an inst var is selected)"
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1500
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1501
    services do:[:each|
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1502
        each highlightInstanceVariable:name
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1503
    ].
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1504
!
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1505
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1506
keyPress: key x:x y:y in: view
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1507
    "Delegates events to services. Answers true iff at least
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1508
     one service handler method returns true. In that case,
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1509
     the event is is NOT processes by the view."
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1510
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1511
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1512
        contains:[:service |
13582
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1513
            |handledByService|
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1514
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1515
            handledByService := service isEnabled 
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1516
                                and:[ ((service keyPress: key x:x y:y in: view) == true)].
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1517
            "/ handledByService ifTrue:[ Transcript showCR:'handled by ',service printString ].
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1518
            handledByService
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1519
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1521
    "Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1522
    "Modified: / 06-10-2011 / 14:14:11 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1523
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1524
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1525
keyRelease: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1526
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1529
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1530
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1531
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1532
            service isEnabled and:[ ((service keyRelease: key x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1533
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
    "Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1536
    "Modified: / 06-10-2011 / 14:14:13 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1537
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1538
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1539
linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1540
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1541
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1542
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1543
            each linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1544
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1545
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1546
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1547
    "Created: / 06-07-2011 / 17:12:54 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1548
    "Modified: / 06-10-2011 / 14:14:16 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1549
    "Modified: / 07-10-2011 / 19:14:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1550
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1551
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1552
linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1553
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1554
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1555
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1556
            each linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1557
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1558
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1559
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1560
    "Created: / 06-07-2011 / 17:12:48 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1561
    "Modified: / 06-10-2011 / 14:14:20 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1562
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1563
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1564
linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1565
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1566
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1567
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1568
            each linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1569
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1570
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1571
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1572
    "Created: / 06-07-2011 / 17:12:58 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1573
    "Modified: / 06-10-2011 / 14:13:44 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1574
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1575
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1576
scrollDown: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1577
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1578
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1579
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1580
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1581
            synchronizedCodeViews do:[:codeView|codeView scrollDown: nLines in: view]]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1582
        ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1583
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1584
            textView basicScrollDown: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1585
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1586
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1587
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1588
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1589
scrollTo:origin redraw:doRedraw in: view
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1590
    view == textView ifTrue: [
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1591
        "/my text view scrolled...
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1592
        synchronizedCodeViews do:[:codeView|
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1593
            codeView scrollTo:origin redraw:doRedraw in: view.
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1594
        ]
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1595
    ] ifFalse: [
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1596
        "/other code view scrolls and I'm notified about that
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1597
        textView basicScrollTo:origin redraw:doRedraw.
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1598
    ]
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1599
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1600
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1601
    "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1602
!
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1603
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1604
scrollUp: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1605
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1606
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1607
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1608
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1609
            synchronizedCodeViews do:[:codeView|codeView scrollUp: nLines in: view]]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1610
        ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1611
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1612
            textView basicScrollUp: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1613
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1615
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1617
!CodeView2 methodsFor:'diff mode'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1618
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1619
recomputeDiff:view 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1620
    |t1 t2 pom diffHelper view2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1621
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1622
    t1 := view getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
    synchronizedCodeViews do:[:codeView | 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1624
        view2 := codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1625
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1626
    view changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1627
    view2 changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1628
    t2 := view2 getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1629
    pom := DiffCodeView2 new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1630
    (view == textView) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1631
        diffHelper := pom computeDiffDataForText1:t1 text2:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1632
        (view) contents:(diffHelper text1).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
        (view) deletedLines:(diffHelper deleted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1635
        (view) originDiffText:t1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
        (view) emptyLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1637
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1638
        (view2) contents:(diffHelper text2).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1639
        (view2) insertedLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1640
        (view2) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1641
        (view2) originDiffText:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1642
        (view2) emptyLines:(diffHelper deleted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1643
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1644
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1645
    "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
    "Modified: / 23-06-2010 / 17:25:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1647
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1648
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1649
!CodeView2 methodsFor:'initialize & release'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1650
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1651
defaultServices
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1652
    "/ used to call "CodeViewService availableServices",
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1653
    "/ which enumerated all subclasses.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1654
    "/ this is BAD BAD BAD, because it does not allow for additional service
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1655
    "/ subclasses to be built for special applications. For example,
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1656
    "/ a debugging breakpoint service for a GDB application, a breakpoint service for
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1657
    "/ expecco's codeview.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1658
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1659
    "/ therefore, the list of services to use in codeView2 is now filtered
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1660
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1661
    ^ CodeViewService availableServices
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1662
        select:[:service | service isUsefulFor:self]
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1663
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1664
    "Created: / 22-07-2013 / 13:57:40 / cg"
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1665
!
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1666
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1667
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1668
    "Invoked when a new instance is created."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1669
    "Call super initialize"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1670
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1671
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
     "Now set up some visual properties"
15893
8faba2344b0f #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 15875
diff changeset
  1673
    self level:(styleSheet at:#'codeView2.level' default:-1).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1674
     "Now initialize sub-views"
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1675
    showGutterChannel := ValueHolder with: true.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1676
    showGutterChannel addDependent: self.
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1677
    "/ toDo: I don't like two options in the settings;
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1678
    "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)).
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1679
    showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel).
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1680
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1681
    "/ these views must be created first, as they refer to each other's channels in their
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1682
    "/ initialize methods
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1683
    gutterView := CodeView2::GutterView new.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1684
    textViewScroller := HVScrollableView for: CodeView2::TextView in: self.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1685
    textView := textViewScroller scrolledView.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1686
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1687
    self initializeGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1688
    self initializeTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1689
    textView setCodeView:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1690
    modifiedChannel := ValueHolder with:false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1691
    diffMode := false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1692
    synchronizedCodeViews := #().
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1693
    currentParseNodeHolder := ValueHolder new.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1694
    currentBlockNodeHolder := ValueHolder new.
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1695
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1696
    servicesFromClient := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1697
    services := OrderedCollection new.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  1698
    self initializeServices.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1699
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1700
    "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1701
    "Modified: / 06-04-2010 / 13:56:35 / Jakub <zelenja7@fel.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1702
    "Modified: / 06-10-2011 / 14:15:48 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1703
    "Modified: / 16-02-2012 / 23:05:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1704
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1706
initializeGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1707
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1708
    gutterView setCodeView:self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  1709
    gutterView currentBlockNodeHolder: self currentBlockNodeHolder.
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  1710
    gutterView origin:(0.0 @ 0.0) corner:(gutterView preferredWidth+1 @ 1.0).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
    showGutterChannel value ifTrue:[self addSubView: gutterView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1712
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1713
    "Created: / 02-09-2009 / 21:35:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
    "Modified: / 23-06-2010 / 19:14:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1715
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1716
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1717
initializeServices
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1718
    | serviceClasses |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
  1719
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1720
    "/ only do it, if the services have not yet been defined by the user of this view
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1721
    "/ (FileBrowser does not want Smalltalk-specific services)
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1722
    servicesFromClient ifFalse:[
16587
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1723
        serviceClasses := self defaultServices 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1724
                            sort:[:a :b|
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1725
                                a priority = b priority 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1726
                                    ifTrue:[a name < b name] 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1727
                                    ifFalse:[a priority > b priority]
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1728
                            ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1729
        serviceClasses do:[:cls|
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1730
            self registerService: cls new
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1731
        ].
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1732
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1733
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1734
    "Modified: / 22-07-2013 / 14:02:59 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1735
    "Modified: / 24-07-2013 / 11:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1736
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1738
initializeTextView
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1739
    "Initialize textView. gutterView has to be already initialized!!"
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1740
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1741
    textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1742
        origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1743
        corner: 1.0@1.0;
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1744
        level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1745
    textView level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1746
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1747
    textView modifiedChannel addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1748
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1749
    "Created: / 02-09-2009 / 21:36:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1750
    "Modified: / 23-06-2010 / 19:38:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1751
!
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1752
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1753
release
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1754
    services do:[:service | service unregister ].
14549
077001d56ef7 Oops, fix in Tools::CodeView2>>release - release could be (and sometimes is) called twice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14545
diff changeset
  1755
    services := #().
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1756
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1757
    textView model notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1758
        textView model removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1759
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1760
    textView modifiedChannel notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1761
        textView modifiedChannel removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1762
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1763
    showGutterChannel removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1764
    languageHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1765
        languageHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1766
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1767
    classHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1768
        classHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1769
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1770
    methodHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1771
        methodHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1772
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1773
    super release.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1774
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1775
    "Created: / 23-06-2014 / 20:16:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14549
077001d56ef7 Oops, fix in Tools::CodeView2>>release - release could be (and sometimes is) called twice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14545
diff changeset
  1776
    "Modified: / 23-06-2014 / 22:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1777
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1778
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
!CodeView2 methodsFor:'menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
10689
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1781
accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1782
    textView accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1783
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1784
    "Created: / 07-09-2011 / 21:29:07 / cg"
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1785
!
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1786
10375
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1787
again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1788
    textView again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1789
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1790
    "Created: / 16-02-2010 / 19:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1791
    "Created: / 22-07-2011 / 17:44:31 / cg"
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1792
!
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1793
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
browseImplementorsOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1795
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1796
    textView browseImplementorsOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1797
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1798
    "Modified: / 30-06-2011 / 19:22:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1799
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
browseSendersOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1802
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1803
    textView browseSendersOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1804
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1805
    "Modified: / 30-06-2011 / 19:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1806
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1807
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1808
copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
    textView copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1811
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1812
    "Created: / 16-02-2010 / 19:36:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1814
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1816
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1817
    textView cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1818
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
    "Created: / 16-02-2010 / 19:36:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1822
doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
    textView doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1825
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
    "Modified: / 16-02-2010 / 19:38:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1827
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1828
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1830
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1831
    textView inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1833
    "Modified: / 16-02-2010 / 19:38:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1834
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
inspectSelectedSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1837
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1838
    self error: 'Not yet implemented'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1839
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
    "Modified: / 14-02-2010 / 15:58:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1841
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1842
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1843
inspectSyntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1844
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1845
    syntaxElements inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1846
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1847
    "Modified: / 14-02-2010 / 15:57:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1848
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1849
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1850
inspectView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1851
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1852
    self inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1854
    "Modified: / 25-03-2010 / 17:58:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1856
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1857
pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1858
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1859
    textView pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1860
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1861
    "Created: / 16-02-2010 / 19:37:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1862
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1863
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1864
printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1866
    textView printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1867
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1868
    "Modified: / 16-02-2010 / 19:38:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1869
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1870
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1871
profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
    textView profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1874
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1875
    "Created: / 27-08-2010 / 22:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1876
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1878
undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1879
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1880
    textView undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1881
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
    "Created: / 16-02-2010 / 19:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1883
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1884
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
!CodeView2 methodsFor:'menus-dynamic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1886
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1887
debugMenu
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1888
    ^ self class debugMenu decodeAsLiteralArray
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1889
        receiver:self.
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1890
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1891
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1892
editMenu
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1893
    | editMenu superEditMenu moreMenu moreMenuItem |
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1894
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1895
    superEditMenu := textView superEditMenu.
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1896
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1897
    textView sensor ctrlDown ifTrue:[
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1898
        ^superEditMenu
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1899
    ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1900
13072
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1901
    "/ install the standard 'more' menu into my own menu
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1902
    moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1903
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
    editMenu := self class editMenu decodeAsLiteralArray.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
    moreMenuItem := editMenu menuItemLabeled: 'More'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
    moreMenuItem submenu: moreMenu asMenu.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1907
    editMenu findGuiResourcesIn: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1908
    ^editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
    "Created: / 25-12-2007 / 10:10:01 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1911
    "Modified: / 25-12-2007 / 19:50:53 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
    "Modified: / 18-10-2008 / 20:31:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1913
    "Modified: / 08-07-2011 / 13:35:31 / cg"
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1914
    "Modified: / 07-10-2011 / 17:58:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1915
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1917
implementorsMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1918
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1919
    | selectorAndSelectedText selector selectedText  implementors |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1920
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1921
    selectorAndSelectedText := self extractSelectorAndSelectedText.
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1922
    selectorAndSelectedText notNil ifTrue:[
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1923
        "/ self windowGroup withWaitCursorDo:[
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1924
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1925
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1926
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1927
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1928
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1929
                implementors := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1930
                                    findImplementorsOf:selectedText "Any: (Array with:selectedText)" 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1931
                                    in:(Smalltalk allClasses) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1932
                                    ignoreCase:false)
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1933
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1934
            ] ifFalse:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1935
                implementors := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1936
                                    findImplementorsOfAny:(Array with:selectedText with: selector) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1937
                                    in:(Smalltalk allClasses) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1938
                                    ignoreCase:false)
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1939
            ].
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1940
        "/ ] 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1941
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1942
        implementors := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1943
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1944
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1945
    ^self implementorsMenu: implementors selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1946
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1947
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1948
    "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1949
    "Modified: / 05-03-2012 / 09:02:43 / cg"
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1950
    "Modified: / 13-11-2017 / 21:54:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1951
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1952
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1953
implementorsMenu: implementors selector: selector
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
    | menu|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1955
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1956
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1957
    implementors isEmptyOrNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1958
        menu addItem:(MenuItem label:'No implementors found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1959
    ] ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1960
        menu addItem:(MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1961
                    label:(selector storeString , (' (all implementors) ') asText allItalic)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1962
                    itemValue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1963
                        self browseMethods:implementors
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1964
                            label:'Implementors of ' , selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1965
                    ]).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1966
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1967
        menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1968
        (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1969
        "implementors" do:[:mth |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1970
            menu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1971
                addItem:(MenuItem label:(selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1972
                                , (' in ' , mth containingClass nameInBrowser asText allBold))
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1973
                        itemValue:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1974
        ]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1975
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
    "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1980
    "Modified: / 07-03-2012 / 12:56:56 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1981
    "Modified: / 14-10-2013 / 10:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1982
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1983
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1984
sendersMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1985
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1986
    | selectorAndSelectedText selector selectedText  senders |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1987
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1988
    selectorAndSelectedText := self extractSelectorAndSelectedText.
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  1989
    selectorAndSelectedText notNil ifTrue:[    
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1990
        "/ self windowGroup withWaitCursorDo:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1991
            selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1992
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1993
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1994
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1995
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1996
                senders := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1997
                                findSendersOf:selectedText "Any:(Array with:selectedText)" 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1998
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1999
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2000
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2001
            ] ifFalse:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2002
                senders := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2003
                                findSendersOfAny:(Array with:selectedText with: selector) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2004
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2005
                                ignoreCase:false)
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2006
            ].
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2007
        "/ ] 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2008
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2009
        senders := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2010
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2011
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2012
    ^self sendersMenu: senders selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2013
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2014
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2015
    "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2016
    "Modified: / 05-03-2012 / 09:02:56 / cg"
17763
bb91bbb34e25 CodeView2: improved implementors / senders menu
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17304
diff changeset
  2017
    "Modified: / 13-11-2017 / 21:54:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2018
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2019
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2020
sendersMenu: senders  selector: selector
11377
e995583db311 changed:
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
  2021
    | menu shownSenderItems numCut sendersSorted|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2022
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2023
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  2024
    senders isEmptyOrNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2025
        menu addItem:(MenuItem label:'No senders found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2026
    ] ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2027
        menu addItem:(MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2028
                    label:(selector storeString , (' (all senders)') asText allItalic)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2029
                    itemValue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2030
                        self browseMethods:senders
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2031
                            label:'Senders of ' , selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2032
                    ]).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2033
        menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2034
        sendersSorted := senders asOrderedCollection
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2035
                            sort:[:a :b | a whoString < b whoString].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2036
        shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2037
        numCut := senders size - 20.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2038
        shownSenderItems do:[:mth |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2039
            menu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2040
                addItem:(MenuItem label:(mth selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2041
                                , (' in ' , mth containingClass nameInBrowser asText allBold))
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2042
                        itemValue:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2043
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2044
        numCut > 0 ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2045
            menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2046
            menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2047
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2048
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2049
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2050
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2051
    "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2052
    "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2053
    "Modified: / 07-07-2011 / 14:51:54 / jv"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2054
    "Modified: / 07-03-2012 / 12:58:31 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2055
    "Modified: / 14-10-2013 / 10:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2056
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2057
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2058
servicesMenu
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2059
    |menu item anyService|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2060
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2061
    menu := Menu new.
13110
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2062
    item := (MenuItem label:(resources string:'Services (experimental)')) enabled:false.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2063
    menu addItem:item.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2064
    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2065
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2066
    "/ disabled, because this menu is now on the gutter,
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2067
    "/ and it makes it hard to show it again, once hidden
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2068
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2069
"/    item := MenuItem label:(resources string:'Show Gutter').
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2070
"/    item indication:(self showGutterChannel).
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2071
"/    menu addItem:item.
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2072
"/    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2073
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2074
    anyService := false.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2075
    services do:[:service | 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2076
        |item|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2077
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2078
        item := MenuItem label:(resources string:service label).
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2079
        item indication:((AspectAdaptor forAspect:#enabled) subject:service).
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2080
        item hideMenuOnActivated:false.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2081
        menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2082
        anyService := true.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2083
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2084
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2085
    anyService ifTrue:[
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2086
        menu addSeparator.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2087
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2088
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2089
    item := MenuItem label:(resources string:'Debug').
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2090
    item submenuChannel:[ self debugMenu ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2091
    menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2092
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2093
    ^ menu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2094
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2095
    "Created: / 07-03-2010 / 14:03:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  2096
    "Modified: / 06-10-2011 / 14:14:30 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2097
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2098
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2099
!CodeView2 methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2100
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2101
codeCompletion
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2102
    "/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? 
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2103
    "/ (can we move that to a utility - probably DoWhatIMeanSupport)
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2104
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2105
    |cls language|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2106
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2107
    cls := self classHolder value.
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2108
    cls notNil ifTrue:[
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2109
        language := cls programmingLanguage
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2110
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2111
    UserInformation handle:[:ex |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2112
        self showInfo:(ex messageText).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2113
        ex proceed.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2114
    ] do:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2115
        self withWaitCursorDo:[
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2116
            DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:nil codeView:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2117
        ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2118
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2119
    ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2120
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
    "Modified: / 04-07-2006 / 18:48:26 / fm"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
    "Modified: / 20-11-2006 / 12:30:59 / cg"
13559
5215c061491c Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13517
diff changeset
  2123
    "Modified: / 18-09-2013 / 14:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2124
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2125
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2126
reallyModified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2127
    "check for modified code by comparing the source against
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  2128
     the codeView's contents.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2129
     That's the true modified value 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2130
     (in case user undid his changes, and the displayed text is actually original)"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2131
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2132
    |modified|
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2133
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2134
    "/ cg: why this? It does not make sense to me.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2135
    "/ either we can depend on what the textView tells me here
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2136
    "/ in which case we don't need the code below,
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2137
    "/ or we cannot, in which the textView modified query should be removed.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2138
    "/ from tracing, it looks as if the textView modified query is correct all the time.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2139
    "/ Can someone validate/verify this, please?
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2140
    textView modified ifTrue:[^true].   
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2141
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2142
     "/ higher prio to prevent it from being changed while we convert it (by editing)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2143
    Processor activeProcess
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2144
        withHigherPriorityDo:[
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2145
            modified := textView isTextDifferentFromOriginalSource.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2146
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2147
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2148
    ^ modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2149
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2150
    "Created: / 06-02-2010 / 19:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11559
e7e09a21e8f9 changed: #reallyModified
Claus Gittinger <cg@exept.de>
parents: 11520
diff changeset
  2151
    "Modified (format): / 05-06-2012 / 23:55:02 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2152
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2153
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2154
showInfo: message
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2155
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2156
    | app |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2157
    (app := self topView application) ifNotNil:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2158
        [(app respondsTo: #showInfo:) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2159
            [app showInfo: message]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2160
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2161
    "Modified: / 13-02-2010 / 23:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2162
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2163
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2164
!CodeView2 methodsFor:'private-accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2165
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2166
gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2167
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
    ^gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2170
    "Created: / 14-02-2010 / 15:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2171
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2172
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2173
syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2174
    ^ syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2177
syntaxElementSelection:anElement
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2178
    syntaxElementSelection := anElement.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2179
"/    anElement isNil ifTrue:[
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2180
"/        currentParseNodeHolder value: nil.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2181
"/"/        currentBlockNodeHolder value: nil.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2182
"/    ] ifFalse:[
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2183
"/        currentParseNodeHolder value: anElement node.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2184
"/"/        currentBlockNodeHolder value: anElement node enclosingBlock.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2185
"/    ]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2186
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2187
    "Modified: / 24-09-2013 / 00:14:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2188
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2189
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2190
syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2191
    ^ syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2192
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2193
14705
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2194
syntaxElements:aCollection
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2195
    aCollection notNil ifTrue:[
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2196
        aCollection isSortedCollection ifFalse:[ 
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2197
            aCollection sort.
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2198
        ].
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2199
    ].
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2200
    syntaxElements := aCollection.
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2201
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2202
    "Modified: / 08-08-2014 / 13:18:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2203
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2204
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2205
textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2206
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2207
    ^textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2208
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2209
    "Created: / 14-02-2010 / 15:21:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2210
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2211
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2212
textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2213
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2214
    ^textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2215
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2216
    "Created: / 14-02-2010 / 15:21:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2217
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2218
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2219
!CodeView2 methodsFor:'realization'!
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2220
13062
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2221
disableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2222
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2223
    services do:[:service|
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2224
        service enabled:false.
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2225
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2226
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2227
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2228
enableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2229
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2230
    services do:[:service|
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2231
        service enabled:true.
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2232
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2233
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2234
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2235
postRealize
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2236
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2237
    services do:[:service|
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2238
        service viewRealized.
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2239
    ]
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2240
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2241
    "Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2242
! !
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2243
13975
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2244
!CodeView2 methodsFor:'redrawing'!
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2245
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2246
flash
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2247
    textView flash.
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2248
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2249
    "Created: / 21-02-2014 / 16:57:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14988
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2250
!
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2251
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2252
flash: aString
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2253
    "delegated to my textview"
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2254
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2255
    textView flash:aString.
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2256
!
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2257
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2258
flash: aString withColor:flashColor
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2259
    "delegated to my textview"
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2260
14988
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2261
    textView flash:aString.
13975
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2262
! !
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2263
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2264
!CodeView2 methodsFor:'services'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2265
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2266
breakpointService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2267
    "that one or nil"
14844
7a0e0c3a430e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14843
diff changeset
  2268
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2269
    ^ services detect:[:any| (any isKindOf: BreakpointService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2270
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2271
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2272
lintService
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2273
    "prefers the smallsense-lint service over others"
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2274
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2275
    ^ services 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2276
        detect:[:any| (any isKindOf:SmallSense::SmalltalkLintService)] 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2277
        ifNone:[
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2278
            services 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2279
                detect:[:any| (any isLintService)] 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2280
                ifNone:nil
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2281
        ]
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2282
!
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2283
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2284
registerService: aCodeViewService
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2285
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2286
    services add: aCodeViewService.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2287
    aCodeViewService registerIn: self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2288
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2289
    "Created: / 06-03-2010 / 19:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2290
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2291
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2292
servicesDo:aBlock
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2293
    services notNil ifTrue:[ 
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2294
        services do:[ :service | service isEnabled ifTrue:[ aBlock value: service ] ] 
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2295
    ]
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2296
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2297
    "Modified: / 27-11-2014 / 15:38:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2298
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2299
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2300
syntaxHighlightingService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2301
    "that one or nil"
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2302
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2303
    ^ services detect:[:any| (any isKindOf: CodeHighlightingService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2304
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2305
13125
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2306
unregisterAllServices
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2307
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2308
    services copy do:[:eachService | self unregisterService:eachService ].
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2309
!
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2310
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
  2311
unregisterService: aCodeViewService
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2312
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2313
    services remove: aCodeViewService ifAbsent:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2314
    aCodeViewService unregister.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2315
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2316
    "Created: / 06-03-2010 / 19:21:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
  2317
    "Created: / 19-07-2012 / 16:34:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2318
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2319
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2320
!CodeView2 methodsFor:'testing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2321
14915
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2322
hasOwnScrollbars
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2323
    "a hack for codeView2, which behaves like a TextView, but has its own
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2324
     scrollbars embedded - sigh (an extra load one).
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2325
     This allows for the UIBuilder to avoid creating an extra set around such
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2326
     a view (as is the case with TextSpec with scrollbars when using CodeView2)"
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2327
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2328
    ^ true
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2329
!
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2330
10722
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2331
isCodeView2
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2332
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2333
    ^true
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2334
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2335
    "Created: / 20-07-2010 / 15:43:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2336
!
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2337
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2338
isTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2339
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2340
    ^true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2341
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2342
    "Created: / 14-02-2010 / 22:13:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2343
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2344
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2345
!CodeView2::AnnotationShowingScrollerBackground class methodsFor:'documentation'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2346
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2347
documentation
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2348
"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2349
    I am a scroller background used to show annotation positions
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2350
    (very similar to the DiffTextScrollerBackground).
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2351
    I draw little markers at positions where annotations are.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2352
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2353
    I need a reference to the textView and the list of annotations.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2354
"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2355
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2356
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2357
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'accessing'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2358
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2359
annotations:aCollectionOfAnnotations
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2360
    annotations := aCollectionOfAnnotations.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2361
!
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2362
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2363
breakpoints:aCollectionOfBreakpoints
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2364
    breakpoints := aCollectionOfBreakpoints.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2365
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2366
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2367
textView:something
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2368
    textView := something.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2369
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2370
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2371
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'drawing'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2372
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2373
fillRectangleX:x y:y width:w height:h in:aScroller
16620
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2374
    "I am asked to draw the background of aScroller.
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2375
     If any annotation is in that range, draw it"
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2376
    
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2377
    |overAllHeight drawRect scrollerHeight|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2378
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2379
    annotations isEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2380
        breakpoints isEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2381
            ^ self 
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2382
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2383
    ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2384
    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2385
    scrollerHeight := aScroller height.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2386
    drawRect :=
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2387
        [:lineNr :clrInside |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2388
            |clrBorder yThumb|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2389
            
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2390
            yThumb := (scrollerHeight * (lineNr / overAllHeight)) rounded.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2391
            (yThumb between:y-5 and:(y + h + 5)) ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2392
                clrBorder := clrInside darkened.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2393
                aScroller paint:clrInside.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2394
                aScroller fillRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:8.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2395
                aScroller paint:clrBorder.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2396
                aScroller displayRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:9.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2397
            ].    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2398
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2399
        
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2400
    overAllHeight := textView numberOfLines.
14992
d8e909bf2407 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14988
diff changeset
  2401
    overAllHeight = 0 ifTrue:[ ^ self ].
d8e909bf2407 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14988
diff changeset
  2402
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2403
    annotations notEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2404
        annotations do:[:eachAnnotation |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2405
            |lineNr severityColor severity|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2406
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2407
            (lineNr := eachAnnotation line) notNil ifTrue:[ 
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2408
                severity := eachAnnotation rule severity.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2409
                severity == #error ifTrue:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2410
                    severityColor := Color red.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2411
                ] ifFalse:[
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2412
                    severity == #warning ifTrue:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2413
                        severityColor := Color yellow.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2414
                    ] ifFalse:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2415
                        severityColor := Color blue.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2416
                    ].    
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2417
                ].    
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2418
                drawRect value:lineNr value:severityColor lightened.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2419
            ].
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2420
        ].
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2421
    ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2422
    breakpoints notEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2423
        breakpoints do:[:eachBreakpoint |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2424
            (eachBreakpoint isVisible and:[eachBreakpoint isEnabled]) ifTrue:[ 
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2425
                |lineNr bpntColor|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2426
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2427
                (lineNr := eachBreakpoint line) notNil ifTrue:[    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2428
                    bpntColor := eachBreakpoint isTracepoint
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2429
                                    ifTrue:[ Color blue lightened]
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2430
                                    ifFalse:[ Color red ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2431
                    drawRect value:lineNr value:bpntColor.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2432
                ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2433
            ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2434
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2435
    ].
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2436
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2437
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2438
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'ignored conversion'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2439
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2440
asFormOn:aDevice
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2441
    "superclass AbstractBackground says that I am responsible to implement this method"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2442
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2443
    ^ self 
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2444
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2445
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2446
onDevice:aDevice
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2447
    "superclass AbstractBackground says that I am responsible to implement this method"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2448
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2449
    ^ self 
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2450
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2451
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2452
!CodeView2::GutterView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2453
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2454
menuHolder:aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2455
    menuHolder := aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2456
!
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2457
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2458
setTextView: aTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2459
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2460
    self assert: textView isNil message:'Attempting to set textView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2461
    textView := aTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2462
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2463
    textView addDependent:self.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2464
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2465
    "/ self backgroundPaint: textView backgroundPaint darkened lighter.
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2466
    self viewBackground: (View defaultBackgroundColor). "/ textView backgroundPaint darkened lighter.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2467
    self paint: textView paint.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2468
    self font: textView font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2469
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2470
    "Created: / 02-09-2009 / 21:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2471
    "Modified: / 14-12-2009 / 15:09:29 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2472
    "Modified: / 09-02-2010 / 20:03:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2473
    "Modified: / 17-08-2011 / 15:15:09 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2474
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2475
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2476
setTextViewScroller:aScr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2477
    textViewScroller := aScr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2478
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2479
    "Created: / 07-12-2009 / 22:36:31 / Jindra <a>"
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2480
!
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2481
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2482
showLineNumbers:aBoolean
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2483
    "can be used to turn off linenumber drawing, 
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2484
     in case the gutter is used with another view anf only the other features (breakpoints) are needed"
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2485
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2486
    showLineNumbers := aBoolean.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2487
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2488
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2489
!CodeView2::GutterView methodsFor:'accessing-dimensions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2490
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2491
acceptButtonBottom
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2492
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2493
    ^(self height * 0.6) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2494
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2495
    "Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2496
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2497
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2498
acceptCancelRight
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2499
    ^((self paddingLeft) + self usedWidthForAcceptCancel)
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2500
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2501
    "Created: / 10-09-2013 / 03:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2502
    "Modified: / 14-02-2014 / 12:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2503
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2504
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2505
cancelButtonBottom  
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2506
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2507
    ^(self height * 0.8) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2508
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2509
    "Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2510
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2511
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2512
padding
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2513
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2514
    ^self paddingLeft + self paddingRight 
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2515
        + self usedWidthForAcceptCancel    
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2516
        + (widthAnnotations ? 0) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2517
        + (widthDiffInfo ? 0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2518
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2519
    "Created: / 14-02-2010 / 22:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2520
    "Modified: / 07-10-2011 / 19:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2521
    "Modified (format): / 07-10-2011 / 20:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2522
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2523
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2524
paddingLeft
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2525
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2526
    ^0"px"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2528
    "Created: / 14-02-2010 / 22:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2529
    "Modified: / 16-06-2011 / 13:47:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2530
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2531
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2532
paddingRight
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2533
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2534
    ^3"px"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2535
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2536
    "Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2537
    "Modified: / 16-02-2012 / 22:40:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2538
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2539
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2540
preferredExtent
11467
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2541
    | font w h |
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2542
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2543
    explicitExtent notNil ifTrue:[ ^ explicitExtent ].
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2544
    preferredExtent notNil ifTrue:[ ^ preferredExtent ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2545
11467
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2546
    font := self font.
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2547
    w := (font widthOf:'00') + self padding.
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2548
    h := textView notNil 
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2549
            ifTrue:[textView height] 
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2550
            ifFalse:[font height * 12].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2551
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2552
    ^preferredExtent := w @ h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2553
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2554
    "Modified: / 16-06-2011 / 14:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11467
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2555
    "Modified (format): / 26-03-2012 / 11:19:54 / cg"
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2556
!
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2557
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2558
usedWidthForAcceptCancel
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2559
    ^ (codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[widthAcceptCancel ? 0] ifFalse:[0]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2560
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2561
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2562
!CodeView2::GutterView methodsFor:'actions'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2563
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2564
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2565
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2566
    textView accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2567
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2568
    "Created: / 07-10-2011 / 20:23:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2569
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2570
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2571
cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2572
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2573
    textView cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2574
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2575
    "Created: / 07-10-2011 / 20:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2576
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2577
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2578
diff
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2579
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2580
    "Created: / 07-10-2011 / 20:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2581
!
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2582
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2583
inspectView
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2584
    self halt.
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2585
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2586
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2587
middleButtonMenu    
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2588
    menuHolder notNil ifTrue:[^ menuHolder value].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2589
    codeView isNil ifTrue:[^ nil].
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2590
    ^ codeView servicesMenu
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2591
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2592
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2593
!CodeView2::GutterView methodsFor:'aspects'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2594
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2595
currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2596
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2597
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2598
    currentBlockNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2599
        currentBlockNodeHolder := ValueHolder new.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2600
        currentBlockNodeHolder addDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2601
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2602
    ^ currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2603
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2604
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2605
currentBlockNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2606
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2607
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2608
    |oldValue newValue|
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2609
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2610
    currentBlockNodeHolder notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2611
        oldValue := currentBlockNodeHolder value.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2612
        currentBlockNodeHolder removeDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2613
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2614
    currentBlockNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2615
    currentBlockNodeHolder notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2616
        currentBlockNodeHolder addDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2617
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2618
    newValue := currentBlockNodeHolder value.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2619
    oldValue ~~ newValue ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2620
        self update:#value with:newValue from:currentBlockNodeHolder.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2621
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2622
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2623
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2624
!CodeView2::GutterView methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2625
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2626
adjustSizeForLongestLine
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2627
    "recompute the required width (longest linenumber present, not shown)"
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2628
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2629
    |newNumberOfLines longestLineString textW requiredW newWidth|
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2630
13568
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2631
    showLineNumbers ifFalse:[^ self].
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2632
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2633
    newNumberOfLines := (textView list size max:textView cursorLine).
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2634
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2635
    longestLineString := self displayedString:(newNumberOfLines max:99).
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2636
    textW := (longestLineString widthOn:self).
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2637
    requiredW := textW + self padding.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2638
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2639
    ((requiredW > width) or:[requiredW < (width * 3 // 4)]) ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2640
        "/ some hysteresis to avoid quick readjust again
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  2641
        newWidth := (requiredW "* 1.1") rounded.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2642
        self corner:(newWidth+1 @ 1.0).
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  2643
13085
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2644
        [
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2645
            textView removeDependent:self.
13568
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2646
            textViewScroller notNil ifTrue:[ textViewScroller origin:(newWidth+1 @ 0.0) corner:(1.0 @ 1.0) ].
13085
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2647
        ] ensure:[
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2648
            textView addDependent:self.
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2649
        ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2650
        self invalidate.
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2651
    ] ifFalse:[
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2652
        numberOfLines ~= newNumberOfLines ifTrue:[
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2653
            self invalidate
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2654
        ]
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2655
    ].
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2656
!
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2657
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2658
update:something with:aParameter from:changedObject
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2659
    |deltaY numPixels hScrollerHeight|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2660
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2661
    (changedObject == textView) ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2662
        ((something == #sizeOfContents)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2663
        or:[ "false "(something == #visibility)"" ]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2664
            self adjustSizeForLongestLine.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2665
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2666
            "/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2667
            "/     self invalidate.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2668
            "/ ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2669
            ^ self.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2670
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2671
        something == #originOfContents ifTrue:[
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2672
            aParameter notNil ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2673
                deltaY := aParameter y.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2674
                deltaY = 0 ifTrue:[^ self].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2675
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2676
                numPixels := deltaY abs.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2677
                numPixels < (height // 5) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2678
                    deltaY < 0 ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2679
                        self invalidateX:0 y:0 width:width height:numPixels.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2680
                    ] ifFalse:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2681
                        hScrollerHeight := 0.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2682
                        (textViewScroller notNil
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2683
                        and:[textViewScroller horizontalScrollBar notNil]) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2684
                            hScrollerHeight := textViewScroller horizontalScrollBar height.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2685
                        ].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2686
                        numPixels := numPixels + 4.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2687
                        self invalidateX:0 y:height-numPixels-hScrollerHeight width:width height:numPixels+hScrollerHeight.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2688
                    ].
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2689
                    "/ self repairDamage.
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2690
                    ^ self.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2691
                ].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2692
            ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2693
            self invalidateLines.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2694
            ^ self.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2695
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2696
        "/ something printCR.
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2697
    ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2698
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2699
    (changedObject == textView reallyModifiedChannel) ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2700
        self invalidateAcceptCancelBar.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2701
        ^self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2702
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2703
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2704
    super update:something with:aParameter from:changedObject
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2705
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2706
    "Modified (format): / 15-07-2011 / 20:14:04 / cg"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2707
    "Modified: / 14-02-2014 / 12:08:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2708
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2709
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2710
!CodeView2::GutterView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2711
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2712
buttonMultiPress: btn x: x y: y
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2713
    |extraSafeArea|
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2714
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2715
    Processor removeTimedBlock:blockWaitingForPossibleDoubleClick.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2716
    blockWaitingForPossibleDoubleClick := nil.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2717
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2718
    "/ for the embedded accept-cancel bar, if enabled
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2719
    (x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2720
        textView reallyModified ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2721
            (y < self acceptButtonBottom) ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2722
                ^self.
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2723
            ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2724
            (y < self cancelButtonBottom) ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2725
                ^self.            
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2726
            ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2727
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2728
        ^self.
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2729
    ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2730
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2731
    false ifTrue:[
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2732
        "Do not allow clicking on line numbers..."
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2733
        extraSafeArea := "('999' widthOn:self)" 5.
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2734
        x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2735
    ].
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2736
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2737
    codeView notNil ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2738
        ((x > (self paddingLeft + self usedWidthForAcceptCancel)) or:
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2739
            [x < (self width - self paddingRight - widthDiffInfo)]
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2740
        ) ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2741
            (codeView buttonMultiPress: btn x:x y:y in: self) ifTrue:[^ self].   "/ event eaten
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2742
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2743
    ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2744
    super buttonMultiPress: btn x: x y: y
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2745
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2746
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2747
buttonPress: btn x: x y: y
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2748
    blockWaitingForPossibleDoubleClick :=
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2749
        [
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2750
            self nonMultiButtonPress: btn x: x y: y
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2751
        ].
15625
2f6a53bee89f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15521
diff changeset
  2752
    Processor 
2f6a53bee89f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15521
diff changeset
  2753
        addTimedBlock:blockWaitingForPossibleDoubleClick 
2f6a53bee89f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15521
diff changeset
  2754
        for:Processor activeProcess 
2f6a53bee89f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15521
diff changeset
  2755
        afterMilliseconds:200.
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2756
!
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2757
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2758
nonMultiButtonPress: btn x: x y: y
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2759
    "this is now called delayed for a single button press
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2760
     (i.e. if there is not other click within some time)"
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2761
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2762
    |extraSafeArea|
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2763
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2764
    "/ for the embedded accept-cancel bar, if enabled
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2765
    (x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2766
        textView reallyModified ifTrue:[
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2767
            (y < self acceptButtonBottom) ifTrue:[
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2768
                self accept.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2769
                ^self.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2770
            ].
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2771
            (y < self cancelButtonBottom) ifTrue:[
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2772
                self cancel.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2773
                ^self.            
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2774
            ].
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2775
            self diff.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2776
        ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2777
        ^self.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2778
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2779
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2780
    false ifTrue:[
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2781
        "Do not allow clicking on line numbers..."
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2782
        extraSafeArea := "('999' widthOn:self)" 5.
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2783
        x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2784
    ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2785
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2786
    codeView notNil ifTrue:[
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2787
        ((x > (self paddingLeft + self usedWidthForAcceptCancel)) or:
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2788
            [x < (self width - self paddingRight - widthDiffInfo)]
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2789
        ) ifTrue:[
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2790
            (codeView buttonPress: btn x:x y:y in: self) ifTrue:[^ self].   "/ event eaten
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2791
        ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2792
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2793
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2794
    "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2795
    "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2796
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2797
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2798
sizeChanged:how
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2799
    super sizeChanged:how.
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2800
    "/ self invalidateAcceptCancelBar.
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2801
    self invalidate.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2802
    "Created: / 10-09-2013 / 03:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2803
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2804
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2805
!CodeView2::GutterView methodsFor:'help'!
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2806
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2807
flyByHelpTextAt:aPointOrNil
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2808
    |lineNr textCollector services|
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2809
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2810
    codeView isNil ifTrue:[^ nil].
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2811
    aPointOrNil isNil ifTrue:[^ nil].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2812
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2813
    lineNr := codeView lineAtY:aPointOrNil y.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2814
    lineNr isNil ifTrue:[^ nil].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2815
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2816
    textCollector := TextStream new.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2817
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2818
    "/ which service has an annotation for that line
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2819
    services := codeView services.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2820
    "/ show lintservice-help first
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2821
    services := (services select:[:s | s isLintService])
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2822
                ,(services reject:[:s | s isLintService]).
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2823
                
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2824
    services do:[:eachService |
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2825
        |tooltip|
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2826
        
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2827
        tooltip := eachService flyByHelpTextAtLine:lineNr.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2828
        tooltip notEmptyOrNil ifTrue:[
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2829
            textCollector notEmpty ifTrue:[ textCollector cr].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2830
            textCollector nextPutAllText:tooltip.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2831
            tooltip last == Character cr ifFalse:[textCollector cr].
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2832
        ].
12903
22da380892a5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12870
diff changeset
  2833
    ].
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2834
    textCollector isEmpty ifTrue:[ ^ nil ].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  2835
    ^ textCollector contents.    
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2836
! !
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2837
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2838
!CodeView2::GutterView methodsFor:'initialize & release'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2839
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2840
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2841
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2842
    super initialize.
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2843
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2844
    blockWaitingForPossibleDoubleClick := nil.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2845
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2846
    showLineNumbers := true.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2847
    widthAcceptCancel := 16.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2848
    widthAnnotations := "16"8.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2849
    widthDiffInfo := 5.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2850
15361
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2851
    UserPreferences current useColorsForColorBlindness ifTrue:[
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2852
        acceptColor := Color blue.
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2853
    ] ifFalse:[
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2854
        acceptColor := Color green.
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2855
    ].
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2856
    cancelColor := Color red.
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2857
    diffColor := Color yellow.
ecb983b4a902 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15170
diff changeset
  2858
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  2859
    acceptColor := acceptColor lighter onDevice:device.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  2860
    cancelColor := cancelColor lighter lighter onDevice:device.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  2861
    diffColor := diffColor lighter lighter onDevice:device.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2862
14983
4e23aedeee9a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14963
diff changeset
  2863
    self enableMotionEvents.   "/ for per-line tooltips
4e23aedeee9a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14963
diff changeset
  2864
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2865
    "Created: / 16-06-2011 / 13:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2866
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2867
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2868
release
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2869
    codeView removeDependent: self.  
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2870
    textView removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2871
    currentBlockNodeHolder notNil ifTrue:[
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2872
        currentBlockNodeHolder removeDependent: self
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2873
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2874
    super release.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2875
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2876
    "Created: / 23-06-2014 / 20:47:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2877
!
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  2878
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2879
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2880
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2881
    codeView := aCodeView2.
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2882
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2883
    codeView addDependent: self.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2884
    codeView reallyModifiedChannel addDependent: self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  2885
    "/ codeView currentBlockNodeHolder addDependent: self. - not needed; currentBlockNodeHolder: does it
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2886
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2887
    textView := aCodeView2 textView.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2888
    textView addDependent: self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  2889
    "/ do not fetch stuff from others - let others give me things (caller change to send currentBlockNodeHolder: explicitly)
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  2890
    "/ self currentBlockNodeHolder: codeView currentBlockNodeHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2891
    textViewScroller := aCodeView2 textViewScroller.
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2892
    "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2893
    self viewBackground: (View defaultBackgroundColor).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2894
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2895
    "Created: / 14-02-2010 / 15:19:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2896
    "Modified: / 17-08-2011 / 15:15:55 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2897
    "Modified: / 05-04-2012 / 17:46:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2898
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2899
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2900
!CodeView2::GutterView methodsFor:'queries'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2901
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2902
displayedString: line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2903
    "get text to display in gutter for specified list line number"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2904
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2905
    ^(line asString).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2906
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2907
    "Created: / 14-12-2009 / 13:37:47 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2908
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2909
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2910
lineColorForLine:line
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2911
    "return special color for given line if required, nil otherwise"
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2912
    "used only if lineFont returns nil"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2913
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2914
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2915
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2916
    "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2917
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2918
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2919
lineDisplayable:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2920
    "true if this list line can be displayed"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2921
    ^(textView listLineIsVisible:line)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2922
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2923
    "Created: / 14-12-2009 / 13:38:23 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2924
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2925
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2926
lineFontForLine:line
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2927
    "return special font for given line if required, nil otherwise"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2928
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2929
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2930
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2931
    "Created: / 14-12-2009 / 14:40:17 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2932
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2933
13566
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  2934
wantsFocusWithButtonPress
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  2935
    ^ false.
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  2936
!
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  2937
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2938
yOfTextViewLine:lineNr
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2939
    "defined to allow computation of a line below what is visible in
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2940
     the textView (because gutter may become higher than textView, iff
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2941
     the textView has a horizontal scrollbar"
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2942
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2943
    |visibleLineNr "{ Class: SmallInteger }"|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2944
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2945
    "/JV: BAD, BAD BAD - check senders, they are not prepared
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2946
    "/    to get nil!!
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2947
    shown ifFalse:[^ nil].
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2948
    lineNr isNil ifTrue:[^ nil].
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2949
    visibleLineNr := lineNr - textView firstLineShown + 1.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2950
    ^ textView yOfVisibleLine:visibleLineNr
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2951
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2952
    "Modified (format): / 28-08-2013 / 12:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2953
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2954
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2955
!CodeView2::GutterView methodsFor:'redrawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2956
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2957
invalidateAcceptCancelBar
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2958
    | w |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2959
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2960
    self usedWidthForAcceptCancel == 0 ifTrue:[^ self].
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2961
    w := self acceptCancelRight.
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2962
    w == 0 ifTrue:[ ^ self ].
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2963
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2964
    self
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2965
        invalidateX: 0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2966
                  y: 0
16127
4ae6c7d4444b CodeVIew2: Again, another attempt to fix redraw bug in accept/cancel bar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15894
diff changeset
  2967
              width: w
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2968
             height: self height.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2969
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2970
    "Created: / 10-09-2013 / 03:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
16127
4ae6c7d4444b CodeVIew2: Again, another attempt to fix redraw bug in accept/cancel bar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15894
diff changeset
  2971
    "Modified: / 22-02-2016 / 20:05:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2972
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2973
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2974
invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2975
    ^ super invalidateDeviceRectangle:aRectangle repairNow:doRepairNow
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2976
!
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2977
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2978
invalidateLines
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2979
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2980
    | x0 |
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2981
    x0 := self acceptCancelRight "+ 1".
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2982
    self
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2983
        invalidateX: x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2984
                  y: 0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2985
              width: self width - x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2986
             height: self height.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2987
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2988
    "Created: / 10-09-2013 / 03:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2989
    "Modified: / 14-02-2014 / 12:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2990
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2991
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2992
redrawAcceptCancelBarX: x y: y width:w height:h
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2993
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2994
    | rw acceptRight acceptBottom cancelBottom |
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2995
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2996
    acceptRight := self acceptCancelRight.
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  2997
    x >= acceptRight ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2998
        ^self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2999
    ].
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3000
    rw := ((x + w) min: acceptRight) - x.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3001
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3002
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3003
    textView reallyModified ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3004
        gc fillRectangleX:x y:y width:rw height:h color: self viewBackground
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3005
    ] ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3006
        acceptBottom := self acceptButtonBottom.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3007
        cancelBottom := self cancelButtonBottom.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3008
        y < acceptBottom ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3009
            gc fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3010
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3011
        (y < cancelBottom) ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3012
            gc fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3013
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3014
        (y + h >= cancelBottom) ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3015
            gc fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3016
        ]
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3017
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3018
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3019
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3020
    "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
16127
4ae6c7d4444b CodeVIew2: Again, another attempt to fix redraw bug in accept/cancel bar.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15894
diff changeset
  3021
    "Modified: / 22-02-2016 / 20:09:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3022
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3023
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3024
redrawBackgroundX:x y:y width:w height:h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3025
    "redraws gutter background"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3026
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3027
    |savPaint|
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3028
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3029
    "background is filled with background color"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3030
    self 
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3031
        clearRectangleX:x
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3032
        y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3033
        width:w
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3034
        height:h. 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3035
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3036
    "separator line is drawn in grey"
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3037
    savPaint := self paint.
15521
fb618bbd9037 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15520
diff changeset
  3038
    self paint:Color grey.
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3039
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3040
    self 
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3041
        displayLineFromX:(width - 1)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3042
        y:y
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3043
        toX:(width - 1)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3044
        y:(y+h).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3045
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3046
    self paint:savPaint.
15521
fb618bbd9037 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15520
diff changeset
  3047
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3048
    "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3049
    "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  3050
    "Modified: / 17-08-2011 / 15:12:47 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3051
    "Modified (comment): / 07-10-2011 / 19:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3052
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3053
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3054
redrawLine:line 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3055
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3056
    ^self redrawLine:line cleared: false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3057
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3058
    "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3059
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3060
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3061
redrawLine:line cleared: cleared
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3062
    "redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3063
    
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3064
    ^ self redrawLine:line cleared:cleared drawServices:true
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3065
!
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3066
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3067
redrawLine:line cleared:cleared drawServices:drawServices
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3068
    "redraws specified line. Returns width of drawn object.
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3069
     Color of drawn objects should be taken from lineFont, lineColor"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3070
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3071
    |lineString yTop yBaseline textViewFont fontAscent fontDescent
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3072
     textW requiredW oldFont newFont oldColor newColor 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3073
     myFont myFontAscent myFontDescent|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3074
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3075
    shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown.
13574
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3076
    textView isNil ifTrue:[^ self].     "/ happens when shown in UIPainter
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3077
        
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3078
    requiredW := self width.
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3079
    myFont := gc font.
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3080
    textViewFont := textView font.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3081
    
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3082
    showLineNumbers ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3083
        lineString := self displayedString:line.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3084
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3085
        textW := (lineString widthOn:self).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3086
        requiredW := textW + self padding.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3087
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3088
        oldFont := myFont.
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3089
        oldColor := gc paint.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3090
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3091
        newFont := self lineFontForLine:line.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3092
        newFont isNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3093
            newFont := oldFont.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3094
            newColor := self lineColorForLine:line.
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3095
            newColor notNil ifTrue:[ gc paint:newColor ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3096
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3097
        newFont ~~ oldFont ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3098
            "/ ensure that the line number lines are not higher than the text lines
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3099
            (newFont heightOn:device) > (textViewFont heightOn:device) ifTrue:[
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3100
                newFont := textViewFont.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3101
            ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3102
            newFont ~~ oldFont ifTrue:[
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3103
                self font:newFont.
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3104
                myFont := gc font.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3105
            ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3106
        ].
11424
69b3960c7757 care for small text-font in gutterview
Claus Gittinger <cg@exept.de>
parents: 11398
diff changeset
  3107
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3108
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3109
    fontAscent := textViewFont ascentOn:device.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3110
    fontDescent := textViewFont descentOn:device.
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3111
    myFontAscent := myFont ascent.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3112
    myFontDescent := myFont descent.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3113
    
13584
ca0a679b490d class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13582
diff changeset
  3114
    yTop := (self yOfTextViewLine:line) ? 0.
13574
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3115
    yBaseline := yTop + fontAscent.
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3116
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3117
    cleared ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3118
        gc 
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3119
            clearRectangleX:0 y:(yBaseline - myFontAscent) 
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3120
            width:(width - 2) height:(myFontAscent + myFontDescent).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3121
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3122
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3123
    "/ cg: this should be done differently: services know about the
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3124
    "/ gutter, so they should respond to a special drawGutter message.
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3125
    "/ otherwise, some redraws become unusably slow (especially
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3126
    "/ with multiple fonts/colors/emphases)...
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3127
    drawServices ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3128
        "Let services draw annotations and other stuff"
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3129
        codeView notNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3130
            codeView
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3131
                drawLine:line in:self
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3132
                atX:(self acceptCancelRight + 1) y:yBaseline 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3133
                width:widthAnnotations height:(myFont height) ascent:myFontAscent
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3134
                from:nil to:nil with:(self paint) and:(self backgroundColor).
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3135
        ]
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3136
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3137
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3138
    showLineNumbers ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3139
        gc displayString:lineString x:(width - widthDiffInfo - textW) y:yBaseline.
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3140
        newFont notNil ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3141
            gc font:oldFont.
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3142
            gc paint:oldColor
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3143
        ] ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3144
            newColor notNil ifTrue:[ gc paint:oldColor ].
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3145
        ].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3146
    ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3147
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3148
    "/ If the view has been cleared here, we have also to redraw corresponding portion
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3149
    "/ of accept/cancel bar !!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3150
    cleared ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3151
        "/ In that case it was cleared above.
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3152
        self redrawAcceptCancelBarX:0 y:(yBaseline - myFontAscent)
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3153
             width:width - 2
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3154
             height:(myFontAscent + myFontDescent).
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3155
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3156
    ^ requiredW.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3157
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3158
    "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3159
    "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11606
b5ff5131266b line number redrawing
Claus Gittinger <cg@exept.de>
parents: 11597
diff changeset
  3160
    "Modified: / 18-07-2012 / 19:05:24 / cg"
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3161
    "Modified: / 14-02-2014 / 17:58:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3162
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3163
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3164
redrawLinesFrom:start
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3165
    "/ cg: obsolete?
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  3166
    start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3167
        self redrawLine:line cleared:false drawServices:true.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3168
    ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3169
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3170
    "Created: / 06-07-2011 / 17:25:36 / jv"
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  3171
    "Modified: / 12-07-2011 / 17:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3172
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3173
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3174
redrawVisibleLine:line 
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3175
    |absLine|
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3176
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3177
    (absLine := textView visibleLineToListLine:line) notNil ifTrue:[
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3178
        self redrawLine:absLine cleared: false.
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3179
    ].
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3180
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3181
    "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3182
!
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3183
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3184
redrawX:x y:y width:w height:h
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3185
    |firstLine lastLine yBot|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3186
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3187
    self redrawBackgroundX:x y:y width:w height:h.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3188
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3189
    (codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[    
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3190
        self redrawAcceptCancelBarX:x y:y width:w height:h.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3191
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3192
13575
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3193
    "/ textview may be nil, if Gutter is shown in the UIPainter!!
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3194
    textView notNil ifTrue:[
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3195
        numberOfLines := (textView list size max:textView cursorLine).
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3196
        yBot := y + h.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3197
        firstLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:y).
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3198
        lastLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:yBot-1).
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3199
        lastLine := lastLine min:numberOfLines.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3200
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3201
        firstLine to:lastLine do: [:line | 
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3202
            self redrawLine:line cleared:true drawServices:true.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3203
        ].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3204
    ]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3205
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3206
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3207
!CodeView2::TextView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3208
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3209
changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3210
    ^ changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3211
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3212
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3213
changedDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3214
    changedDiffText := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3215
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3216
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3217
changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3218
    ^ changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3219
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3220
    "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3221
    "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3222
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3223
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3224
changedLines:something 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3225
    changedLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3226
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3227
    "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3228
    "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3229
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3230
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3231
codeView
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3232
    ^ codeView
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3233
!
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3234
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3235
contents: text
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3236
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3237
    super contents: text.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3238
    reallyModifiedChannel value: false.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3239
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3240
    "Created: / 07-10-2011 / 20:32:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3241
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3242
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3243
contents: text clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3244
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3245
    | savedListOriginal |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3246
    savedListOriginal := listOriginal.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3247
    super contents: text.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3248
    listOriginal := savedListOriginal.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3249
    self updateReallyModified.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3250
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3251
    "Created: / 17-02-2012 / 00:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3252
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3253
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3254
deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3255
    ^  deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3256
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3257
    "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3258
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3259
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3260
deletedLines:something 
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3261
    deletedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3262
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3263
    "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3264
    "Modified (format): / 17-07-2012 / 18:56:44 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3265
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3266
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3267
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3268
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3269
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3270
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3271
diffMode:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3272
    diffMode := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3273
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3274
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3275
emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3276
    ^ emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3277
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3278
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3279
emptyLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3280
    emptyLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3281
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3282
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3283
fontAscent
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3284
    ^fontAscent notNil ifTrue:[fontAscent] ifFalse:[super fontAscent]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3285
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3286
    "Created: / 19-05-2012 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3287
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3288
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3289
insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3290
    ^  insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3291
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3292
    "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3293
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3294
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3295
insertedLines:something 
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3296
    insertedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3297
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3298
    "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3299
    "Modified (format): / 17-07-2012 / 18:56:50 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3300
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3301
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3302
modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3303
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3304
    super modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3305
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3306
    "Created: / 07-07-2011 / 12:27:11 / Jan Vrany <jan.vrant@fit.cvut,cz>"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3307
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  3308
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3309
originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3310
    ^ originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3311
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3312
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3313
originDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3314
    originDiffText := something.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3315
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3316
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3317
reallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3318
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3319
    ^self reallyModifiedChannel value
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3320
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3321
    "Created: / 07-10-2011 / 19:28:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3322
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3323
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  3324
!CodeView2::TextView methodsFor:'accessing-colors'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3325
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3326
colorChanged
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3327
    ^ Color redByte:240 greenByte: 192 blueByte: 192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3328
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3329
    "Modified: / 24-06-2010 / 14:05:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3330
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3331
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3332
colorDeleted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3333
    ^ self colorInserted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3334
    "/^ Color pink
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3335
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3336
    "Modified: / 24-06-2010 / 14:16:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3337
    "Modified (format): / 07-10-2011 / 20:26:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3338
    "Modified (format): / 17-07-2012 / 18:57:14 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3339
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3340
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3341
colorInserted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3342
    ^ Color redByte: 239 greenByte: 225 blueByte: 152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3343
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3344
    "Modified: / 24-06-2010 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3345
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3346
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3347
!CodeView2::TextView methodsFor:'accessing-contents'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3348
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3349
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3350
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3351
    super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
13517
7cf990f83349 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13456
diff changeset
  3352
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3353
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  3354
    reallyModifiedChannel value: false.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3355
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3356
    "/JV: used to be notifyLines... but that method
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3357
    "/    leaves suppressNotifications to true, which is not what
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3358
    "/    we want!!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3359
    self updateReallyModified.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3360
    codeView linesModifiedFrom: 1 to: list size.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3361
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3362
    "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3363
    "Modified (comment): / 03-08-2013 / 13:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3364
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3365
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3366
setList:aCollection expandTabs:expandTabs redraw:doRedraw
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3367
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3368
    super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3369
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  3370
    reallyModifiedChannel value: false.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3371
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3372
    "/JV: used to be notifyLines... but that method
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3373
    "/    leaves suppressNotifications to true, which is not what
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3374
    "/    we want!!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3375
    self updateReallyModified.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3376
    codeView linesModifiedFrom: 1 to: list size.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3377
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3378
    "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3379
    "Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3380
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3381
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3382
!CodeView2::TextView methodsFor:'accessing-look'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3383
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3384
lineSpacing
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3385
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3386
    ^lineSpacing
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3387
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3388
    "Modified: / 22-05-1996 / 12:22:29 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3389
    "Created: / 19-03-2012 / 13:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3390
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3391
10785
vrany
parents: 10784
diff changeset
  3392
!CodeView2::TextView methodsFor:'accessing-state'!
vrany
parents: 10784
diff changeset
  3393
vrany
parents: 10784
diff changeset
  3394
beUnmodified
vrany
parents: 10784
diff changeset
  3395
vrany
parents: 10784
diff changeset
  3396
    self modifiedChannel value: false.
vrany
parents: 10784
diff changeset
  3397
    reallyModifiedChannel value: false.
vrany
parents: 10784
diff changeset
  3398
    listOriginal := list copy.
vrany
parents: 10784
diff changeset
  3399
vrany
parents: 10784
diff changeset
  3400
    "Created: / 08-10-2011 / 12:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3401
!
vrany
parents: 10784
diff changeset
  3402
vrany
parents: 10784
diff changeset
  3403
isModified
vrany
parents: 10784
diff changeset
  3404
vrany
parents: 10784
diff changeset
  3405
    ^self modified
vrany
parents: 10784
diff changeset
  3406
vrany
parents: 10784
diff changeset
  3407
    "Created: / 08-10-2011 / 12:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3408
!
vrany
parents: 10784
diff changeset
  3409
vrany
parents: 10784
diff changeset
  3410
isReallyModified
vrany
parents: 10784
diff changeset
  3411
vrany
parents: 10784
diff changeset
  3412
    ^self reallyModified
vrany
parents: 10784
diff changeset
  3413
vrany
parents: 10784
diff changeset
  3414
    "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3415
! !
vrany
parents: 10784
diff changeset
  3416
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3417
!CodeView2::TextView methodsFor:'bit blitting'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3418
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3419
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3420
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3421
    "/ If doing a vertical scroll, optimized Gutter redraw by
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3422
    "/ copying gutter's image...
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3423
    (scrollInProgress and:[aDrawable == self]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3424
        "/ Vertical scroll?
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3425
        ((srcY ~= dstY) and:[srcX = dstX]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3426
            "/ Do copy in gutter, but not accept-cancel bar!!
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3427
            | x0 |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3428
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3429
            x0 := gutterView acceptCancelRight.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3430
            gutterView
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3431
                copyFrom:gutterView
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3432
                       x:x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3433
                       y:srcY
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3434
                     toX:x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3435
                       y:dstY
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3436
                   width:(gutterView width - x0)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3437
                  height:h
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3438
                   async:false
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3439
        ]
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3440
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3441
    ^ super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3442
        copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3443
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3444
    "Modified: / 14-02-2014 / 10:15:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3445
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3446
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3447
!CodeView2::TextView methodsFor:'channels'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3448
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3449
reallyModifiedChannel
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3450
    "return the valueHolder holding true if text was really modified.
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3451
     This is different from #modified, as the inherited modified flag is cleared
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3452
     to trigger another change notification with every keystroke (for the syntaxHighighter).
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3453
     This may be (now) considered a very bad hack"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3454
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3455
    ^ reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3456
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3457
    "Created: / 07-10-2011 / 18:50:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3458
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3459
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3460
reallyModifiedChannel: aValueModel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3461
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3462
    |prev|
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3463
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3464
    prev := reallyModifiedChannel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3465
    prev notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3466
        gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3467
            reallyModifiedChannel removeDependent: gutterView.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3468
        ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3469
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3470
    reallyModifiedChannel := aValueModel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3471
    self setupChannel:aValueModel for:nil withOld:prev.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3472
    gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3473
        reallyModifiedChannel addDependent: gutterView.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3474
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3475
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3476
    "Created: / 07-10-2011 / 18:50:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3477
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3478
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3479
!CodeView2::TextView methodsFor:'delegation-events'!
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3480
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3481
isQuickMenuModifierPressed
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3482
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3483
        ^ self sensor ctrlDown
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3484
    ].
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3485
    ^ self sensor metaDown
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3486
!
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3487
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3488
isQuickMenuModifierReleased
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3489
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3490
        ^ self sensor ctrlDown not
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3491
    ].
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3492
    ^ self sensor metaDown not
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3493
! !
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3494
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3495
!CodeView2::TextView methodsFor:'drawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3496
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3497
backgroundForVisibleLine:visLineNr default:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3498
    | lineNr |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3499
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3500
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3501
    diffMode ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3502
        lineNr := self visibleLineToListLine:visLineNr.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3503
        (insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3504
            ^self colorInserted
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3505
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3506
        (changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3507
            ^self colorChanged
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3508
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3509
        (deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3510
            ^self colorDeleted
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3511
        ].
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3512
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3513
    ^ bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3514
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3515
    "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3516
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3517
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3518
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3519
    "draw a visible line range in fg/bg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3520
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3521
    diffMode ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3522
        super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3523
        ^self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3524
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3525
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3526
    startVisLineNr to: endVisLineNr do:[:visLineNr|
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3527
        self drawVisibleLine: visLineNr with:fg and:bg
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3528
    ]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3529
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3530
    "Modified: / 15-12-1999 / 23:19:39 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3531
    "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3532
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3533
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3534
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3535
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3536
        drawLine:line
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3537
        fromX:x
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3538
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3539
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3540
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3541
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3542
    "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3543
    "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3544
    "Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3545
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3546
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3547
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3548
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3549
        drawLine:lineStringArg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3550
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3551
        col:col
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3552
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3553
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3554
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3555
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3556
    "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3557
    "Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3558
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3559
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3560
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3561
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3562
        drawLine:lineStringArg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3563
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3564
        from:startCol
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3565
        to:endColOrNil
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3566
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3567
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3568
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3569
    "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3570
    "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3571
    "Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3572
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3573
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3574
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3575
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3576
        drawLine:lineString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3577
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3578
        from:startCol
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3579
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3580
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3581
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3582
    "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3583
    "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3584
    "Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3585
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3586
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3587
drawVisibleLine:visLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3588
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3589
        drawVisibleLine:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3590
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3591
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3592
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3593
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3594
    "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3595
    "Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3596
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3597
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3598
!CodeView2::TextView methodsFor:'editing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3599
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3600
contentsChanged
13051
0fcebb7687b4 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13039
diff changeset
  3601
    "this one is sent, whenever contents changes its size"
0fcebb7687b4 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13039
diff changeset
  3602
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3603
    super contentsChanged.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3604
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3605
"/    codeView diffMode ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3606
"/        changedDiffText ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3607
"/            codeView recomputeDiff:self.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3608
"/        ] ifFalse:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3609
"/            changedDiffText := true.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3610
"/        ].  
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3611
"/    ]
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3612
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3613
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3614
    "Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3615
    "Modified: / 01-08-2010 / 20:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3616
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3617
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3618
getNewOriginText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3619
    |i size pole pom text helperText|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3620
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3621
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3622
    pole := list.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3623
    size := list size.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3624
    text:=''.
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  3625
    emptyLines isNil ifTrue:[emptyLines := #()].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3626
    [ i <= size ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3627
        pom := emptyLines indexOf:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3628
        (pom = 0) ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3629
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3630
            (helperText = '') ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3631
                (helperText isNil)ifTrue:[helperText:=''].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3632
                helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3633
                text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3634
            ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3635
        ] ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3636
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3637
            (helperText isNil)ifTrue:[helperText:=''].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3638
            helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3639
            text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3640
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3641
    i:=i+1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3642
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3643
^text
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3644
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3645
    "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3646
    "Modified: / 24-06-2010 / 14:27:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  3647
    "Modified: / 18-11-2011 / 14:58:22 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3648
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3649
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3650
!CodeView2::TextView methodsFor:'editing-basic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3651
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3652
basicDeleteCharsAtLine:lineNr fromCol:startCol toCol:endCol
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3653
    "delete characters from startCol to endCol in line lineNr"
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3654
10731
5904065850c6 Fixed notification in #basicDeleteChars...
vrany
parents: 10728
diff changeset
  3655
    super basicDeleteCharsAtLine:lineNr fromCol:startCol toCol:endCol.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3656
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3657
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3658
    "Created: / 16-09-2011 / 15:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3659
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3660
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3661
basicDeleteFromLine:startLineNr toLine:endLineNr 
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3662
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3663
    super basicDeleteFromLine:startLineNr toLine:endLineNr.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3664
    self notifyLinesDeletedFrom:startLineNr to:endLineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3665
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3666
    "Created: / 28-06-2011 / 09:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3667
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3668
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3669
basicDeleteLineWithoutRedraw:lineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3670
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3671
    super basicDeleteLineWithoutRedraw:lineNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3672
    self notifyLinesDeletedFrom: lineNr to: lineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3673
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3674
    "Created: / 28-06-2011 / 09:10:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3675
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3676
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3677
basicInsert:aCharacter atLine:lineNr col:colNr
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3678
    "insert a single character at lineNr/colNr;
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3679
     set emphasis to character at current position"
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3680
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3681
    super basicInsert:aCharacter atLine:lineNr col:colNr.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3682
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3683
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3684
    "Created: / 16-09-2011 / 15:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3685
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3686
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3687
basicMergeLine:lineNr removeBlanks:removeBlanks
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3688
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3689
    super basicMergeLine:lineNr removeBlanks:removeBlanks.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3690
    self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3691
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3692
    "Created: / 28-06-2011 / 09:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3693
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3694
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3695
basicSplitLine:lineNr before:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3696
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3697
    super basicSplitLine:lineNr before:colNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3698
    self notifyLinesInsertedFrom: lineNr +1 to: lineNr + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3699
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3700
    "Created: / 28-06-2011 / 09:14:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10977
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3701
!
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3702
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3703
basicWithoutRedrawInsertLines:lines from:start to:end before:lineNr
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3704
    super basicWithoutRedrawInsertLines:lines from:start to:end before:lineNr.
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3705
    self updateReallyModified.
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3706
!
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3707
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3708
basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3709
    super basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr.
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  3710
    self updateReallyModified.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3711
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3712
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3713
!CodeView2::TextView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3714
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3715
buttonMotion:button x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3716
17242
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  3717
    (codeView buttonMotion:button x:x y:y in: self) ifFalse:[
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  3718
        super buttonMotion:button x:x y:y
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  3719
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3720
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3721
    "Created: / 14-02-2010 / 16:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3722
    "Modified: / 06-03-2010 / 20:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3723
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3724
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3725
buttonPress: button x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3726
    | ctrlDown  |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3727
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3728
    (codeView buttonPress:button x:x y:y in: self)
12870
798d611cfd62 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12869
diff changeset
  3729
        ifFalse:[super buttonPress:button x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3730
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3731
    ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil]) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3732
        ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3733
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3734
        buttonPress: button
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3735
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3736
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3737
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3738
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3739
    "Created: / 14-02-2010 / 18:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3740
    "Modified: / 06-03-2010 / 20:37:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3741
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3742
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3743
buttonRelease: button x: x y: y
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3744
    (codeView buttonRelease:button x:x y:y in: self)
12870
798d611cfd62 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12869
diff changeset
  3745
        ifFalse:[super buttonRelease:button x:x y:y].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3746
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3747
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3748
keyPress:key x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3749
    (codeView keyPress:key x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3750
        ifFalse:[super keyPress:key x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3751
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3752
    "Modified: / 06-03-2010 / 20:34:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3753
    "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3754
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3755
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3756
keyRelease: key x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3757
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3758
    (codeView keyRelease:key x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3759
        ifFalse:[super keyRelease:key x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3760
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3761
    (key = #Control_L) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3762
        [ codeView highlightClear. self redraw ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3763
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3764
    ^ super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3765
        keyRelease: key
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3766
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3767
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3768
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3769
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3770
    "Created: / 14-02-2010 / 16:38:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3771
    "Modified: / 06-03-2010 / 21:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3772
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3773
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3774
!CodeView2::TextView methodsFor:'formatting'!
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3775
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3776
leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3777
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3778
    | lang |
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3779
    lang := codeView language.
10973
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3780
    "Bit hacky here, should ask language some language toolbox
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3781
    for formatting helper, that should do it..."
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3782
    (lang notNil and:[lang isSmalltalk]) ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3783
        | line lineNo indent |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3784
        lineNo := lineNr.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3785
        [lineNo ~~ 1] whileTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3786
            lineNo  := lineNo - 1.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3787
            line := self listAt:lineNo.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3788
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3789
            line notNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3790
                indent := line indexOfNonSeparatorStartingAt:1.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3791
                "beggining od block"
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3792
                line notEmptyOrNil ifTrue:[
14672
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3793
                    | lastCharIndex lastChar |
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3794
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3795
                    lastCharIndex := line size.
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3796
                    lastChar := nil.
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3797
                    [ lastCharIndex > 0 ] whileTrue:[
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3798
                        (lastChar := line at: lastCharIndex) isSeparator ifTrue:[ 
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3799
                            lastCharIndex := lastCharIndex - 1.
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3800
                        ] ifFalse:[ 
14674
71ed373e94bc Oops, fixed stc compilation problem.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14672
diff changeset
  3801
                            lastCharIndex := -2. "/ To terminate the loop.
14672
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3802
                        ].
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3803
                    ].
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3804
                    lastCharIndex == -2 ifTrue:[
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3805
                        lastChar == $[ ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3806
                            indent := indent + 4.
14672
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3807
                        ] ifFalse:[
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3808
                            "end of block args"
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3809
                            (lastChar == $| and: [line includes: $[]) ifTrue:[
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3810
                                indent := indent + 4.
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3811
                            ]
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3812
                        ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3813
                    ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3814
                ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3815
                indent ~~ 0 ifTrue:[
14672
1359a8b36fe9 Fix in #leftIndentForLine: ignore whitespace at the end of the line.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14638
diff changeset
  3816
                    ^ indent - 1
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3817
                ]
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3818
            ]
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3819
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3820
        ^0.
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3821
    ].
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3822
    ^super leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3823
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3824
    "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14674
71ed373e94bc Oops, fixed stc compilation problem.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14672
diff changeset
  3825
    "Modified: / 24-07-2014 / 09:38:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3826
! !
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3827
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3828
!CodeView2::TextView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3829
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3830
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3831
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3832
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3833
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3834
    changedDiffText := true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3835
    diffMode := false.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3836
    suppressNotifications := false.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3837
    reallyModifiedChannel := false asValue.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3838
    scrollInProgress := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3839
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3840
    self enableMotionEvents.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3841
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3842
    "Created: / 23-06-2010 / 17:28:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3843
    "Modified: / 06-07-2011 / 17:46:31 / jv"
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3844
    "Modified: / 21-08-2011 / 10:09:29 / cg"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3845
    "Modified: / 14-02-2014 / 10:31:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3846
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3847
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3848
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3849
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3850
    codeView := aCodeView2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3851
    codeView addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3852
    gutterView := aCodeView2 gutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3853
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3854
    "Created: / 14-02-2010 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3855
    "Modified: / 17-06-2011 / 12:43:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3856
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3857
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3858
setGutterView: aGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3859
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3860
    self assert: gutterView isNil message:'Attempting to set gutterView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3861
    gutterView := aGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3862
    gutterView setTextView: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3863
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3864
    "Created: / 02-09-2009 / 21:57:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3865
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3866
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3867
!CodeView2::TextView methodsFor:'menu & menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3868
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3869
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3870
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3871
    super accept.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3872
    reallyModifiedChannel value: false.
10785
vrany
parents: 10784
diff changeset
  3873
    listOriginal := list copy.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3874
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3875
    "Created: / 07-10-2011 / 19:36:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3876
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3877
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3878
cancel
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3879
10785
vrany
parents: 10784
diff changeset
  3880
    self list: listOriginal
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3881
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3882
    "Created: / 08-02-2010 / 09:29:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3883
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3884
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3885
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3886
11398
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3887
    ^ codeView editMenu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3888
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3889
    "Created: / 14-02-2010 / 15:49:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11398
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3890
    "Modified (format): / 08-03-2012 / 12:30:22 / cg"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3891
!
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3892
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3893
searchVariableVisible
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3894
    "search variable option in searchbox visible?"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3895
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3896
    ^ true
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3897
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3898
    "Created: / 08-03-2012 / 14:01:51 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3899
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3900
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3901
!CodeView2::TextView methodsFor:'notification'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3902
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3903
notifyLinesDeletedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3904
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3905
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3906
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3907
    codeView linesDeletedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3908
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3909
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3910
    "Created: / 28-06-2011 / 09:12:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3911
    "Modified: / 06-07-2011 / 17:47:05 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3912
    "Modified: / 07-10-2011 / 19:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3913
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3914
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3915
notifyLinesInsertedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3916
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3917
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3918
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3919
    codeView linesInsertedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3920
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3921
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3922
    "Created: / 28-06-2011 / 09:12:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3923
    "Modified: / 06-07-2011 / 17:47:20 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3924
    "Modified: / 07-10-2011 / 19:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3925
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3926
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3927
notifyLinesModifiedFrom: startLine to: endLine
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3928
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3929
    self updateReallyModified.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3930
    suppressNotifications ifTrue:[^self].
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3931
    codeView linesModifiedFrom: startLine to: endLine.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3932
    suppressNotifications := true.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3933
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3934
    "Modified: / 06-07-2011 / 17:47:20 / jv"
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3935
    "Created: / 16-09-2011 / 15:12:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3936
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3937
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3938
!CodeView2::TextView methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3939
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3940
isTextDifferentFromOriginalSource
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3941
    "check for modified code by comparing the source against
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3942
     the codeViews contents.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3943
     That's the true modified value 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3944
     (in case user undid his changes, and the displayed text is actually original)"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3945
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3946
    |different changedSource originalSource 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3947
     lastLineOfChangedSource lastLineOfOriginalSource
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3948
     originalL changedL checkIfDifferent|
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3949
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3950
    "/ possibly call at higher prio to prevent it from being changed while we convert it (by editing)
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3951
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3952
    different := false.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3953
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3954
    "/ cg: don't do that (collecting original/changedSource); 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3955
    "/ for huge files (>8Mb), this makes editing annoying slow (editing a trace output, for example)
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3956
"/        changedSource := list ? #().
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3957
"/        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3958
"/        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3959
"/            changedSource := changedSource removeLast.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3960
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3961
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3962
"/        originalSource := listOriginal ? #() "self model value ? ''".
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3963
"/        originalSource := originalSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3964
"/        [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3965
"/            originalSource := originalSource removeLast
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3966
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3967
"/        originalSource size ~~ changedSource size ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3968
"/            modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3969
"/        ] ifFalse:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3970
"/            | i stopIndex |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3971
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3972
"/            i := 1.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3973
"/            stopIndex := originalSource size + 1.            
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3974
"/            [ modified not and:[ i < stopIndex ] ] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3975
"/                | originalL changedL |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3976
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3977
"/                originalL := ((originalSource at: i) ? '') string.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3978
"/                changedL :=  ((changedSource  at: i) ? '') string.                
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3979
"/                originalL ~= changedL ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3980
"/                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3981
"/                        modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3982
"/                    ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3983
"/                ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3984
"/                i := i + 1.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3985
"/            ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3986
"/        ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3987
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3988
    list size ~~ listOriginal size ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3989
        ^ true
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3990
    ].
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3991
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3992
    "/ instead, do everything without collecting a new stringcollection.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3993
    changedSource := list ? #().
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3994
    lastLineOfChangedSource := changedSource size.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3995
    [lastLineOfChangedSource > 0 and:[(changedSource at:lastLineOfChangedSource) isEmptyOrNil]] whileTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3996
        lastLineOfChangedSource := lastLineOfChangedSource - 1.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3997
    ].        
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3998
    originalSource := listOriginal ? #().
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  3999
    lastLineOfOriginalSource := originalSource size.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4000
    [lastLineOfOriginalSource > 0 and:[(originalSource at:lastLineOfOriginalSource) isEmptyOrNil]] whileTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4001
        lastLineOfOriginalSource := lastLineOfOriginalSource - 1.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4002
    ].        
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4003
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4004
    lastLineOfOriginalSource ~~ lastLineOfChangedSource ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4005
        ^ true.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4006
    ].
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4007
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4008
    checkIfDifferent :=
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4009
        [:lNr |
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4010
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4011
            lNr > originalSource size ifTrue:[
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4012
                originalL := ''.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4013
            ] ifFalse:[
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4014
                originalL := ((originalSource at: lNr) ? '') string.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4015
            ].
14511
f6dfead0637f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14506
diff changeset
  4016
            lNr > changedSource size ifTrue:[
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4017
                changedL := ''.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4018
            ] ifFalse:[
14511
f6dfead0637f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14506
diff changeset
  4019
                changedL :=  ((changedSource at: lNr) ? '') string.                
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4020
            ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4021
            originalL ~= changedL ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4022
                originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4023
                    ^ true.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4024
                ]
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4025
            ].
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4026
        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4027
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4028
    "/ do a quick check in the cursor line. This is most likely to be different
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4029
    "/ saves comparing all the rest in 99% of cases (while typing)
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4030
    (cursorLine notNil and:[cursorLine > 0]) ifTrue:[
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4031
        checkIfDifferent value:cursorLine.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4032
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4033
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4034
    1 to:lastLineOfOriginalSource do:checkIfDifferent.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4035
    ^ false
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4036
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4037
    "Modified: / 07-07-2014 / 11:11:57 / jv"
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4038
!
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4039
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4040
superEditMenu
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4041
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4042
    ^super editMenu
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4043
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4044
    "Created: / 14-02-2010 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4045
!
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4046
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4047
updateReallyModified
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4048
    "check for modified code by comparing the source against
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4049
     the codeViews contents.
16865
d29d2834b10e #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16622
diff changeset
  4050
     That's the true modified value (in case user undid its changes,
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4051
     and the displayed text is actually original"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4052
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4053
    |modified|
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4054
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4055
    reallyModifiedChannel isNil ifTrue:[^self].
17275
ee890e421e64 Issue #116: Cleaned up couple methods in `Tools::CodeView2::TextView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17136
diff changeset
  4056
ee890e421e64 Issue #116: Cleaned up couple methods in `Tools::CodeView2::TextView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17136
diff changeset
  4057
    "/ JV@2011-10-27: Idea is not to do anything if nobody is interested
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4058
    reallyModifiedChannel dependents isEmptyOrNil ifTrue:[^self].
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4059
    modified := self isTextDifferentFromOriginalSource.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4060
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4061
    reallyModifiedChannel value: modified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4062
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4063
    "Created: / 07-10-2011 / 19:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10783
0334ddb2266a care for nil (empty) lines
Claus Gittinger <cg@exept.de>
parents: 10781
diff changeset
  4064
    "Modified: / 08-10-2011 / 11:10:01 / cg"
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  4065
    "Modified: / 28-10-2011 / 09:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17275
ee890e421e64 Issue #116: Cleaned up couple methods in `Tools::CodeView2::TextView`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17136
diff changeset
  4066
    "Modified (comment): / 12-01-2017 / 22:45:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4067
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4068
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4069
!CodeView2::TextView methodsFor:'queries'!
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4070
13625
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4071
editedClass
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4072
    |cls|
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4073
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4074
    (cls := codeView classHolder value) notNil ifTrue:[
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4075
        ^ cls
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4076
    ].
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4077
    ^ super editedClass
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4078
!
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4079
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4080
editedMethod
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4081
    |cls|
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4082
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4083
    (cls := codeView methodHolder value) notNil ifTrue:[
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4084
        ^ cls
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4085
    ].
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4086
    ^ super editedMethod
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4087
!
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4088
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4089
supportsSyntaxElements
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4090
    "syntax elements are a byproduct of the syntax highlighter;
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4091
     it is a list of elements, which chain together same-named variables
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4092
     and parts of a keyword message's selector.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4093
     These allow for quick forward/backward navigation to the next/prev. occurrence
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4094
     of a variable. Be aware that the implementation is buggy, in that it does not
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4095
     deal correctly with same-named blockvars of different blocks"
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4096
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4097
    ^ true
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4098
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4099
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4100
syntaxElementAtPosition:position
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4101
    "is there is a syntax element at position?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4102
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4103
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4104
    |syntaxElements el|
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4105
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4106
    syntaxElements := codeView syntaxElements.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4107
    syntaxElements isEmptyOrNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4108
    el := syntaxElements detect:[:el | position between:el start and:el stop] ifNone:nil.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4109
    el isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4110
    ^ el.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4111
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4112
    "Created: / 08-03-2012 / 14:21:52 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4113
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4114
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4115
syntaxElementForSelectedVariable
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4116
    "is there is a syntax element for a variable under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4117
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4118
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4119
    |element startPosition endPosition|
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4120
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4121
    self selectionAsString isEmptyOrNil ifTrue:[
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4122
        "/ ^ nil.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4123
        element := self syntaxElementForVariableUnderCursor.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4124
    ] ifFalse:[
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4125
        startPosition := self characterPositionOfLine:selectionStartLine col:selectionStartCol.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4126
        endPosition := self characterPositionOfLine:selectionEndLine col:selectionEndCol.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4127
        element := self syntaxElementAtPosition:startPosition.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4128
    ].
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4129
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4130
    (element start = startPosition and:[element stop = endPosition]) ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4131
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4132
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4133
    element isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4134
    ^ element
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4135
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4136
    "Created: / 08-03-2012 / 14:21:15 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4137
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4138
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4139
syntaxElementForSelectorUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4140
    "is there is a syntax element for a message selector under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4141
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4142
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4143
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4144
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4145
    elementUnderCursor := self syntaxElementUnderCursor.
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4146
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4147
    elementUnderCursor isSelector ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4148
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4149
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4150
    "Created: / 08-03-2012 / 12:44:03 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4151
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4152
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4153
syntaxElementForVariableUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4154
    "is there is a syntax element for a variable under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4155
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4156
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4157
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4158
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4159
    elementUnderCursor := self syntaxElementUnderCursor.
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4160
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4161
    elementUnderCursor isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4162
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4163
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4164
    "Created: / 08-03-2012 / 12:44:03 / cg"
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4165
!
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4166
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4167
syntaxElementUnderCursor
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4168
    "is there is a syntax element under the cursor?
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4169
     If so, return the element; otherwise, return nil"
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4170
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4171
    ^ self syntaxElementAtPosition:(self characterPositionOfCursor).
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4172
! !
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4173
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4174
!CodeView2::TextView methodsFor:'scrolling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4175
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4176
basicScrollTo:anOrigin redraw:doRedraw
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4177
    | savedScrollIProgress |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4178
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4179
    savedScrollIProgress := scrollInProgress. 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4180
    scrollInProgress := true.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4181
    [
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4182
        super scrollTo:anOrigin redraw:doRedraw
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4183
    ] ensure:[ 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4184
        scrollInProgress := savedScrollIProgress. 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4185
    ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4186
    "Modified: / 14-02-2014 / 10:12:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4187
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4188
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4189
originChanged:delta
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4190
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4191
    super originChanged:delta.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4192
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  4193
    "/ gutterView invalidate.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4194
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4195
    "Created: / 07-12-2009 / 21:50:49 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4196
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4197
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4198
scrollTo:anOrigin redraw:doRedraw
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4199
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4200
    codeView scrollTo:anOrigin redraw:doRedraw in: self.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4201
    self basicScrollTo:anOrigin redraw:doRedraw
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4202
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4203
    "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4204
    "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4205
    "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4206
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4207
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4208
!CodeView2::TextView methodsFor:'undo & again'!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4209
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4210
nonUndoableDo: aBlock
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4211
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4212
    super nonUndoableDo: aBlock.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4213
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4214
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4215
    "Created: / 06-07-2011 / 17:48:27 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4216
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4217
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4218
undoableDo: aBlock info: into
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4219
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4220
    super undoableDo: aBlock info: into.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4221
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4222
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4223
    "Created: / 06-07-2011 / 17:48:49 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4224
! !
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4225
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4226
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4227
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4228
version
15718
e6317c6a1b66 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15643
diff changeset
  4229
    ^ '$Header$'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4230
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4231
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4232
version_CVS
15718
e6317c6a1b66 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15643
diff changeset
  4233
    ^ '$Header$'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4234
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4235
15637
b2ba737b16b8 Fix in CodeView2's gutter fly-by help generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15629
diff changeset
  4236
version_HG
b2ba737b16b8 Fix in CodeView2's gutter fly-by help generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15629
diff changeset
  4237
b2ba737b16b8 Fix in CodeView2's gutter fly-by help generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15629
diff changeset
  4238
    ^ '$Changeset: <not expanded> $'
b2ba737b16b8 Fix in CodeView2's gutter fly-by help generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15629
diff changeset
  4239
!
b2ba737b16b8 Fix in CodeView2's gutter fly-by help generation
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 15629
diff changeset
  4240
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4241
version_SVN
15718
e6317c6a1b66 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15643
diff changeset
  4242
    ^ '$Id$'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4243
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4244
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4245
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4246
CodeView2 initialize!