Tools__CodeView2.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 29 Aug 2013 21:55:45 +0100
branchjv
changeset 13469 544e7ced18a0
parent 13467 737b357b74b8
child 13491 b3afe831ff0a
permissions -rw-r--r--
Added *Redo* menu item to CodeViwq's context menu (eclipse style)
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
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
     3
	      All Rights Reserved
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     4
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     5
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     6
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     7
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     8
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    10
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    11
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    12
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    13
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    14
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    15
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    16
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    23
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
    24
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
SimpleView subclass:#CodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
		classHolder browserHolder codeAspect modifiedChannel
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    33
		showGutterChannel showAcceptCancelBarChannel modeHolder
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    34
		serviceManager services servicesFromClient syntaxElements
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
    35
		currentParseNodeHolder currentBlockNodeHolder
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    36
		syntaxElementSelection highlightEmphasis diffMode
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    37
		synchronizedCodeViews'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	classVariableNames:'TraceSelectors'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
	category:'Interface-CodeView'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
SimpleView subclass:#GutterView
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    44
	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
    45
		widthAnnotations widthDiffInfo numberOfLines acceptColor
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
    46
		cancelColor diffColor menuHolder currentBlockNodeHolder'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
	classVariableNames:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
	privateIn:CodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
CodeView subclass:#TextView
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    53
	instanceVariableNames:'listOriginal codeView gutterView diffMode deletedLines
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    54
		insertedLines lastFirstLine changedLines scrolled originDiffText
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    55
		emptyLines changedDiffText suppressNotifications
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    56
		reallyModifiedChannel'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
	classVariableNames:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
	privateIn:CodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
copyright
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    66
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
    67
	      All Rights Reserved
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    68
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    69
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    70
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    71
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    72
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    73
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    74
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    75
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    76
conditions:
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
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    79
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    80
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    81
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    82
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    83
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    84
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    85
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    86
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    87
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
    88
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!CodeView2 class methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "Invoked at system start or when the class is dynamically loaded."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    "/ please change as required (and remove this comment)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    TraceSelectors := IdentitySet new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "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
   102
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!CodeView2 class methodsFor:'debugging'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
trace: aSelector
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 add: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
    "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
   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
untrace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    TraceSelectors remove: aSelector ifAbsent:[]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    "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
   118
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
untraceAll
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    TraceSelectors := IdentitySet new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    "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
   125
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
!CodeView2 class methodsFor:'examples'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
example1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    | window codeView |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    window := StandardSystemView new.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   135
    window extent: 300 @ 300.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
    window label: 'CodeView2 example1'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    codeView := Tools::CodeView2 in: window.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    codeView
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   140
	origin: 0.1 @ 0.1
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   141
	corner: 0.9 @ 0.9.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    window open.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    "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
   147
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!CodeView2 class methodsFor:'menu specs'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   151
debugMenu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   152
    "This resource specification was automatically generated
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   153
     by the MenuEditor of ST/X."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   154
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   155
    "Do not manually edit this!! If it is corrupted,
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   156
     the MenuEditor may not be able to read the specification."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   157
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   158
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   159
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   160
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   161
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   162
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   163
    <resource: #menu>
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   164
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   165
    ^
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   166
     #(Menu
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   167
	      (
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   168
	       (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   169
		  label: 'Inspect '
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   170
		  itemValue: inspectView
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   171
		  translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   172
		)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   173
	       (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   174
		  label: 'Inspect Syntax Elements'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   175
		  itemValue: inspectSyntaxElements
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   176
		  translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   177
		)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   178
	       (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   179
		  label: 'Inspect Selected Selector'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   180
		  itemValue: inspectSelectedSelector
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   181
		  translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   182
		)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   183
	       )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   184
	      nil
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   185
	      nil
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   186
	    )
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   187
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   188
    "Created: / 08-07-2011 / 13:36:02 / cg"
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   189
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   190
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    "This resource specification was automatically generated
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
     by the MenuEditor of ST/X."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    "Do not manually edit this!! If it is corrupted,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
     the MenuEditor may not be able to read the specification."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   203
    UserPreferences current eclipseStyleMenus ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   204
	^ self editMenu_eclipseStyle
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   205
    ].
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   206
    ^ self editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   207
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   208
    "Modified: / 08-07-2011 / 13:23:35 / cg"
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   209
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   210
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   211
editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   212
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   213
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   214
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   215
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   216
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   217
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   218
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   219
    "
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   220
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_eclipseStyle
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   221
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   222
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   223
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    <resource: #menu>
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
13469
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   226
    ^ 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
     #(Menu
13469
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   228
        (
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   229
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   230
            label: 'Implementors...'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   231
            itemValue: browseImplementorsOfIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   232
            submenuChannel: implementorsMenu
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   233
            shortcutKey: ImplementorsOfIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   234
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   235
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   236
            label: 'Senders...'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   237
            itemValue: browseSendersOfIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   238
            submenuChannel: sendersMenu
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   239
            shortcutKey: SendersOfIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   240
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   241
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   242
            label: 'Refactor'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   243
            nameKey: refactor
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   244
            isVisible: false
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   245
            shortcutKey: Shift
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   246
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   247
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   248
            label: '-'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   249
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   250
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   251
            label: 'Accept'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   252
            itemValue: accept
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   253
            shortcutKey: Accept
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   254
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   255
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   256
            label: '-'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   257
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   258
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   259
            label: 'Cut'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   260
            itemValue: cut
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   261
            shortcutKey: Cut
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   262
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   263
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   264
            label: 'Copy'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   265
            itemValue: copySelection
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   266
            shortcutKey: Copy
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   267
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   268
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   269
            label: 'Paste'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   270
            itemValue: pasteOrReplace
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   271
            shortcutKey: Paste
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   272
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   273
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   274
            label: '-'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   275
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   276
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   277
            label: 'Undo'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   278
            itemValue: undo
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   279
            shortcutKey: Undo
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   280
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   281
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   282
            label: 'Redo'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   283
            itemValue: redo
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   284
            shortcutKey: Redo
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   285
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   286
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   287
            label: '-'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   288
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   289
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   290
            label: 'Do it'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   291
            itemValue: doIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   292
            shortcutKey: DoIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   293
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   294
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   295
            label: 'Print it'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   296
            itemValue: printIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   297
            shortcutKey: PrintIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   298
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   299
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   300
            label: 'Inspect it'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   301
            itemValue: inspectIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   302
            shortcutKey: InspectIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   303
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   304
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   305
            label: 'Profile it'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   306
            itemValue: profileIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   307
            shortcutKey: InspectIt
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   308
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   309
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   310
            label: '-'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   311
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   312
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   313
            label: 'Show Gutter'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   314
            nameKey: ShowGutter
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   315
            indication: showGutterChannel
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   316
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   317
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   318
            label: 'More'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   319
            nameKey: More
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   320
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   321
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   322
            label: 'Services'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   323
            submenuChannel: servicesMenu
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   324
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   325
         (MenuItem
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   326
            label: 'Debug'
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   327
            submenuChannel: debugMenu
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   328
          )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   329
         )
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   330
        nil
544e7ced18a0 Added *Redo* menu item to CodeViwq's context menu (eclipse style)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13467
diff changeset
   331
        nil
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
      )
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   333
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   334
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   335
editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   336
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   337
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   338
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   339
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   340
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   341
11241
e3d6bdc7a790 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11220
diff changeset
   342
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   343
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   344
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   345
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   346
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   347
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   348
    <resource: #menu>
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   349
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   350
    ^
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   351
     #(Menu
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   352
	(
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   353
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   354
	    label: 'Undo'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   355
	    itemValue: undo
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   356
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   357
	    shortcutKey: Undo
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   358
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   359
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   360
	    label: 'Again'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   361
	    itemValue: again
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   362
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   363
	    shortcutKey: Again
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   364
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   365
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   366
	    label: '-'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   367
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   368
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   369
	    label: 'Cut'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   370
	    itemValue: cut
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   371
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   372
	    shortcutKey: Cut
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   373
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   374
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   375
	    label: 'Copy'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   376
	    itemValue: copySelection
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   377
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   378
	    shortcutKey: Copy
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   379
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   380
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   381
	    label: 'Paste'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   382
	    itemValue: pasteOrReplace
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   383
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   384
	    shortcutKey: Paste
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   385
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   386
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   387
	    label: '-'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   388
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   389
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   390
	    label: 'DoIt'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   391
	    itemValue: doIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   392
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   393
	    shortcutKey: DoIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   394
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   395
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   396
	    label: 'PrintIt'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   397
	    itemValue: printIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   398
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   399
	    shortcutKey: PrintIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   400
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   401
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   402
	    label: 'InspectIt'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   403
	    itemValue: inspectIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   404
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   405
	    shortcutKey: InspectIt
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   406
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   407
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   408
	    label: '-'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   409
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   410
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   411
	    label: 'Accept'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   412
	    itemValue: accept
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   413
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   414
	    shortcutKey: Accept
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   415
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   416
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   417
	    label: '-'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   418
	    isVisible: false
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   419
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   420
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   421
	    label: 'Refactor'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   422
	    nameKey: refactor
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   423
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   424
	    isVisible: false
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   425
	    shortcutKey: Shift
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   426
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   427
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   428
	    label: 'Services'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   429
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   430
	    isVisible: false
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   431
	    submenuChannel: servicesMenu
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   432
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   433
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   434
	    label: '='
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   435
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   436
	 (MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   437
	    label: 'More'
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   438
	    nameKey: More
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   439
	    translateLabel: true
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   440
	    shortcutKey: Ctrl
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   441
	  )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   442
	 )
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   443
	nil
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   444
	nil
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   445
      )
11353
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   446
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   447
    "Modified: / 02-03-2012 / 19:53:19 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
12244
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   450
!CodeView2 methodsFor:'* As yet uncategorized *'!
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   451
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   452
defaultFileNameForSave
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   453
    self halt:'please define defaultFileNameForSave here'.
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   454
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   455
    "Created: / 11-05-2012 / 15:38:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   456
! !
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   457
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
!CodeView2 methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
acceptAction:aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
    textView acceptAction: aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    "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
   465
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   467
breakpoints
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   468
    |s|
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   469
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   470
    (s := self breakpointService) notNil ifTrue:[
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
   471
	^ s breakpoints
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   472
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   473
    ^ nil
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   474
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   475
    "Created: / 06-07-2011 / 18:05:35 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   476
    "Modified: / 06-10-2011 / 14:13:53 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   477
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   478
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   479
browser
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   480
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   481
    ^self browserHolder value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   482
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   483
    "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
   484
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   485
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
codeAspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
    |app|
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   488
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   489
    codeAspect ifNotNil:[^codeAspect].
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   490
    methodHolder value ifNotNil:[^SyntaxHighlighter codeAspectMethod].
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
    ^((app := self topView application) notNil and:[app respondsTo: #codeAspect])
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   493
	ifTrue:[app codeAspect]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   494
	ifFalse:[(SyntaxHighlighter codeAspectExpression)]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   495
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   496
    "Modified: / 27-07-2011 / 13:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   497
    "Modified: / 27-07-2012 / 22:22:27 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   498
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   499
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   500
codeAspect:aSymbol
12301
d9f03189bb66 - Tools::NavigationState
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287
diff changeset
   501
    self assert: ({  SyntaxHighlighter codeAspectClassDefinition .
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   502
		    SyntaxHighlighter codeAspectExpression .
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   503
		    SyntaxHighlighter codeAspectMethod } includes:aSymbol ).
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   504
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   505
    codeAspect ~~ aSymbol ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   506
	codeAspect := aSymbol.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   507
	self update: #codeAspect with: codeAspect from: self.
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   508
    ]
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   509
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   510
    "Modified: / 27-07-2012 / 22:32:19 / cg"
12678
d6e678a09423 Fix in CodeView2 - propagate change in codeAspect to services...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12431
diff changeset
   511
    "Modified: / 15-04-2013 / 23:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
12243
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   514
compilerClass
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   515
    ^textView compilerClass
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   516
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   517
    "Created: / 10-05-2012 / 23:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   518
!
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   519
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   520
compilerClass: aClass
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   521
    textView compilerClass: aClass
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   522
bf110cbcc7d3 - WorkspaceApplication - support for SQLWorkspace
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12229
diff changeset
   523
    "Created: / 10-05-2012 / 23:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    ^textView contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
    "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
   531
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
contents: aStringOrStringCollection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
    textView contents: aStringOrStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
    "/self update:#value with: aStringOrStringCollection from: textView model
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
10330
212b120c198f Improvements in diffing tools
vrany
parents: 10326
diff changeset
   538
    "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
   539
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
12171
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   541
contents: aStringOrStringCollection clear: clearPrevious
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   542
    "Set the contents. If clearPrevous is true, then
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   543
     previous original text is cleared and set to given one.
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   544
     (so the text is considered not modified)"
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   545
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   546
    textView contents: aStringOrStringCollection clear: clearPrevious
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   547
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   548
    "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   549
    "Created: / 17-02-2012 / 00:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   550
!
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   551
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   552
currentParseNode
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   553
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   554
    ^self currentParseNodeHolder value
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   555
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   556
    "Created: / 21-02-2012 / 14:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   557
!
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
   558
12244
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   559
delegate: anObject
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   560
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   561
    super delegate: anObject.
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   562
    self textView delegate: anObject.
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   563
    self gutterView delegate: anObject.
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   564
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   565
    "Created: / 11-05-2012 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   566
!
d47ccc29d519 - WorkspaceApplication
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12243
diff changeset
   567
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
diffMode:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
    diffMode := aBoolean.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
    textView diffMode: aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
    "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
   577
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   578
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   579
editedMethodOrClass:aMethodOrClass
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   580
    textView editedMethodOrClass:aMethodOrClass.
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   581
    aMethodOrClass isBehavior ifFalse:[
13173
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
   582
	self methodHolder value:aMethodOrClass
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   583
    ].
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   584
!
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   585
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   586
font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   587
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   588
    ^textView font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
    "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
   591
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
    ^textView font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
    "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
   598
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
mode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
    ^self modeHolder value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
    "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
   605
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
mode: aSymbol
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   608
    "is this the same as codeAspect ?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   609
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   610
    self assert: (#(expression method) includes: aSymbol).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   611
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
    ^self modeHolder value: aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    "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
   615
    "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
   616
    "Modified (comment): / 27-07-2012 / 22:19:49 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   617
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   618
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   619
model
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   620
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   621
    ^textView model.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   622
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   623
    "Created: / 27-07-2011 / 12:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   624
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   625
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   626
model: aValueModel
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   627
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   628
    |oldValue newValue|
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   629
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   630
    textView model notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   631
	oldValue := textView model value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   632
	textView model removeDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   633
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   634
    textView model: aValueModel.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   635
    textView model notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   636
	textView model addDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   637
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   638
    newValue := textView model value.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   639
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   640
	self update:#value with:newValue from:textView model.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   641
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   642
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12193
diff changeset
   643
    "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   644
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   645
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
    "return true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   649
    ^ self modifiedChannel value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   650
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   651
    "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
   652
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   653
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
modified:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
    "set/clear the modified flag"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   657
    self modifiedChannel value:aBoolean
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   658
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   659
    "Modified: / 14-02-1997 / 16:44:05 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   660
    "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
   661
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
scrolledView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
    ^self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   666
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   667
    "Created: / 14-02-2010 / 22:54:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   670
services
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   671
    ^ services ? #()
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   672
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   673
    "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
   674
    "Modified (format): / 06-10-2011 / 14:11:11 / cg"
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   675
!
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   676
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   677
services:aCollectionOfServices
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   678
    "allow setting of the services (instances);
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   679
     this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   680
     services"
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   681
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   682
    servicesFromClient := true.
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   683
    services := aCollectionOfServices.
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   684
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   685
    "Created: / 06-10-2011 / 14:15:36 / cg"
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   686
!
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   687
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   688
showAcceptCancelBar
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   689
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   690
    ^showAcceptCancelBarChannel value
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   691
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   692
    "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
   693
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   694
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
showGutter
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   696
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
    ^showGutterChannel value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   699
    "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
   700
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
synchronizeWith: aCodeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
    self assert: aCodeView ~= self.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   705
    (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   706
    synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   707
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   708
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12198
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   710
!
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   711
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   712
unsynchronizeWith: aCodeView
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   713
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   714
    self assert: aCodeView ~= self.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   715
    (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].
12198
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   716
    synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   717
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   718
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   719
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
   720
    "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
   721
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   722
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   723
!CodeView2 methodsFor:'accessing - code component'!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   724
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   725
klass
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   726
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   727
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   728
    (v := self classHolder value) notNil ifTrue:[^v].
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   729
    (v := self method) notNil ifTrue:[^v mclass].
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   730
12194
4639848e5517 Improvements in syntax highlighting
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12193
diff changeset
   731
    ^nil
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   732
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   733
    "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
   734
    "Modified: / 22-07-2013 / 13:34:05 / cg"
12205
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
   735
! !
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
   736
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
   737
!CodeView2 methodsFor:'accessing-code component'!
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   738
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   739
klass: aClass
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   740
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   741
    "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   742
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   743
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   744
language
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   745
    "return the value in 'languageHolder'"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   746
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   747
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   748
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   749
    (v := self languageHolder value) notNil ifTrue:[^v].
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   750
    (v := self method) notNil ifTrue:[^v programmingLanguage].
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   751
    (v := self classHolder value) notNil ifTrue:[^v programmingLanguage].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   752
10967
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   753
    "/No, no default language, please.
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   754
    "/^SmalltalkLanguage instance
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   755
    ^nil
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   756
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   757
    "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
   758
    "Modified: / 22-07-2013 / 13:34:17 / cg"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   759
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   760
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   761
language: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   762
    "set the value in 'languageHolder'"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   763
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   764
    self languageHolder value: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   765
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   766
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   767
method
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   768
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   769
    ^self methodHolder value
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   770
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   771
    "Created: / 27-07-2011 / 13:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   772
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   773
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   774
method: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   775
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   776
    ^self methodHolder value: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   777
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   778
    "Created: / 27-07-2011 / 13:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   779
! !
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   780
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
!CodeView2 methodsFor:'aspects'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
browserHolder
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
   784
    browserHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   785
	browserHolder := ValueHolder new
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
    ^browserHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
    "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
   790
    "Modified: / 18-11-2011 / 14:58:15 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
browserHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
    browserHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
    "return/create the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   800
    classHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   801
	classHolder := ValueHolder with: nil.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   802
	classHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
    ^ classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   806
    "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
   807
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
classHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
    "set the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
    classHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   815
	oldValue := classHolder value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   816
	classHolder removeDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
    classHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
    classHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   820
	classHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   823
    newValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   824
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   825
	self update:#value with:newValue from:classHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
    self changed: #classHolder with: old -> classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
    "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   833
currentBlockNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   834
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   835
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   836
    currentBlockNodeHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   837
	currentBlockNodeHolder := ValueHolder new.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   838
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   839
    ^ currentBlockNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   840
!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   841
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   842
currentBlockNodeHolder:something
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   843
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   844
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   845
    currentBlockNodeHolder := something.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   846
!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   847
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   848
currentParseNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   849
    "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   850
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   851
    currentParseNodeHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   852
	currentParseNodeHolder := ValueHolder new.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   853
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   854
    ^ currentParseNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   855
!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   856
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   857
currentParseNodeHolder:something
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   858
    "set the 'currentParseNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   859
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   860
    currentParseNodeHolder := something.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   861
    gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   862
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   863
    "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   864
!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
   865
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
    languageHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   868
	"/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   869
	"/ has to explicitely clear the valueholder. I guess, it is better for the few
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   870
	"/ others to explicitely set it, if they do not provide syntaxHighlighter per method
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   871
	"/ or class.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   872
	languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   873
	languageHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
    ^ languageHolder
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   876
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
   877
    "Modified: / 19-07-2012 / 16:51:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
languageHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
    "set the 'languageHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
    languageHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   886
	oldValue := languageHolder value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   887
	languageHolder removeDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
    languageHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
    languageHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   891
	languageHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
    old := languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   894
    newValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   896
	self update:#value with:newValue from:languageHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
    self changed: #languageHolder with: old -> languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
    "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
   902
    "Modified: / 19-07-2012 / 16:51:08 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   903
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
    "return/create the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
    methodHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   909
	methodHolder := ValueHolder new.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   910
	methodHolder addDependent:self.
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
    ^ methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
methodHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
    "set the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
    methodHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   921
	oldValue := methodHolder value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   922
	methodHolder removeDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
    methodHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   926
    methodHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   927
	methodHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   928
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   929
    newValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   931
	self update:#value with:newValue from:methodHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   932
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   934
    self changed: #methodHolder with: old -> methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
    "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
   937
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   938
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   939
modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
    "return/create the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   942
    "is this the codeAspect?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
    modeHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   944
	modeHolder := #expression asValue.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   945
	modeHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   946
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
    ^ modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   949
    "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
   950
    "Modified (comment): / 27-07-2012 / 22:22:19 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   951
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   952
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   953
modeHolder:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   954
    "set the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   955
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   956
    |oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   957
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   958
    modeHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   959
	oldValue := modeHolder value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   960
	modeHolder removeDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   961
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   962
    modeHolder := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   963
    modeHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   964
	modeHolder addDependent:self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   965
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   966
    newValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   967
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   968
	self update:#value with:newValue from:modeHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
    self changed: #modeHolder with: modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
    "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
   974
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
!CodeView2 methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
update:aspect with:param from:sender
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   979
"/    sender == methodHolder ifTrue:[
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   980
"/        self updateGutter.
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   981
"/    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   982
12269
79f87eee62e5 ChangeSetBrowser2 improvements:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12265
diff changeset
   983
    sender == modeHolder ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   984
	codeAspect := modeHolder value
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   985
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   987
    sender == showGutterChannel ifTrue: [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   988
	self updateGutterVisibility.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   989
	^self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   990
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   992
    services do:[:each |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   993
	each isEnabled ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   994
	    each update:aspect with:param from:sender
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
   995
	]
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   996
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
    super update:aspect with:param from:sender
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1000
    "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
  1001
    "Modified: / 06-10-2011 / 14:14:36 / cg"
12269
79f87eee62e5 ChangeSetBrowser2 improvements:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12265
diff changeset
  1002
    "Modified: / 26-07-2012 / 19:25:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1004
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1005
updateGutter
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1006
13173
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  1007
    self showGutterChannel value ifTrue:[
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  1008
	gutterView invalidate.
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1009
    ]
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1010
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1011
    "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
  1012
!
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1013
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
updateGutterVisibility
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1016
    self showGutterChannel value ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1017
	textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1018
	gutterView beVisible.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1019
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1020
	textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1021
	gutterView beInvisible.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1022
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1023
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1024
    "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1025
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1026
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
!CodeView2 methodsFor:'channels'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
modifiedChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1030
    "return the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1032
    ^ textView modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1033
"/    ^ modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1034
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1035
    "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
  1036
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1037
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
modifiedChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1039
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1041
    textView modifiedChannel removeDependent:self.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1042
    textView modifiedChannel:aValueHolder.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1043
    textView modifiedChannel addDependent:self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1044
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1045
"/    |prev|
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1046
"/
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1047
"/    prev := modifiedChannel.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1048
"/    modifiedChannel := aValueHolder.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1049
"/    self setupChannel:aValueHolder for:nil withOld:prev
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1050
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1051
    "Created: / 30-01-1998 / 14:51:32 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1052
    "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
  1053
    "Modified: / 05-09-2011 / 05:13:27 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1054
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
10785
vrany
parents: 10784
diff changeset
  1056
reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1057
    "return the valueHolder holding true if text was modified"
vrany
parents: 10784
diff changeset
  1058
vrany
parents: 10784
diff changeset
  1059
    ^ textView reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1060
vrany
parents: 10784
diff changeset
  1061
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1062
    "Created: / 08-10-2011 / 12:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1063
!
vrany
parents: 10784
diff changeset
  1064
vrany
parents: 10784
diff changeset
  1065
reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1066
vrany
parents: 10784
diff changeset
  1067
    ^ textView reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1068
vrany
parents: 10784
diff changeset
  1069
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1070
    "Created: / 08-10-2011 / 12:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1071
!
vrany
parents: 10784
diff changeset
  1072
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1073
showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1074
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1075
    ^showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1076
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1077
    "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
  1078
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1079
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1080
showAcceptCancelBarChannel:aValueHolder
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1081
    "set the valueHolder holding true if text was modified"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1082
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1083
    |prev|
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1084
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1085
    prev := showAcceptCancelBarChannel.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1086
    showAcceptCancelBarChannel := aValueHolder.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1087
    self setupChannel:aValueHolder for:nil withOld:prev.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1088
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1089
    "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
  1090
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1091
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
    ^showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
    "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
  1097
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
showGutterChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
    |prev|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
    prev := showGutterChannel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    showGutterChannel := aValueHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
    self setupChannel:aValueHolder for:nil withOld:prev
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
    "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
  1109
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1111
!CodeView2 methodsFor:'code services'!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1112
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1113
browseMethod: method
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1114
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1115
    self browseMethod: method label: nil.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1116
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1117
    "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
  1118
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1119
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1120
browseMethod: method label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1121
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1122
    self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method].
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1123
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1124
	or:[self browser navigationState modified])
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1125
	ifTrue:
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1126
	    [self browser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1127
		spawnFullBrowserInClass: method mclass
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1128
		selector:method selector
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1129
		in:#newBuffer]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1130
	ifFalse:
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1131
	    [self browser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1132
		switchToClass: method containingClass
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1133
		selector: method selector].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1134
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1135
    "Modified: / 19-02-2008 / 10:15:17 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1136
    "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1137
    "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
  1138
    "Modified: / 18-11-2011 / 14:58:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1139
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1140
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1141
browseMethods: methods label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1142
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1143
    methods size = 1 ifTrue:
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1144
	[^self browseMethod: methods anyOne label: label].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1145
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1146
    self browser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1147
	ifNil: [NewSystemBrowser browseMethods: methods title: label]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1148
	ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1149
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1150
    "Created: / 26-12-2007 / 11:32:04 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1151
    "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1152
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1153
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1154
extractSelectorAndSelectedTextFrom: givenSelectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1155
    | selector selectedText compilerClass na |
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1156
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1157
    selectedText := givenSelectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1158
    compilerClass := self language compilerClass.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1159
    selectedText size > 0 ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1160
	"/ self windowGroup withWaitCursorDo:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1161
	    "/ hack, for now and expecco; must ask the Parser eventually...
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1162
	    (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1163
		"/ selector is in one piece anyway
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1164
		(selectedText includes:$_) ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1165
		    "/ zero or one args - sigh (need to parse more to figure this out)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1166
		    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1167
		    selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1168
		] ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1169
		    "/ count _#s plus one arg - sigh
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1170
		    na := (selectedText occurrencesOf:$_) + 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1171
		    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1172
		].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1173
	    ] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1174
		selector := SystemBrowser extractSelectorFrom:selectedText.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1175
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1176
	"/ ]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1177
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1178
    ^Array with: selector with: selectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1179
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1180
    "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
  1181
    "Modified: / 05-03-2012 / 09:04:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1182
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1183
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1184
implementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1185
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1186
    selector isNil ifTrue:[^#()].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1187
    ^SystemBrowser
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1188
	findImplementorsOf: selector
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1189
	in: Smalltalk allClasses
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1190
	ignoreCase: false
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1191
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1192
    "Created: / 26-12-2007 / 11:37:11 / janfrog"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1193
    "Modified: / 18-11-2011 / 14:58:17 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1194
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1195
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1196
sendersOf: selector
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1197
    |senderBlock|
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1198
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1199
    selector isNil ifTrue:[^#()].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1200
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1201
    "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1202
    senderBlock := SystemBrowser searchBlockForSymbol:selector.
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1203
    senderBlock == false ifTrue:[ ^ #() ].
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1204
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1205
    ^ SystemBrowser
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1206
	allMethodsIn:Smalltalk allClasses
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1207
	where:senderBlock.
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1208
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1209
    "/ exact, but much slower
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1210
"/    ^SystemBrowser
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1211
"/        findSendersOf: selector
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1212
"/        in: Smalltalk allClasses
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1213
"/        ignoreCase: false
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1214
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1215
    "Created: / 26-12-2007 / 11:37:22 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1216
    "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
  1217
    "Modified: / 18-11-2011 / 14:58:19 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1218
! !
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1219
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
!CodeView2 methodsFor:'delegation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1223
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1224
    ((textView respondsTo: aMessage selector)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
    and:[(TraceSelectors includes:aMessage selector) not])
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1226
	ifTrue:[^aMessage sendTo: textView].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
    ^super doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    "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
  1230
    "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
  1231
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
    ^textView hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
    "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
  1238
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1239
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1240
!CodeView2 methodsFor:'delegation - events'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1241
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1242
buttonMotion: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1243
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1244
     one service handler method returns true. In that case,
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1245
     the event is is NOT processes by the view."
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1246
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1247
    ^ services
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1248
	contains:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1249
	    service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1250
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1251
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1252
    "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
  1253
    "Modified: / 06-10-2011 / 14:13:57 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1256
buttonPress: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1257
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1258
     one service handler method returns true. In that case,
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1259
     the event is is NOT processes by the view."
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1260
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1261
    ^ services
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1262
	contains:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1263
	    service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1264
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1265
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1266
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
  1267
    "Modified: / 06-10-2011 / 14:14:00 / cg"
12205
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1268
    "Modified (format): / 05-03-2012 / 08:56:02 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1269
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1270
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1271
keyPress: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1272
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1273
     one service handler method returns true. In that case,
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1274
     the event is is NOT processes by the view."
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1275
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1276
    ^ services
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1277
	contains:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1278
	    service isEnabled and:[ ((service keyPress: key x:x y:y in: view) == true) ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1279
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1280
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1281
    "Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
  1282
    "Modified: / 06-10-2011 / 14:14:11 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1283
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1284
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1285
keyRelease: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1286
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1287
     one service handler method returns true. In that case,
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1288
     the event is is NOT processes by the view."
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1289
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1290
    ^ services
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1291
	contains:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1292
	    service isEnabled and:[ ((service keyRelease: key x:x y:y in: view) == true) ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1293
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1294
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1295
    "Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12125
0c49a3b13e43 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12123
diff changeset
  1296
    "Modified: / 06-10-2011 / 14:14:13 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1297
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
12205
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1299
scrollTo:origin redraw:doRedraw in: view
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1300
    view == textView ifTrue: [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1301
	"/my text view scrolled...
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1302
	synchronizedCodeViews do:[:codeView|
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1303
	    codeView scrollTo:origin redraw:doRedraw in: view.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1304
	]
12205
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1305
    ] ifFalse: [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1306
	"/other code view scrolls and I'm notified about that
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1307
	textView basicScrollTo:origin redraw:doRedraw.
12205
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1308
    ]
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1309
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1310
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1311
    "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1312
! !
f210b6224ef0 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12199
diff changeset
  1313
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1314
!CodeView2 methodsFor:'delegation-drawing'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1317
    "See the comment in
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
     CodeViewService>>drawLine:in:atX..."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1319
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
    services do:[:each|
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1321
	each drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1324
    "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
  1325
    "Modified: / 06-10-2011 / 14:14:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1326
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1327
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1328
redrawVisibleLine: visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1329
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1330
    "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
  1331
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1332
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1333
redrawVisibleLine:visLine col:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1335
    "Modified: / 05-11-2007 / 17:35:53 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1336
    "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
  1337
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1338
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1339
redrawVisibleLine:visLine from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1341
    "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
  1342
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1343
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1344
redrawVisibleLine:visLine from:startCol to:endCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1345
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1346
    "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
  1347
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1349
!CodeView2 methodsFor:'delegation-events'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1351
buttonRelease: button x:x y:y in: view
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1356
    ^ services
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1357
	contains:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1358
	    service isEnabled and:[ ((service buttonRelease: button x:x y:y in: view) == true) ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1359
	].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1360
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1361
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1362
highlightInstanceVariable:name
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1363
    services do:[:each|
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  1364
	each highlightInstanceVariable:name
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1365
    ].
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1366
!
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1367
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1368
linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1369
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1370
    services do: [:each |
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1371
	each isEnabled ifTrue: [
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1372
	    each linesDeletedFrom: start to: end
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1373
	]
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1374
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1375
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1376
    "Created: / 06-07-2011 / 17:12:54 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1377
    "Modified: / 06-10-2011 / 14:14:16 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1378
    "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
  1379
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1380
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1381
linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1382
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1383
    services do: [:each |
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1384
	each isEnabled ifTrue: [
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1385
	    each linesInsertedFrom: start to: end
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1386
	]
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1387
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1388
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1389
    "Created: / 06-07-2011 / 17:12:48 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1390
    "Modified: / 06-10-2011 / 14:14:20 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1391
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1392
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1393
linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1394
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1395
    services do: [:each |
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1396
	each isEnabled ifTrue: [
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1397
	    each linesModifiedFrom: start to: end
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1398
	]
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1399
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1400
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1401
    "Created: / 06-07-2011 / 17:12:58 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1402
    "Modified: / 06-10-2011 / 14:13:44 / cg"
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  1403
! !
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
!CodeView2 methodsFor:'diff mode'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1406
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1407
recomputeDiff:view
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1408
    |t1 t2 pom diffHelper view2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1409
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1410
    t1 := view getNewOriginText.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1411
    synchronizedCodeViews do:[:codeView |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1412
	view2 := codeView
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1413
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1414
    view changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1415
    view2 changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1416
    t2 := view2 getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1417
    pom := DiffCodeView2 new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1418
    (view == textView) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1419
	diffHelper := pom computeDiffDataForText1:t1 text2:t2.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1420
	(view) contents:(diffHelper text1).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1421
	(view) deletedLines:(diffHelper deleted).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1422
	(view) changedLines:(diffHelper changed).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1423
	(view) originDiffText:t1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1424
	(view) emptyLines:(diffHelper inserted).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1425
	(view) changedLines:(diffHelper changed).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1426
	(view2) contents:(diffHelper text2).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1427
	(view2) insertedLines:(diffHelper inserted).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1428
	(view2) changedLines:(diffHelper changed).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1429
	(view2) originDiffText:t2.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1430
	(view2) emptyLines:(diffHelper deleted).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1432
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1433
    "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1434
    "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
  1435
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1436
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
!CodeView2 methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1438
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1439
defaultServices
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1440
    "/ used to call "CodeViewService availableServices",
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1441
    "/ which enumerated all subclasses.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1442
    "/ 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
  1443
    "/ subclasses to be built for special applications. For example,
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1444
    "/ 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
  1445
    "/ expecco's codeview.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1446
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1447
    "/ 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
  1448
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1449
    ^ CodeViewService availableServices
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  1450
	select:[:service | service isUsefulFor:self]
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1451
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1452
    "Created: / 22-07-2013 / 13:57:40 / cg"
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1453
!
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1454
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1455
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1456
    "Invoked when a new instance is created."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1457
    "Call super initialize"
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1458
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1459
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1460
     "Now set up some visual properties"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1461
    self level:-1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1462
     "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
  1463
    showGutterChannel := ValueHolder with: true.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1464
    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
  1465
    "/ 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
  1466
    "/ 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
  1467
    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
  1468
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1469
    "/ 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
  1470
    "/ initialize methods
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1471
    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
  1472
    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
  1473
    textView := textViewScroller scrolledView.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1474
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1475
    self initializeGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1476
    self initializeTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1477
    textView setCodeView:self.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1478
    modifiedChannel := ValueHolder with:false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
    diffMode := false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1480
    synchronizedCodeViews := #().
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1481
    currentParseNodeHolder := ValueHolder new.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1482
    currentBlockNodeHolder := ValueHolder new.
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1483
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1484
    servicesFromClient := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1485
    services := OrderedCollection new.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  1486
    self initializeServices.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1487
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1488
    "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1489
    "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
  1490
    "Modified: / 06-10-2011 / 14:15:48 / cg"
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1491
    "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
  1492
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1493
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1494
initializeGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1496
    gutterView setCodeView:self.
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  1497
    gutterView origin:(0.0 @ 0.0) corner:(gutterView preferredWidth+1 @ 1.0).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
    showGutterChannel value ifTrue:[self addSubView: gutterView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1499
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1500
    "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
  1501
    "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
  1502
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1503
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1504
initializeServices
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1505
    | serviceClasses |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
  1506
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1507
    "/ 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
  1508
    "/ (FileBrowser does not want Smalltalk-specific services)
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1509
    servicesFromClient ifFalse:[
13333
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  1510
	serviceClasses := self defaultServices sort:[:a :b|a priority = b priority ifTrue:[a name < b name] ifFalse:[a priority > b priority]].
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  1511
	serviceClasses do:[:cls|
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  1512
	    self registerService: cls new
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  1513
	].
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1514
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1515
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1516
    "Modified: / 22-07-2013 / 14:02:59 / cg"
13252
25aeeb900a64 Fix in Tools::CodeView2 after bad merge
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13250
diff changeset
  1517
    "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
  1518
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1519
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
initializeTextView
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1521
    "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
  1522
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1523
    textViewScroller
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1524
	origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1525
	corner: 1.0@1.0;
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1526
	level: 0.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
    textView level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1529
    textView modifiedChannel addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1530
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
    "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
  1532
    "Modified: / 23-06-2010 / 19:38:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
!CodeView2 methodsFor:'menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1536
10689
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1537
accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1538
    textView accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1539
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1540
    "Created: / 07-09-2011 / 21:29:07 / cg"
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1541
!
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1542
10375
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1543
again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1544
    textView again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1545
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1546
    "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
  1547
    "Created: / 22-07-2011 / 17:44:31 / cg"
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1548
!
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1549
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1550
browseImplementorsOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1551
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1552
    textView browseImplementorsOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1553
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1554
    "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
  1555
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1556
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1557
browseSendersOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1558
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1559
    textView browseSendersOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1560
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1561
    "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
  1562
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1563
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1564
copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1565
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1566
    textView copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1567
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1568
    "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
  1569
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1570
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1571
cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1572
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1573
    textView cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1574
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1575
    "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
  1576
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1577
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1578
doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1579
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1580
    textView doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1581
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1582
    "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
  1583
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1584
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1585
inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1586
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1587
    textView inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1588
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1589
    "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
  1590
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1591
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1592
inspectSelectedSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1593
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1594
    self error: 'Not yet implemented'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1595
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1596
    "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
  1597
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1598
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1599
inspectSyntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1600
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1601
    syntaxElements inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1602
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1603
    "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
  1604
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1605
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1606
inspectView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1607
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1608
    self inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1609
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1610
    "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
  1611
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1612
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1613
pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1614
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1615
    textView pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1617
    "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
  1618
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1619
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1620
printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1621
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1622
    textView printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1623
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1624
    "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
  1625
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1626
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1627
profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1628
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1629
    textView profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1630
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1631
    "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
  1632
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1635
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
    textView undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1637
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1638
    "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
  1639
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1640
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1641
!CodeView2 methodsFor:'menus-dynamic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1642
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1643
debugMenu
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1644
    ^ self class debugMenu decodeAsLiteralArray
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  1645
	receiver:self.
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1646
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1647
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1648
editMenu
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1649
    | editMenu superEditMenu moreMenu moreMenuItem |
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1650
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1651
    superEditMenu := textView superEditMenu.
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1652
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1653
    textView sensor ctrlDown ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1654
	^superEditMenu
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1655
    ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1656
13072
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1657
    "/ install the standard 'more' menu into my own menu
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1658
    moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  1659
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1660
    editMenu := self class editMenu decodeAsLiteralArray.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1661
    moreMenuItem := editMenu menuItemLabeled: 'More'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1662
    moreMenuItem submenu: moreMenu asMenu.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1663
    editMenu findGuiResourcesIn: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1664
    ^editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1665
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1666
    "Created: / 25-12-2007 / 10:10:01 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1667
    "Modified: / 25-12-2007 / 19:50:53 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1668
    "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
  1669
    "Modified: / 08-07-2011 / 13:35:31 / cg"
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1670
    "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
  1671
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1673
implementorsMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1674
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1675
    | selectorAndSelectedText selector selectedText  implementors |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1676
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1677
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1678
    selectedText size > 0 ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1679
	"/ self windowGroup withWaitCursorDo:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1680
	    selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1681
	    selector := selectorAndSelectedText first.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1682
	    selectedText := selectorAndSelectedText second.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1683
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1684
	    (selector notNil and:[selector = selectedText]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1685
		implementors := (SystemBrowser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1686
				    findImplementorsOf:selectedText "Any: (Array with:selectedText)"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1687
				    in:(Smalltalk allClasses)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1688
				    ignoreCase:false)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1689
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1690
	    ] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1691
		implementors := (SystemBrowser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1692
				    findImplementorsOfAny:(Array with:selectedText with: selector)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1693
				    in:(Smalltalk allClasses)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1694
				    ignoreCase:false)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1695
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1696
	"/ ]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1697
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1698
	implementors := #().
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1699
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1700
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1701
    ^self implementorsMenu: implementors selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1702
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1703
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1704
    "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
  1705
    "Modified: / 05-03-2012 / 09:02:43 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1706
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1707
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1708
implementorsMenu: implementors selector: selector
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1709
    | menu|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1710
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1712
    implementors isEmptyOrNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1713
	menu addItem:(MenuItem label:'No implementors found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1715
	menu addItem:(MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1716
		    label:(selector storeString , (' (all implementors) ') asText allItalic)
13173
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  1717
		    itemValue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1718
			self browseMethods:implementors
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1719
			    label:'Implementors of ' , selector storeString
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1720
		    ]).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1721
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1722
	menu addSeparator.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1723
	(implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1724
	"implementors" do:[:mth |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1725
	    menu
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1726
		addItem:(MenuItem label:(selector storeString
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1727
				, (' in ' , mth containingClass name asText allBold))
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1728
			value:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1729
	]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1730
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1732
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1733
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1734
    "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11377
e995583db311 changed:
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
  1735
    "Modified: / 07-03-2012 / 12:56:56 / cg"
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
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1738
sendersMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1739
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1740
    | selectorAndSelectedText selector selectedText  senders |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1741
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1742
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1743
    selectedText size > 0 ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1744
	"/ self windowGroup withWaitCursorDo:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1745
	    selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1746
	    selector := selectorAndSelectedText first.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1747
	    selectedText := selectorAndSelectedText second.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1748
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1749
	    (selector notNil and:[selector = selectedText]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1750
		senders := (SystemBrowser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1751
				findSendersOf:selectedText "Any:(Array with:selectedText)"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1752
				in:(Smalltalk allClasses)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1753
				ignoreCase:false)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1754
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1755
	    ] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1756
		senders := (SystemBrowser
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1757
				findSendersOfAny:(Array with:selectedText with: selector)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1758
				in:(Smalltalk allClasses)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1759
				ignoreCase:false)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1760
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1761
	"/ ]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1762
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1763
	senders := #().
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1764
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1765
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1766
    ^self sendersMenu: senders selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1767
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1768
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1769
    "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
  1770
    "Modified: / 05-03-2012 / 09:02:56 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1771
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1772
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1773
sendersMenu: senders  selector: selector
11377
e995583db311 changed:
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
  1774
    | menu shownSenderItems numCut sendersSorted|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1776
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1777
    senders isEmptyOrNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1778
	menu addItem:(MenuItem label:'No senders found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1780
	menu addItem:(MenuItem
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1781
		    label:(selector storeString , (' (all senders)') asText allItalic)
13173
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  1782
		    itemValue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1783
			self browseMethods:senders
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1784
			    label:'Senders of ' , selector storeString
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1785
		    ]).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1786
	menu addSeparator.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1787
	sendersSorted := senders asOrderedCollection
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1788
			    sort:[:a :b | a whoString < b whoString].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1789
	shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1790
	numCut := senders size - 20.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1791
	shownSenderItems do:[:mth |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1792
	    menu
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1793
		addItem:(MenuItem label:(mth selector storeString
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1794
				, (' in ' , mth containingClass name asText allBold))
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1795
			value:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1796
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1797
	numCut > 0 ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1798
	    menu addSeparator.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1799
	    menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1800
	].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1803
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
    "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
    "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
  1806
    "Modified: / 07-07-2011 / 14:51:54 / jv"
11377
e995583db311 changed:
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
  1807
    "Modified: / 07-03-2012 / 12:58:31 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1808
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
servicesMenu
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1811
    |menu item anyService|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1812
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
    menu := Menu new.
13110
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  1814
    item := (MenuItem label:(resources string:'Services (experimental)')) enabled:false.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  1815
    menu addItem:item.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  1816
    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1817
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1818
    "/ disabled, because this menu is now on the gutter,
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1819
    "/ and it makes it hard to show it again, once hidden
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1820
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1821
"/    item := MenuItem label:(resources string:'Show Gutter').
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1822
"/    item indication:(self showGutterChannel).
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1823
"/    menu addItem:item.
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  1824
"/    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1825
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1826
    anyService := false.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1827
    services do:[:service |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1828
	|item|
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1829
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1830
	item := MenuItem label:(resources string:service label).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1831
	item indication:((AspectAdaptor forAspect:#enabled) subject:service).
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  1832
	item hideMenuOnActivated:false.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1833
	menu addItem:item.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1834
	anyService := true.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1835
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1836
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1837
    anyService ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1838
	menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1839
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1840
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1841
    item := MenuItem label:(resources string:'Debug').
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  1842
    item submenuChannel:[ self debugMenu ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1843
    menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1844
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1845
    ^ menu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1846
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1847
    "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
  1848
    "Modified: / 06-10-2011 / 14:14:30 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1849
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1850
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1851
!CodeView2 methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1852
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
codeCompletion
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1854
    |cls
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
"/     crsrPos interval node checkedNode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1856
"/     char start stop selectorSoFar matchingSelectors
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1857
    |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1858
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1859
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1860
    cls := self classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1861
    cls isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1862
	self showInfo:'No class'.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1863
	^ self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1864
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
    UserInformation handle:[:ex |
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1866
	self showInfo:(ex messageText).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1867
	ex proceed.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1868
    ] do:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1869
	self withWaitCursorDo:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1870
	    DoWhatIMeanSupport codeCompletionForClass:cls codeView:self.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1871
	]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
    ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1874
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1875
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1876
"/    interval := self selectedInterval.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
"/    interval isEmpty ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1878
"/        crsrPos := codeView characterPositionOfCursor - 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1879
"/        char := codeView characterUnderCursor.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1880
"/        [crsrPos > 1 and:[char isSeparator or:['.' includes:char]]] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1881
"/            crsrPos := crsrPos - 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
"/            char := codeView characterAtCharacterPosition:crsrPos.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1883
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1884
"/        interval := crsrPos to:crsrPos.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1886
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1887
"/    node := self findNodeForInterval:interval allowErrors:true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1888
"/    [node isNil] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1889
"/        "/ expand to the left ...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1890
"/        interval start > 1 ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1891
"/            self showInfo:'No parseNode found'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1892
"/            ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1894
"/        interval start:(interval start - 1).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1895
"/        node := self findNodeForInterval:interval allowErrors:true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1896
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1897
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1898
"/    node isVariable ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1899
"/        self codeCompletionForVariable:node inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1900
"/        ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1901
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1902
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
"/    checkedNode := node.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
"/    [checkedNode notNil] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
"/        checkedNode isMessage ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
"/            self codeCompletionForMessage:checkedNode inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1907
"/            ^ self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1908
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
"/        checkedNode isMethod ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
"/            self codeCompletionForMethod:checkedNode inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1911
"/            ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1913
"/        checkedNode := checkedNode parent.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1914
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1915
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
"/    self showInfo:'Node is neither variable nor message.'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1917
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1918
    "Modified: / 04-07-2006 / 18:48:26 / fm"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1919
    "Modified: / 20-11-2006 / 12:30:59 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1920
    "Modified: / 16-02-2010 / 10:53:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1921
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1922
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1923
reallyModified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1924
    "check for modified code by comparing the source against
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1925
     the codeViews contents.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1926
     Thats the true modified value (in case user undid its changes,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1927
     and the displayed text is actually original"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1928
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1929
    |modified changedSource originalSource s1 s2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1931
    textView modified ifTrue:[^true].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1932
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
    "/ higher prio to prevent it from being changed while we convert it (by editing)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1934
    Processor activeProcess
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1935
	withHigherPriorityDo:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1936
	    changedSource := textView contentsAsString asStringCollection.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1937
	].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1938
    changedSource := changedSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1939
    changedSource := changedSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1940
    [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1941
	changedSource := changedSource copyButLast:1
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1943
    changedSource := changedSource asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1945
	originalSource := textView model value ? ''.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1946
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1947
	originalSource := originalSource asStringCollection.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1948
	originalSource := originalSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
13182
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  1949
	originalSource := originalSource collect:[:line | line asNilIfEmpty].
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1950
	[originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1951
	    originalSource := originalSource copyButLast:1
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1952
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1953
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1954
	s1 := originalSource asString.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1955
	s2 := changedSource asString.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1956
	modified := (s1 ~= s2).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1957
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1958
    ^ modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1959
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1960
    "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
  1961
    "Modified (format): / 05-06-2012 / 23:55:02 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1962
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1963
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1964
showInfo: message
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1965
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1966
    | app |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1967
    (app := self topView application) ifNotNil:
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1968
	[(app respondsTo: #showInfo:) ifTrue:
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1969
	    [app showInfo: message]].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1970
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1971
    "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
  1972
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1973
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1974
!CodeView2 methodsFor:'private-accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1975
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
    ^gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1980
    "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
  1981
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1982
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1983
syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1984
    ^ syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1985
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1986
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1987
syntaxElementSelection:anElement
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1988
    syntaxElementSelection := anElement.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1989
    anElement isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1990
	currentParseNodeHolder value: nil.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1991
	currentBlockNodeHolder value: nil.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1992
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1993
	currentParseNodeHolder value: anElement node.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  1994
	currentBlockNodeHolder value: anElement node enclosingBlock.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1995
    ]
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1996
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  1997
    "Modified: / 16-02-2012 / 23:06:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1998
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1999
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2000
syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2001
    ^ syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2002
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2003
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
syntaxElements:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
    syntaxElements := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2007
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2008
textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2009
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2010
    ^textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2011
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2012
    "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
  2013
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2014
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2015
textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2016
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2017
    ^textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2018
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2019
    "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
  2020
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2021
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2022
!CodeView2 methodsFor:'realization'!
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2023
13062
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2024
disableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2025
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2026
    services do:[:service|
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2027
	service enabled:false.
13062
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2028
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2029
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2030
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2031
enableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2032
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2033
    services do:[:service|
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2034
	service enabled:true.
13062
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2035
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2036
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2037
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2038
postRealize
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2039
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2040
    services do:[:service|
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2041
	service viewRealized.
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2042
    ]
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2043
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2044
    "Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2045
! !
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2046
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2047
!CodeView2 methodsFor:'services'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2048
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2049
breakpointService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2050
    "that one or nil"
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2051
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2052
    ^ services detect:[:any| (any isKindOf: BreakpointService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2053
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2054
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2055
registerService: aCodeViewService
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2056
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2057
    services add: aCodeViewService.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2058
    aCodeViewService registerIn: self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2059
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2060
    "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
  2061
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2062
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2063
syntaxHighlightingService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2064
    "that one or nil"
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2065
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2066
    ^ services detect:[:any| (any isKindOf: CodeHighlightingService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2067
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2068
13125
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2069
unregisterAllServices
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2070
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2071
    services copy do:[:eachService | self unregisterService:eachService ].
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2072
!
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2073
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
  2074
unregisterService: aCodeViewService
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2075
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2076
    services remove: aCodeViewService ifAbsent:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2077
    aCodeViewService unregister.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2078
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2079
    "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
  2080
    "Created: / 19-07-2012 / 16:34:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2081
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2082
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
!CodeView2 methodsFor:'testing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2084
10722
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2085
isCodeView2
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2086
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2087
    ^true
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2088
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2089
    "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
  2090
!
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2091
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2092
isTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2093
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2094
    ^true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2095
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2096
    "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
  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::GutterView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2100
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2101
menuHolder:aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2102
    menuHolder := aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2103
!
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2104
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2105
setTextView: aTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2106
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2107
    self assert: textView isNil message:'Attempting to set textView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2108
    textView := aTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2109
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2110
    textView addDependent:self.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2111
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2112
    "/ self backgroundPaint: textView backgroundPaint darkened lighter.
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2113
    self viewBackground: (View defaultBackgroundColor). "/ textView backgroundPaint darkened lighter.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2114
    self paint: textView paint.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2115
    self font: textView font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2116
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2117
    "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
  2118
    "Modified: / 14-12-2009 / 15:09:29 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2119
    "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
  2120
    "Modified: / 17-08-2011 / 15:15:09 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2123
setTextViewScroller:aScr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2124
    textViewScroller := aScr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2125
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2126
    "Created: / 07-12-2009 / 22:36:31 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2127
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2128
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2129
!CodeView2::GutterView methodsFor:'accessing-dimensions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2130
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2131
acceptButtonBottom
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2132
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2133
    ^(self height * 0.6) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2134
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2135
    "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
  2136
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2137
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2138
cancelButtonBottom
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2139
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2140
    ^(self height * 0.8) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2141
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2142
    "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
  2143
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2144
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2145
padding
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2146
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2147
    ^self paddingLeft + self paddingRight
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2148
	+ self usedWidthForAcceptCancel
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2149
	+ (widthAnnotations ? 0)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2150
	+ (widthDiffInfo ? 0)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2151
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2152
    "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
  2153
    "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
  2154
    "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
  2155
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2156
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2157
paddingLeft
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2158
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2159
    ^0"px"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2160
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2161
    "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
  2162
    "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
  2163
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2164
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2165
paddingRight
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2166
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2167
    ^3"px"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
    "Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2170
    "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
  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
preferredExtent
11467
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2174
    | font w h |
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
    explicitExtent ifNotNil:[^explicitExtent].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2177
    preferredExtent ifNotNil:[^preferredExtent].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2178
11467
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2179
    font := self font.
9465ed2c4e74 comment
Claus Gittinger <cg@exept.de>
parents: 11429
diff changeset
  2180
    w := (font widthOf:'00') + self padding.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2181
    h := textView notNil
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2182
	    ifTrue:[textView height]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2183
	    ifFalse:[font height * 12].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2184
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2185
    ^preferredExtent := w @ h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2186
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2187
    "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
  2188
    "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
  2189
!
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2190
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2191
usedWidthForAcceptCancel
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2192
    ^ (codeView showAcceptCancelBar ifTrue:[widthAcceptCancel ? 0] ifFalse:[0])
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2193
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2194
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2195
!CodeView2::GutterView methodsFor:'actions'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2196
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2197
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2198
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2199
    textView accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2200
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2201
    "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
  2202
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2203
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2204
cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2205
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2206
    textView cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2207
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2208
    "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
  2209
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2210
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2211
diff
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2212
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2213
    "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
  2214
!
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2215
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2216
inspectView
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2217
    self halt.
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2218
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2219
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2220
middleButtonMenu
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2221
    menuHolder notNil ifTrue:[^ menuHolder value].
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2222
    ^ codeView servicesMenu
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2223
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2224
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2225
!CodeView2::GutterView methodsFor:'aspects'!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2226
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2227
currentBlockNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2228
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2229
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2230
    currentBlockNodeHolder isNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2231
	currentBlockNodeHolder := ValueHolder new.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2232
	currentBlockNodeHolder addDependent:self.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2233
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2234
    ^ currentBlockNodeHolder
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2235
!
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2236
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2237
currentBlockNodeHolder:something
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2238
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2239
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2240
    |oldValue newValue|
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2241
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2242
    currentBlockNodeHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2243
	oldValue := currentBlockNodeHolder value.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2244
	currentBlockNodeHolder removeDependent:self.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2245
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2246
    currentBlockNodeHolder := something.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2247
    currentBlockNodeHolder notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2248
	currentBlockNodeHolder addDependent:self.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2249
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2250
    newValue := currentBlockNodeHolder value.
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2251
    oldValue ~~ newValue ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2252
	self update:#value with:newValue from:currentBlockNodeHolder.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2253
    ].
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2254
! !
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2255
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2256
!CodeView2::GutterView methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2257
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2258
adjustSizeForLongestLine
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2259
    "recompute the required width (longest linenumber present, not shown)"
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2260
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2261
    |newNumberOfLines longestLineString textW requiredW newWidth|
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2262
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2263
    newNumberOfLines := (textView list size max:textView cursorLine).
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2264
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2265
    longestLineString := self displayedString:(newNumberOfLines max:99).
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2266
    textW := (longestLineString widthOn:self).
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2267
    requiredW := textW + self padding.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2268
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2269
    ((requiredW > width) or:[requiredW < (width * 3 // 4)]) ifTrue:[
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2270
	"/ some hysteresis to avoid quick readjust again
13333
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  2271
	newWidth := (requiredW "* 1.1") rounded.
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2272
	self corner:(newWidth+1 @ 1.0).
13333
2e8aa3023772 Merged 5c76049c86f1 and a7279fa00799 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13323 13316
diff changeset
  2273
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2274
	[
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2275
	    textView removeDependent:self.
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2276
	    textViewScroller origin:(newWidth+1 @ 0.0) corner:(1.0 @ 1.0).
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2277
	] ensure:[
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2278
	    textView addDependent:self.
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2279
	].
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2280
	self invalidate.
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2281
    ] ifFalse:[
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2282
	numberOfLines ~= newNumberOfLines ifTrue:[
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2283
	    self invalidate
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2284
	]
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2285
    ].
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2286
!
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2287
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2288
update:something with:aParameter from:changedObject
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2289
"/    self shown ifFalse:[^self].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2290
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2291
    (changedObject == textView) ifTrue:[
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2292
	((something == #sizeOfContents)
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2293
	or:[ false "(something == #sizeOfView)" ]) ifTrue:[
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2294
	    self adjustSizeForLongestLine.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2295
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2296
"/            (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2297
"/                self invalidate.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2298
"/            ].
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2299
	    ^ self.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2300
	].
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2301
	something == #originOfContents ifTrue:[
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2302
	    self invalidate.
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2303
	    ^ self.
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2304
	].
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  2305
	"/ something printCR.
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2306
    ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2307
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2308
    (changedObject == textView reallyModifiedChannel) ifTrue:[
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2309
	"/ cg: I think this is rubbish: if any service needs that, it should make itself
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2310
	"/ dependent of it itself (leads to many redraws for non-existing accept-cancel bar,
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2311
	"/ if no such service is active)
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2312
	"/ self invalidate.
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2313
	^ self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2314
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2315
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2316
    super update:something with:aParameter from:changedObject
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2317
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2318
    "Modified (format): / 15-07-2011 / 20:14:04 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2319
    "Modified: / 07-10-2011 / 19:25:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2320
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2321
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2322
!CodeView2::GutterView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2323
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2324
buttonPress: btn x: x y: y
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2325
    |extraSafeArea|
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2326
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2327
    (x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2328
	textView reallyModified ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2329
	    (y < self acceptButtonBottom) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2330
		self accept.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2331
		^self.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2332
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2333
	    (y < self cancelButtonBottom) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2334
		self cancel.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2335
		^self.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2336
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2337
	    self diff.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2338
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2339
	^self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2340
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2341
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2342
false ifTrue:[
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2343
    "Do not allow clicking on line numbers..."
11769
Claus Gittinger <cg@exept.de>
parents: 11706
diff changeset
  2344
    extraSafeArea := "('999' widthOn:self)" 5.
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2345
    x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2346
].
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2347
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2348
    ((x > (self paddingLeft + self usedWidthForAcceptCancel)) or:
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2349
	[x < (self width - self paddingRight - widthDiffInfo)]
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2350
    ) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2351
	(codeView buttonPress: btn x:x y:y in: self) ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2352
	    super buttonPress: btn x: x y: y
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2353
	]
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2354
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2355
	super buttonPress: btn x: x y: y
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  2356
    ]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2357
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2358
    "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
  2359
    "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2360
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2361
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2362
!CodeView2::GutterView methodsFor:'help'!
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2363
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2364
flyByHelpText
13127
0971f612c702 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13125
diff changeset
  2365
    |bpntService|
12903
22da380892a5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12870
diff changeset
  2366
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2367
    bpntService := codeView breakpointService.
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2368
    (bpntService isNil or:[bpntService isEnabled not]) ifTrue:[
13180
64a4186ddfce Merged b5d9725e479a and 207c334d6f58 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13178 13127
diff changeset
  2369
	^ nil
12903
22da380892a5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12870
diff changeset
  2370
    ].
13127
0971f612c702 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13125
diff changeset
  2371
    ^ bpntService flyByHelpText
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2372
! !
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  2373
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2374
!CodeView2::GutterView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2375
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2376
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2377
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2378
    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
  2379
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2380
    widthAcceptCancel := 16.
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
  2381
    widthAnnotations := "16"8.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2382
    widthDiffInfo := 5.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2383
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2384
    acceptColor := Color green lighter onDevice:device.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2385
    cancelColor := Color red lighter lighter onDevice:device.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2386
    diffColor := Color yellow lighter lighter onDevice:device.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2387
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2388
    "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
  2389
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2390
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2391
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2392
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2393
    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
  2394
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2395
    codeView addDependent: self.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2396
    codeView reallyModifiedChannel addDependent: self.
12224
eabcf6fc3857 - XTermView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12221
diff changeset
  2397
    codeView currentBlockNodeHolder addDependent: self.
eabcf6fc3857 - XTermView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12221
diff changeset
  2398
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2399
    textView := aCodeView2 textView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2400
    textView addDependent: self.
12168
95a3a7290554 Fixes, some support for SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12158
diff changeset
  2401
    self currentBlockNodeHolder: codeView currentBlockNodeHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2402
    textViewScroller := aCodeView2 textViewScroller.
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2403
    "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2404
    self viewBackground: (View defaultBackgroundColor).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2405
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2406
    "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
  2407
    "Modified: / 17-08-2011 / 15:15:55 / cg"
12224
eabcf6fc3857 - XTermView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12221
diff changeset
  2408
    "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
  2409
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2410
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2411
!CodeView2::GutterView methodsFor:'queries'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2412
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2413
displayedString: line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2414
    "get text to display in gutter for specified list line number"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2415
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2416
    ^(line asString).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2417
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2418
    "Created: / 14-12-2009 / 13:37:47 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2419
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2420
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2421
lineColorForLine:line
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2422
    "return special color for given line if required, nil otherwise"
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2423
    "used only if lineFont returns nil"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2424
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2425
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2426
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2427
    "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2428
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2429
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2430
lineDisplayable:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2431
    "true if this list line can be displayed"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2432
    ^(textView listLineIsVisible:line)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2433
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2434
    "Created: / 14-12-2009 / 13:38:23 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2435
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2436
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2437
lineFontForLine:line
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2438
    "return special font for given line if required, nil otherwise"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2439
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2440
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2441
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2442
    "Created: / 14-12-2009 / 14:40:17 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2443
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2444
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2445
yOfTextViewLine:lineNr
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2446
    "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
  2447
     the textView (because gutter may become higher than textView, iff
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2448
     the textView has a horizontal scrollbar"
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2449
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2450
    |visibleLineNr "{ Class: SmallInteger }"|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2451
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2452
    "/JV: BAD, BAD BAD - check senders, they are not prepared
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2453
    "/    to get nil!!
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2454
    shown ifFalse:[^ nil].
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2455
    lineNr isNil ifTrue:[^ nil].
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2456
    visibleLineNr := lineNr - textView firstLineShown + 1.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2457
    ^ textView yOfVisibleLine:visibleLineNr
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2458
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2459
    "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
  2460
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2461
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2462
!CodeView2::GutterView methodsFor:'redrawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2463
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2464
redrawAcceptCancelBarX: x y: y width:w height:h
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2465
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2466
    | rw acceptBottom cancelBottom |
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2467
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2468
    x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2469
	^self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2470
    ].
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2471
    rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2472
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2473
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2474
    textView reallyModified ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2475
	self fillRectangleX:x y:y width:rw height:h color: self viewBackground
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2476
    ] ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2477
	acceptBottom := self acceptButtonBottom.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2478
	cancelBottom := self cancelButtonBottom.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2479
	y < acceptBottom ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2480
	    self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2481
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2482
	(y < cancelBottom) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2483
	    self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2484
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2485
	(y + h >= cancelBottom) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2486
	    self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2487
	]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2488
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2489
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2490
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2491
    "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2492
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2493
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2494
redrawBackgroundX:x y:y width:w height:h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2495
    "redraws gutter background"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2496
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2497
    |savPaint|
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2498
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2499
    "background is filled with background color"
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2500
    self
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2501
	clearRectangleX:x
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2502
	y:y
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2503
	width:w
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2504
	height:h.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2505
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2506
    "separator line is drawn in grey"
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2507
    savPaint := self paint.
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2508
    self paint:Color grey.
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2509
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2510
    self
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2511
	displayLineFromX:(width - 1)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2512
	y:y
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  2513
	toX:(width - 1)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2514
	y:(y+h).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2515
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2516
    self paint:savPaint.
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  2517
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2518
    "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2519
    "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2520
    "Modified: / 17-08-2011 / 15:12:47 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2521
    "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
  2522
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2523
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2524
redrawLine:line
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2525
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2526
    ^self redrawLine:line cleared: false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2528
    "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
  2529
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2530
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2531
redrawLine:line cleared: cleared
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2532
    "redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor"
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2533
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2534
    ^ self redrawLine:line cleared:cleared drawServices:true
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2535
!
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2536
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2537
redrawLine:line cleared:cleared drawServices:drawServices
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  2538
    "redraws specified line. Returns width of drawn object.
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2539
     Color of drawn objects should be taken from lineFont, lineColor"
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  2540
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2541
    |lineString yTop yBaseline fontAscent fontDescent
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2542
     textW requiredW oldFont newFont oldColor newColor|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2543
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2544
    shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown.
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2545
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2546
    lineString := self displayedString:line.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2547
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2548
    textW := (lineString widthOn:self).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2549
    requiredW := textW + self padding.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2550
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2551
    oldFont := self font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2552
    oldColor := self paint.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2553
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2554
    newFont := self lineFontForLine:line.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2555
    newFont isNil ifTrue:[
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2556
        newFont := oldFont.
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2557
        newColor := self lineColorForLine:line.
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2558
        newColor ifNotNil:[ self paint:newColor ].
11424
69b3960c7757 care for small text-font in gutterview
Claus Gittinger <cg@exept.de>
parents: 11398
diff changeset
  2559
    ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2560
    newFont ~~ oldFont ifTrue:[
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2561
        (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2562
            newFont := textView font.
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2563
        ].
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2564
        self font:newFont
11424
69b3960c7757 care for small text-font in gutterview
Claus Gittinger <cg@exept.de>
parents: 11398
diff changeset
  2565
    ].
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2566
    fontAscent := textView font ascentOn:device.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2567
    fontDescent := textView font descentOn:device.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2568
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2569
    yTop := self yOfTextViewLine:line.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2570
    yBaseline := yTop + fontAscent.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2571
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2572
    cleared ifFalse:[
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2573
        self clearRectangleX:0 y:yBaseline - font ascent
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2574
            width: width - 2
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2575
            height: font ascent + font descent.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2576
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2577
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2578
    "/ cg: this should be done differently: services know about the
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2579
    "/ gutter, so they should respond to a special drawGutter message.
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2580
    "/ otherwise, some redraws become unusably slow (especially
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2581
    "/ with multiple fonts/colors/emphases)...
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2582
    drawServices ifTrue:[
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2583
        "Let services draw annotations and other stuff"
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2584
        codeView
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2585
            drawLine:line in: self
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2586
            atX: (self paddingLeft + self usedWidthForAcceptCancel) y:yBaseline width: widthAnnotations height: font height
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2587
            from:nil to:nil with:self paint and: self backgroundColor.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2588
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2589
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2590
    self
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2591
        displayString:lineString
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2592
        x:(width - textW - 2 - self paddingRight - widthDiffInfo)
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2593
        y:yBaseline.
13173
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  2594
e9da2324940d Merged 06656434532b and 71cb8ce508f0 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13170 12960
diff changeset
  2595
    newFont
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2596
        ifNotNil:[
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2597
            self font:oldFont.
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2598
            self paint:oldColor
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2599
        ]
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2600
        ifNil:[
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2601
            newColor ifNotNil:[ self paint:oldColor ].
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  2602
        ].
13467
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2603
    "/ If the view has been cleared here, we have also to redraw corresponding portion
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2604
    "/ of accept/cancel bar !!
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2605
    cleared ifFalse:[
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2606
        "/ In that case it was cleared above.
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2607
        self redrawAcceptCancelBarX:0 y:yBaseline - font ascent
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2608
            width: width - 2
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2609
           height: font ascent + font descent.      
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2610
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2611
    ^ requiredW.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2612
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2613
    "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2614
    "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
  2615
    "Modified: / 18-07-2012 / 19:05:24 / cg"
13467
737b357b74b8 Bug fix in Tools::CodeView2: redraw accept-cancel bar when redrawing...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13466
diff changeset
  2616
    "Modified: / 28-08-2013 / 15:17:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2617
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2618
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2619
redrawLinesFrom:start
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2620
    "/ cg: obsolete?
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2621
    start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2622
	self redrawLine:line cleared: false.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2623
    ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2624
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2625
    "Created: / 06-07-2011 / 17:25:36 / jv"
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2626
    "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
  2627
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2628
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2629
redrawVisibleLine:line
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2630
    |absLine|
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2631
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2632
    (absLine := textView visibleLineToListLine:line) notNil ifTrue:[
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2633
	self redrawLine:absLine cleared: false.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2634
    ].
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2635
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2636
    "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
  2637
!
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2638
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  2639
redrawX:x y:y width:w height:h
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2640
    |firstLine lastLine yBot|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2641
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2642
    self redrawBackgroundX:x y:y width:w height:h.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2643
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2644
    codeView showAcceptCancelBar ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2645
	self redrawAcceptCancelBarX:x y:y width:w height:h.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2646
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2647
13051
0fcebb7687b4 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13039
diff changeset
  2648
    numberOfLines := (textView list size max:textView cursorLine).
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2649
    yBot := y + h.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2650
    firstLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:y).
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2651
    lastLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:yBot-1).
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2652
    lastLine := lastLine min:numberOfLines.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  2653
13250
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  2654
    firstLine to:lastLine do: [:line |
0decde6c459d Merged 8344c08b1480 and 187a0aabc409 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13182 13213
diff changeset
  2655
	self redrawLine:line cleared:true drawServices:true.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2656
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2657
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2658
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2659
!CodeView2::TextView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2660
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2661
changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2662
    ^ changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2663
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2664
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2665
changedDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2666
    changedDiffText := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2667
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2668
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2669
changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2670
    ^ changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2671
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2672
    "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2673
    "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2674
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2675
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2676
changedLines:something
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2677
    changedLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2678
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2679
    "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2680
    "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2681
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2682
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2683
contents: text
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2684
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2685
    super contents: text.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2686
    reallyModifiedChannel value: false.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2687
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2688
    "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
  2689
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2690
12171
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2691
contents: text clear: clearPrevious
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2692
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2693
    | savedListOriginal |
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2694
    savedListOriginal := listOriginal.
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2695
    super contents: text.
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2696
    listOriginal := savedListOriginal.
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2697
    self updateReallyModified.
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2698
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2699
    "Created: / 17-02-2012 / 00:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2700
!
09f6735e294b Fixes in CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12170
diff changeset
  2701
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2702
deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2703
    ^  deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2704
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2705
    "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2706
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2707
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2708
deletedLines:something
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  2709
    deletedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2710
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2711
    "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  2712
    "Modified (format): / 17-07-2012 / 18:56:44 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2713
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2714
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2715
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2716
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2717
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2718
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2719
diffMode:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2720
    diffMode := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2721
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2722
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2723
emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2724
    ^ emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2725
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2726
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2727
emptyLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2728
    emptyLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2729
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2730
12251
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2731
fontAscent
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2732
    ^fontAscent notNil ifTrue:[fontAscent] ifFalse:[super fontAscent]
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2733
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2734
    "Created: / 19-05-2012 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2735
!
5ca4da2bb38c Fixed baseline computation in CodeView2::GutterView
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12244
diff changeset
  2736
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2737
insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2738
    ^  insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2739
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2740
    "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2741
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2742
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2743
insertedLines:something
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  2744
    insertedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2745
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2746
    "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  2747
    "Modified (format): / 17-07-2012 / 18:56:50 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2748
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2749
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2750
modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2751
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2752
    super modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2753
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2754
    "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
  2755
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2756
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2757
originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2758
    ^ originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2759
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2760
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2761
originDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2762
    originDiffText := something.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2763
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2764
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2765
reallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2766
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2767
    ^self reallyModifiedChannel value
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2768
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2769
    "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
  2770
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2771
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  2772
!CodeView2::TextView methodsFor:'accessing-colors'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2773
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2774
colorChanged
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2775
    ^ Color redByte:240 greenByte: 192 blueByte: 192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2776
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2777
    "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
  2778
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2779
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2780
colorDeleted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2781
    ^ self colorInserted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2782
    "/^ Color pink
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2783
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2784
    "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
  2785
    "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
  2786
    "Modified (format): / 17-07-2012 / 18:57:14 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2787
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2788
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2789
colorInserted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2790
    ^ Color redByte: 239 greenByte: 225 blueByte: 152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2791
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2792
    "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
  2793
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2794
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2795
!CodeView2::TextView methodsFor:'accessing-contents'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2796
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2797
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2798
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2799
    super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2800
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2801
    reallyModifiedChannel value: false.
13323
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2802
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2803
    "/JV: used to be notifyLines... but that method
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2804
    "/    leaves suppressNotifications to true, which is not what
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2805
    "/    we want!!
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2806
    self updateReallyModified.
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2807
    codeView linesModifiedFrom: 1 to: list size.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2808
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2809
    "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13323
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2810
    "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
  2811
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2812
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2813
setList:aCollection expandTabs:expandTabs redraw:doRedraw
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2814
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2815
    super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2816
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2817
    reallyModifiedChannel value: false.
13323
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2818
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2819
    "/JV: used to be notifyLines... but that method
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2820
    "/    leaves suppressNotifications to true, which is not what
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2821
    "/    we want!!
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2822
    self updateReallyModified.
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2823
    codeView linesModifiedFrom: 1 to: list size.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2824
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2825
    "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13323
b6bdca7183a6 CodeView2: some fixes for SmallSense to get more precise notifications on what changed.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13252
diff changeset
  2826
    "Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2827
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2828
12198
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2829
!CodeView2::TextView methodsFor:'accessing-look'!
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2830
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2831
lineSpacing
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2832
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2833
    ^lineSpacing
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2834
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2835
    "Modified: / 22-05-1996 / 12:22:29 / cg"
414e7b69ecda Text/ChangeSet diff improved
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12194
diff changeset
  2836
    "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
  2837
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2838
10785
vrany
parents: 10784
diff changeset
  2839
!CodeView2::TextView methodsFor:'accessing-state'!
vrany
parents: 10784
diff changeset
  2840
vrany
parents: 10784
diff changeset
  2841
beUnmodified
vrany
parents: 10784
diff changeset
  2842
vrany
parents: 10784
diff changeset
  2843
    self modifiedChannel value: false.
vrany
parents: 10784
diff changeset
  2844
    reallyModifiedChannel value: false.
vrany
parents: 10784
diff changeset
  2845
    listOriginal := list copy.
vrany
parents: 10784
diff changeset
  2846
vrany
parents: 10784
diff changeset
  2847
    "Created: / 08-10-2011 / 12:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2848
!
vrany
parents: 10784
diff changeset
  2849
vrany
parents: 10784
diff changeset
  2850
isModified
vrany
parents: 10784
diff changeset
  2851
vrany
parents: 10784
diff changeset
  2852
    ^self modified
vrany
parents: 10784
diff changeset
  2853
vrany
parents: 10784
diff changeset
  2854
    "Created: / 08-10-2011 / 12:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2855
!
vrany
parents: 10784
diff changeset
  2856
vrany
parents: 10784
diff changeset
  2857
isReallyModified
vrany
parents: 10784
diff changeset
  2858
vrany
parents: 10784
diff changeset
  2859
    ^self reallyModified
vrany
parents: 10784
diff changeset
  2860
vrany
parents: 10784
diff changeset
  2861
    "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2862
! !
vrany
parents: 10784
diff changeset
  2863
13147
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2864
!CodeView2::TextView methodsFor:'bit blitting'!
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2865
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2866
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2867
    "/ a vertical scroll operation ?
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2868
    aDrawable == self ifTrue:[
13182
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  2869
	((srcY ~= dstY) and:[srcX = dstX]) ifTrue:[
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  2870
	    gutterView
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  2871
		copyFrom:gutterView x:0 y:srcY toX:0 y:dstY width:(gutterView width) height:h async:false
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  2872
	]
13147
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2873
    ].
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2874
    ^ super
13182
bc686a7cc736 Merged b35f00f464c2 and 13cf55425c88 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13181 13165
diff changeset
  2875
	copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
13147
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2876
! !
e508bd281f8c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13127
diff changeset
  2877
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2878
!CodeView2::TextView methodsFor:'channels'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2879
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2880
reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2881
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2882
    ^ reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2883
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2884
    "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
  2885
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2886
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2887
reallyModifiedChannel: aValueModel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2888
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2889
    |prev|
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2890
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2891
    prev := reallyModifiedChannel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2892
    prev notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2893
	gutterView notNil ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2894
	    reallyModifiedChannel removeDependent: gutterView.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2895
	]
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2896
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2897
    reallyModifiedChannel := aValueModel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2898
    self setupChannel:aValueModel for:nil withOld:prev.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2899
    gutterView notNil ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2900
	reallyModifiedChannel addDependent: gutterView.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2901
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2902
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2903
    "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
  2904
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2905
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2906
!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
  2907
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2908
isQuickMenuModifierPressed
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2909
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2910
	^ 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
  2911
    ].
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2912
    ^ self sensor metaDown
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2913
!
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2914
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2915
isQuickMenuModifierReleased
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2916
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2917
	^ self sensor ctrlDown not
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2918
    ].
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2919
    ^ 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
  2920
! !
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  2921
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2922
!CodeView2::TextView methodsFor:'drawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2923
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2924
backgroundForVisibleLine:visLineNr default:bg
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2925
    | lineNr |
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2926
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2927
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2928
    diffMode ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2929
	lineNr := self visibleLineToListLine:visLineNr.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2930
	(insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2931
	    ^self colorInserted
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2932
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2933
	(changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2934
	    ^self colorChanged
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2935
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2936
	(deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2937
	    ^self colorDeleted
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2938
	].
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2939
    ].
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2940
    ^ bg
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2941
12193
c0bdf75cfde5 Improvements in Diff3Tool
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12192
diff changeset
  2942
    "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
  2943
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2944
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2945
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2946
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2947
    super
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2948
	drawFromVisibleLine:startVisLineNr
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2949
	to:endVisLineNr
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2950
	with:fg
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2951
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2952
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2953
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2954
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2955
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2956
    "Created: / 05-04-2010 / 12:08:38 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2957
    "Modified: / 02-05-2010 / 18:46:04 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2958
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2959
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2960
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2961
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2962
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2963
	drawLine:line
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2964
	fromX:x
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2965
	inVisible:visLineNr
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2966
	with:fg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2967
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2968
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2969
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2970
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2971
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2972
    "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2973
    "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2974
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2975
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  2976
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2977
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2978
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2979
	drawLine:lineStringArg
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2980
	inVisible:visLineNr
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2981
	col:col
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2982
	with:fg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2983
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2984
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  2985
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2986
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2987
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2988
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2989
    "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2990
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2991
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2992
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  2993
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2994
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2995
	drawLine:lineStringArg
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2996
	inVisible:visLineNr
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2997
	from:startCol
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2998
	to:endColOrNil
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  2999
	with:fg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  3000
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3001
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3002
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3003
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3004
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3005
    "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3006
    "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3007
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3008
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3009
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  3010
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3011
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3012
	drawLine:lineString
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3013
	inVisible:visLineNr
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3014
	from:startCol
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3015
	with:fg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  3016
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3017
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3018
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3019
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3020
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3021
    "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3022
    "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3023
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3024
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3025
drawVisibleLine:visLineNr with:fg and:bg
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3026
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3027
	drawVisibleLine:visLineNr
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3028
	with:fg
13391
43eaa1c36082 Merged ab1969edf59b and 64efc4f4f688 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13333 13374
diff changeset
  3029
	and:bg.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3030
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3031
    gutterView redrawVisibleLine:visLineNr.
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3032
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3033
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3034
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3035
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3036
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3037
    "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3038
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3039
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3040
redrawLines
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3041
    "redraw diff lines"
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3042
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3043
    |i pom|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3044
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3045
    diffMode ifFalse:[^self].
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  3046
    true ifTrue:[^self].
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  3047
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3048
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3049
    pom := self hasSelection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3050
    (pom) ifTrue:[ ^ self. ].
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  3051
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3052
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3053
    [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3054
	i <= (deletedLines size)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3055
    ] whileTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3056
	((deletedLines at:i) > 0) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3057
	    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3058
		drawVisibleLine:(deletedLines at:i)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3059
		with:fgColor
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3060
		and:self colorDeleted.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3061
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3062
	i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3063
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3064
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3065
    [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3066
	i <= (insertedLines size)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3067
    ] whileTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3068
	((insertedLines at:i) > 0) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3069
	    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3070
		drawVisibleLine:(insertedLines at:i)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3071
		with:fgColor
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3072
		and:self colorInserted.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3073
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3074
	i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3075
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3076
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3077
    [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3078
	i <= (changedLines size)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3079
    ] whileTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3080
	((changedLines at:i) > 0) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3081
	    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3082
		drawVisibleLine:(changedLines at:i)
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3083
		with:fgColor
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3084
		and:self colorChanged.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3085
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3086
	i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3087
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3088
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3089
    "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3090
    "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  3091
    "Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3092
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3093
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3094
!CodeView2::TextView methodsFor:'editing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3095
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3096
contentsChanged
13051
0fcebb7687b4 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13039
diff changeset
  3097
    "this one is sent, whenever contents changes its size"
0fcebb7687b4 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13039
diff changeset
  3098
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3099
    super contentsChanged.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3100
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3101
"/    codeView diffMode ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3102
"/        changedDiffText ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3103
"/            codeView recomputeDiff:self.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3104
"/        ] ifFalse:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3105
"/            changedDiffText := true.
13178
c9bf900fe729 Merged f8f283ea3f4c and 131bed1fbee2 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13175 13072
diff changeset
  3106
"/        ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3107
"/    ]
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3108
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3109
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3110
    "Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3111
    "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
  3112
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3113
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3114
deleteCharBeforeCursor
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3115
    "delete single character to the left of cursor and move cursor to left"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3116
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3117
    "BIG FAT WARNING: This method is copied from TextEditView,
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3118
    the fix should be there, but someone smarter should review it
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3119
    before the patch will be pushed up"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3120
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3121
    |soCol wasOn lineNrAboveCursor ln originalLine prevTab|
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3122
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3123
    wasOn := self hideCursor.
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3124
12783
b52f85ed724e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12782
diff changeset
  3125
    "JV@2012-01-06: Do not play with autoindent iff cursor is at the very beginning of the line"
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3126
    (autoIndent
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3127
    and:[cursorCol ~~ 1
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3128
    and:[ (tabPositions includes:cursorCol)
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3129
    ]]) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3130
	prevTab := (self prevTabBefore:cursorCol) max:1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3131
	"JV@2011-12-10: The list can be shorter than cursorLine,
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3132
	 trailing because empty lines are not physically in the list."
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3133
	(list size >= cursorLine) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3134
	    ln := originalLine := (list at:cursorLine) ? ''.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3135
	] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3136
	    ln := originalLine := ''.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3137
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3138
	ln size < prevTab ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3139
	    ln := ln , (String new:prevTab withAll:Character space).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3140
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3141
	(ln copyTo:prevTab) isBlank ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3142
	    (ln copyFrom:prevTab+1) isBlank ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3143
		cursorCol > prevTab ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3144
		    self st80EditMode ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3145
			"/ ensure that there is no conflict here: st80EditMode will
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3146
			"/ not allow a cursor position beyond the end of line,
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3147
			"/ so avoid that cursorLine:col: will force us to the beginning of the line
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3148
			originalLine size < prevTab ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3149
			    self at:cursorLine put:ln
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3150
			]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3151
		    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3152
		    self cursorLine:cursorLine col:prevTab.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3153
		    wasOn ifTrue:[ self showCursor ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3154
		    ^  self
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3155
		].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3156
	    ] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3157
		"/ (ln copyFrom:prevTab+1 to:cursorCol-1) isBlank ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3158
		    self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3159
		    self cursorLine:cursorLine col:prevTab.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3160
		    wasOn ifTrue:[ self showCursor ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3161
		    ^  self.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3162
		"/ ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3163
	    ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3164
	].
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3165
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3166
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3167
"/        (autoIndent
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3168
"/    and:[cursorCol  ~~ 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3169
"/    and:[cursorLine <= (list size)]])
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3170
"/     ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3171
"/        soCol := (self leftIndentForLine:cursorLine) + 1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3172
"/
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3173
"/        (cursorCol == soCol and:[soCol > 1]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3174
"/            ln := list at:cursorLine.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3175
"/            (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3176
"/                soCol := 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3177
"/            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3178
"/        ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3179
"/    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3180
	soCol := 1.
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3181
"/    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3182
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3183
    (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3184
	"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3185
	 somewhere in the middle of a line
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3186
	"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3187
	self cursorLeft.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3188
	self deleteCharAtLine:cursorLine col:cursorCol.
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3189
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3190
	"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3191
	 at begin of line - merge with previous line;
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3192
	 except for the very first line.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3193
	"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3194
	(cursorLine == 1) ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3195
	    lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3196
	    lineNrAboveCursor < cursorLine ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3197
		(lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3198
		    "/ we are beyond the end of the text.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3199
		    "/ move the cursor to the previous line.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3200
		    self cursorLine:lineNrAboveCursor col:1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3201
		] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3202
		    self mergeLine:lineNrAboveCursor removeBlanks:false.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3203
		]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3204
	    ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3205
	]
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3206
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3207
    wasOn ifTrue:[ self showCursor ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3208
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3209
    "Modified: / 16-01-1998 / 22:33:04 / cg"
11054
4a047a923805 fix for autoindent: deleting line when at the very beggining of the line
vrany
parents: 10977
diff changeset
  3210
    "Modified: / 06-01-2012 / 12:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3211
!
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3212
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3213
getNewOriginText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3214
    |i size pole pom text helperText|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3215
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3216
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3217
    pole := list.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3218
    size := list size.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3219
    text:=''.
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  3220
    emptyLines isNil ifTrue:[emptyLines := #()].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3221
    [ i <= size ] whileTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3222
	pom := emptyLines indexOf:i.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3223
	(pom = 0) ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3224
	    helperText := pole at:i.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3225
	    (helperText = '') ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3226
		(helperText isNil)ifTrue:[helperText:=''].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3227
		helperText:=helperText,Character cr.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3228
		text := text asString , helperText asString.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3229
	    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3230
	] ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3231
	    helperText := pole at:i.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3232
	    (helperText isNil)ifTrue:[helperText:=''].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3233
	    helperText:=helperText,Character cr.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3234
	    text := text asString , helperText asString.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3235
	].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3236
    i:=i+1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3237
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3238
^text
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3239
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3240
    "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3241
    "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
  3242
    "Modified: / 18-11-2011 / 14:58:22 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3243
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3244
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3245
!CodeView2::TextView methodsFor:'editing-basic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3246
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3247
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
  3248
    "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
  3249
10731
5904065850c6 Fixed notification in #basicDeleteChars...
vrany
parents: 10728
diff changeset
  3250
    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
  3251
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3252
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3253
    "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
  3254
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3255
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3256
basicDeleteFromLine:startLineNr toLine:endLineNr
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3257
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3258
    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
  3259
    self notifyLinesDeletedFrom:startLineNr to:endLineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3260
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3261
    "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
  3262
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3263
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3264
basicDeleteLineWithoutRedraw:lineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3265
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3266
    super basicDeleteLineWithoutRedraw:lineNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3267
    self notifyLinesDeletedFrom: lineNr to: lineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3268
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3269
    "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
  3270
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3271
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3272
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
  3273
    "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
  3274
     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
  3275
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3276
    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
  3277
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3278
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3279
    "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
  3280
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3281
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3282
basicMergeLine:lineNr removeBlanks:removeBlanks
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3283
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3284
    super basicMergeLine:lineNr removeBlanks:removeBlanks.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3285
    self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3286
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3287
    "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
  3288
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3289
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3290
basicSplitLine:lineNr before:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3291
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3292
    super basicSplitLine:lineNr before:colNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  3293
    self notifyLinesInsertedFrom: lineNr +1 to: lineNr + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3294
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3295
    "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
  3296
!
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3297
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3298
insertLines:someText from:start to:end before:lineNr
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3299
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3300
    "/JV@2011-12-20: HACK, the super implementation should
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3301
    "/not use leftIndent...when pasting. Following is a workaround"
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3302
    | wasAutoIndent |
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3303
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3304
    wasAutoIndent := autoIndent.
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3305
    autoIndent := false.
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3306
    [
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3307
	super insertLines:someText from:start to:end before:lineNr.
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3308
    ] ensure:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3309
	autoIndent := wasAutoIndent
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3310
    ]
10977
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3311
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  3312
    "Created: / 20-12-2011 / 15:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3313
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3314
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3315
!CodeView2::TextView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3316
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3317
buttonMotion:button x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3318
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3319
    (codeView buttonMotion:button x:x y:y in: self)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3320
	ifFalse:[super buttonMotion:button x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3321
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3322
    "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
  3323
    "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
  3324
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3325
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3326
buttonPress: button x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3327
    | ctrlDown  |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3328
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3329
    (codeView buttonPress:button x:x y:y in: self)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3330
	ifFalse:[super buttonPress:button x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3331
    "
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3332
    ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil])
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3333
	ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3334
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3335
	buttonPress: button
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3336
	x: x
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3337
	y: y
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3338
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3339
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3340
    "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
  3341
    "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
  3342
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3343
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3344
buttonRelease: button x: x y: y
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3345
    (codeView buttonRelease:button x:x y:y in: self)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3346
	ifFalse:[super buttonRelease:button x:x y:y].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3347
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  3348
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3349
exposeX:x y:y width:w height:h
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3350
    super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3351
	exposeX:x
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3352
	y:y
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3353
	width:w
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3354
	height:h.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3355
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3356
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3357
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3358
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3359
    "Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3360
    "Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3361
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3362
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3363
keyPress:key x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3364
    (codeView keyPress:key x:x y:y in: self)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3365
	ifFalse:[super keyPress:key x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3366
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3367
    "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
  3368
    "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3369
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3370
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3371
keyRelease: key x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3372
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3373
    (codeView keyRelease:key x:x y:y in: self)
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3374
	ifFalse:[super keyRelease:key x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3375
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3376
    (key = #Control_L) ifTrue:
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3377
	[ codeView highlightClear. self redraw ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3378
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3379
    ^ super
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3380
	keyRelease: key
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3381
	x: x
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3382
	y: y
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3383
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3384
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3385
    "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
  3386
    "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
  3387
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3388
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3389
!CodeView2::TextView methodsFor:'formatting'!
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3390
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3391
leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3392
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3393
    | lang |
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3394
    lang := codeView language.
10973
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3395
    "Bit hacky here, should ask language some language toolbox
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3396
    for formatting helper, that should do it..."
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3397
    (lang notNil and:[lang isSmalltalk]) ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3398
	| line lineNo indent |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3399
	lineNo := lineNr.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3400
	[lineNo ~~ 1] whileTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3401
	    lineNo  := lineNo - 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3402
	    line := self listAt:lineNo.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3403
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3404
	    line notNil ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3405
		indent := line indexOfNonSeparatorStartingAt:1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3406
		"beggining od block"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3407
		line notEmptyOrNil ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3408
		    line last == $[ ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3409
			indent := indent + 4.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3410
		    ] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3411
			"end of block args"
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3412
			(line last == $| and: [line includes: $[]) ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3413
			    indent := indent + 4.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3414
			]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3415
		    ].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3416
		].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3417
		indent ~~ 0 ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3418
		^ indent - 1
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3419
		]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3420
	    ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3421
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3422
	^0.
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3423
    ].
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3424
    ^super leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3425
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3426
    "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3427
! !
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  3428
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3429
!CodeView2::TextView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3430
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3431
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3432
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3433
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3434
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3435
    changedDiffText := true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3436
    diffMode := false.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3437
    suppressNotifications := false.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3438
    reallyModifiedChannel := false asValue.
13181
b35f00f464c2 Fix in CodeView2 - honour codeView2AutoIndent setting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13180
diff changeset
  3439
    autoIndent := UserPreferences current codeView2AutoIndent.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3440
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3441
    self enableMotionEvents.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3442
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3443
    "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
  3444
    "Modified: / 06-07-2011 / 17:46:31 / jv"
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  3445
    "Modified: / 21-08-2011 / 10:09:29 / cg"
13181
b35f00f464c2 Fix in CodeView2 - honour codeView2AutoIndent setting.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13180
diff changeset
  3446
    "Modified: / 15-07-2013 / 13:15:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3447
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3448
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3449
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3450
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3451
    codeView := aCodeView2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3452
    codeView addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3453
    gutterView := aCodeView2 gutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3454
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3455
    "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
  3456
    "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
  3457
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3458
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3459
setGutterView: aGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3460
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3461
    self assert: gutterView isNil message:'Attempting to set gutterView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3462
    gutterView := aGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3463
    gutterView setTextView: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3464
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3465
    "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
  3466
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3467
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3468
!CodeView2::TextView methodsFor:'menu & menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3469
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3470
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3471
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3472
    super accept.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3473
    reallyModifiedChannel value: false.
10785
vrany
parents: 10784
diff changeset
  3474
    listOriginal := list copy.
10781
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 / 19:36:41 / 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
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3479
cancel
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3480
10785
vrany
parents: 10784
diff changeset
  3481
    self list: listOriginal
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3482
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3483
    "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
  3484
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3485
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3486
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3487
11398
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3488
    ^ codeView editMenu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3489
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3490
    "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
  3491
    "Modified (format): / 08-03-2012 / 12:30:22 / cg"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3492
!
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3493
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3494
searchVariableVisible
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3495
    "search variable option in searchbox visible?"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3496
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3497
    ^ true
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3498
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  3499
    "Created: / 08-03-2012 / 14:01:51 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3500
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3501
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3502
!CodeView2::TextView methodsFor:'notification'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3503
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3504
notifyLinesDeletedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3505
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3506
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3507
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3508
    codeView linesDeletedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3509
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3510
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3511
    "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
  3512
    "Modified: / 06-07-2011 / 17:47:05 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3513
    "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
  3514
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3515
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3516
notifyLinesInsertedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3517
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3518
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3519
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3520
    codeView linesInsertedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3521
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3522
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3523
    "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
  3524
    "Modified: / 06-07-2011 / 17:47:20 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3525
    "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
  3526
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3527
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3528
notifyLinesModifiedFrom: startLine to: endLine
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3529
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3530
    self updateReallyModified.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3531
    suppressNotifications ifTrue:[^self].
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3532
    codeView linesModifiedFrom: startLine to: endLine.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3533
    suppressNotifications := true.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3534
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3535
    "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
  3536
    "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
  3537
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3538
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3539
!CodeView2::TextView methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3540
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3541
superEditMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3542
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3543
    ^super editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3544
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3545
    "Created: / 14-02-2010 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3546
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3547
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3548
updateReallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3549
    "check for modified code by comparing the source against
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3550
     the codeViews contents.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3551
     Thats the true modified value (in case user undid its changes,
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3552
     and the displayed text is actually original"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3553
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3554
    |modified changedSource originalSource lastLineOfChangedSource lastLineOfOriginalSource|
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3555
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3556
    reallyModifiedChannel isNil ifTrue:[^self].
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3557
    "JV@2011-10-27: Idea is not to do anything if nobody is
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3558
     interested. Not sure if it is a good idea, thought."
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3559
    reallyModifiedChannel dependents isEmptyOrNil ifTrue:[^self].
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3560
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3561
    "/ higher prio to prevent it from being changed while we convert it (by editing)
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3562
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3563
    modified := false.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3564
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3565
    list size ~~ listOriginal size ifTrue:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3566
	modified := true.
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3567
    ] ifFalse:[
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3568
	"/ cg: don't do that (collecting original/changedSource);
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3569
	"/ 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
  3570
"/        changedSource := list ? #().
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3571
"/        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3572
"/        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3573
"/            changedSource := changedSource removeLast.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3574
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3575
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3576
"/        originalSource := listOriginal ? #() "self model value ? ''".
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3577
"/        originalSource := originalSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3578
"/        [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3579
"/            originalSource := originalSource removeLast
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3580
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3581
"/        originalSource size ~~ changedSource size ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3582
"/            modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3583
"/        ] ifFalse:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3584
"/            | i stopIndex |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3585
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3586
"/            i := 1.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3587
"/            stopIndex := originalSource size + 1.
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3588
"/            [ modified not and:[ i < stopIndex ] ] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3589
"/                | originalL changedL |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3590
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3591
"/                originalL := ((originalSource at: i) ? '') string.
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3592
"/                changedL :=  ((changedSource  at: i) ? '') string.
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3593
"/                originalL ~= changedL ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3594
"/                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3595
"/                        modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3596
"/                    ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3597
"/                ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3598
"/                i := i + 1.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3599
"/            ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3600
"/        ].
13170
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3601
	"/ instead, do everything without collecting a new stringcollection.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3602
	changedSource := list ? #().
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3603
	lastLineOfChangedSource := changedSource size.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3604
	[lastLineOfChangedSource > 0 and:[(changedSource at:lastLineOfChangedSource) isEmptyOrNil]] whileTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3605
	    lastLineOfChangedSource := lastLineOfChangedSource - 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3606
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3607
	originalSource := listOriginal ? #().
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3608
	lastLineOfOriginalSource := originalSource size.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3609
	[lastLineOfOriginalSource > 0 and:[(originalSource at:lastLineOfOriginalSource) isEmptyOrNil]] whileTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3610
	    lastLineOfOriginalSource := lastLineOfOriginalSource - 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3611
	].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3612
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3613
	lastLineOfOriginalSource ~~ lastLineOfChangedSource ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3614
	    modified := true.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3615
	] ifFalse:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3616
	    | i stopIndex |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3617
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3618
	    i := 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3619
	    stopIndex := lastLineOfOriginalSource + 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3620
	    [ modified not and:[ i < stopIndex ] ] whileTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3621
		| originalL changedL |
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3622
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3623
		originalL := ((originalSource at: i) ? '') string.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3624
		changedL :=  ((changedSource  at: i) ? '') string.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3625
		originalL ~= changedL ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3626
		    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3627
			modified := true.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3628
		    ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3629
		].
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3630
		i := i + 1.
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3631
	    ]
c9b815af5777 Merged 0ce340e972c4 and 2d878b37539e (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12819 12870
diff changeset
  3632
	].
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3633
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3634
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3635
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3636
    reallyModifiedChannel value: modified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3637
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3638
    "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
  3639
    "Modified: / 08-10-2011 / 11:10:01 / cg"
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3640
    "Modified: / 28-10-2011 / 09:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3641
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3642
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3643
!CodeView2::TextView methodsFor:'queries'!
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3644
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3645
supportsSyntaxElements
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3646
    ^ true
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3647
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3648
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3649
syntaxElementAtPosition:position
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3650
    "is there is a syntax element at position?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3651
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3652
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3653
    |syntaxElements el element|
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3654
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3655
    syntaxElements := codeView syntaxElements.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3656
    syntaxElements isEmptyOrNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3657
    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
  3658
    el isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3659
    element := 1234.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3660
    ^ el.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3661
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3662
    "Created: / 08-03-2012 / 14:21:52 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3663
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3664
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3665
syntaxElementForSelectedVariable
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3666
    "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
  3667
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3668
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3669
    |element startPosition endPosition|
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3670
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3671
    self selectionAsString isEmptyOrNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3672
    startPosition := self characterPositionOfLine:selectionStartLine col:selectionStartCol.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3673
    endPosition := self characterPositionOfLine:selectionEndLine col:selectionEndCol.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3674
    element := self syntaxElementAtPosition:startPosition.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3675
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3676
    (element start = startPosition and:[element stop = endPosition]) ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3677
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3678
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3679
    element isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3680
    ^ element
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3681
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3682
    "Created: / 08-03-2012 / 14:21:15 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3683
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3684
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3685
syntaxElementForSelectorUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3686
    "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
  3687
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3688
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3689
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3690
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3691
    elementUnderCursor := self syntaxElementAtPosition:(self characterPositionOfCursor).
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3692
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3693
    elementUnderCursor isSelector ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3694
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3695
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3696
    "Created: / 08-03-2012 / 12:44:03 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3697
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3698
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3699
syntaxElementForVariableUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3700
    "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
  3701
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3702
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3703
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3704
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3705
    elementUnderCursor := self syntaxElementAtPosition:(self characterPositionOfCursor).
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3706
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3707
    elementUnderCursor isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3708
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3709
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  3710
    "Created: / 08-03-2012 / 12:44:03 / cg"
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3711
! !
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  3712
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3713
!CodeView2::TextView methodsFor:'scrolling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3714
12199
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3715
basicScrollTo:anOrigin redraw:doRedraw
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3716
    super scrollTo:anOrigin redraw:doRedraw
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3717
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3718
    "Modified: / 06-04-2010 / 14:05:40 / Jakub <zelenja7@fel.cvut.cz>"
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3719
    "Modified: / 17-03-2012 / 10:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3720
    "Created: / 19-03-2012 / 17:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3721
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3722
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3723
originChanged:delta
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3724
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3725
    super originChanged:delta.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3726
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3727
    "/ gutterView invalidate.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3728
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3729
    "Created: / 07-12-2009 / 21:50:49 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3730
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3731
12199
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3732
scrollTo:anOrigin redraw:doRedraw
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3733
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3734
    codeView scrollTo:anOrigin redraw:doRedraw in: self.
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3735
    self basicScrollTo:anOrigin redraw:doRedraw
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3736
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3737
    "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
12192
15f47901fb64 Fixes in Diff2/Diff3 text views
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12171
diff changeset
  3738
    "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12199
de37e205701f CodeView2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12198
diff changeset
  3739
    "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13465
1f1e8b6710c8 Bugfix Tools::CodeView2::GutterView - do not redraw gutter if its not shown.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13391
diff changeset
  3740
! !
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3741
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3742
!CodeView2::TextView methodsFor:'undo & again'!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3743
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3744
nonUndoableDo: aBlock
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3745
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3746
    super nonUndoableDo: aBlock.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3747
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3748
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3749
    "Created: / 06-07-2011 / 17:48:27 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3750
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3751
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3752
undoableDo: aBlock info: into
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3753
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3754
    super undoableDo: aBlock info: into.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3755
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3756
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3757
    "Created: / 06-07-2011 / 17:48:49 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3758
! !
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3759
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3760
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3761
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3762
version
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3763
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.112 2013-08-26 08:41:40 cg Exp $'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3764
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3765
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3766
version_CVS
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3767
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.112 2013-08-26 08:41:40 cg Exp $'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3768
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3769
12431
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12406
diff changeset
  3770
version_HG
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12406
diff changeset
  3771
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12406
diff changeset
  3772
    ^ '$Changeset: <not expanded> $'
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12406
diff changeset
  3773
!
9f0c59c742d5 Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12406
diff changeset
  3774
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3775
version_SVN
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3776
    ^ '$Id: Tools__CodeView2.st,v 1.112 2013-08-26 08:41:40 cg Exp $'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3777
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3778
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  3779
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3780
CodeView2 initialize!