Tools__CodeView2.st
author vrany
Wed, 14 Dec 2011 12:11:23 +0100
changeset 10973 44ccdbc1fb0a
parent 10972 7f13cb6e9a93
child 10977 a484c4cad7e0
permissions -rw-r--r--
fix in #leftIndentForLine: for view with nil language
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
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     3
              All Rights Reserved
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
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    35
		syntaxElementSelection highlightEmphasis diffMode
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
    36
		synchronizedCodeViews'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
	classVariableNames:'TraceSelectors'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
	category:'Interface-CodeView'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
SimpleView subclass:#GutterView
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    43
	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    44
		widthAnnotations widthDiffInfo firstLineShown lastLineShown
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    45
		acceptColor cancelColor diffColor'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
	classVariableNames:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
	privateIn:CodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
CodeView subclass:#TextView
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    52
	instanceVariableNames:'listOriginal codeView gutterView diffMode deletedLines
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    53
		insertedLines lastFirstLine changedLines scrolled originDiffText
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    54
		emptyLines changedDiffText suppressNotifications
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
    55
		reallyModifiedChannel'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
	classVariableNames:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
	poolDictionaries:''
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
	privateIn:CodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
copyright
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    65
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    66
              All Rights Reserved
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    67
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    68
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    69
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    70
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    71
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    72
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    73
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    74
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    75
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    76
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    77
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    78
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    79
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    80
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    81
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    82
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    83
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    84
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    85
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    86
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
    87
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
"
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
!CodeView2 class methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "Invoked at system start or when the class is dynamically loaded."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "/ please change as required (and remove this comment)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    TraceSelectors := IdentitySet new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "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
   101
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
!CodeView2 class methodsFor:'debugging'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
trace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    TraceSelectors add: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    "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
   110
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
untrace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
    TraceSelectors remove: aSelector ifAbsent:[]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    "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
   117
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
untraceAll
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    TraceSelectors := IdentitySet new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
    "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
   124
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
!CodeView2 class methodsFor:'examples'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
example1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    | window codeView |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
    window := StandardSystemView new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    window extent: 300 @ 300.              
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    window label: 'CodeView2 example1'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    codeView := Tools::CodeView2 in: window.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
        origin: 0.1 @ 0.1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        corner: 0.9 @ 0.9.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    window open.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "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
   146
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
!CodeView2 class methodsFor:'menu specs'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   150
debugMenu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   151
    "This resource specification was automatically generated
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   152
     by the MenuEditor of ST/X."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   153
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   154
    "Do not manually edit this!! If it is corrupted,
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   155
     the MenuEditor may not be able to read the specification."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   156
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
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   159
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   160
    "
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
    <resource: #menu>
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   163
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   164
    ^ 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   165
     #(Menu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   166
              (
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   167
               (MenuItem
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   168
                  label: 'Inspect '
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   169
                  itemValue: inspectView
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   170
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   171
                )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   172
               (MenuItem
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   173
                  label: 'Inspect Syntax Elements'
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   174
                  itemValue: inspectSyntaxElements
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   175
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   176
                )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   177
               (MenuItem
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   178
                  label: 'Inspect selected selector'
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   179
                  itemValue: inspectSelectedSelector
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   180
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   181
                )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   182
               )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   183
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   184
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   185
            )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   186
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   187
    "Created: / 08-07-2011 / 13:36:02 / cg"
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   188
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   189
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "This resource specification was automatically generated
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
     by the MenuEditor of ST/X."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    "Do not manually edit this!! If it is corrupted,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
     the MenuEditor may not be able to read the specification."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   202
    UserPreferences current eclipseStyleMenus ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   203
        ^ self editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   204
    ].
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   205
    ^ self editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   206
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   207
    "Modified: / 08-07-2011 / 13:23:35 / cg"
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   208
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   209
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   210
editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   211
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   212
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   213
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   214
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   215
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   216
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   217
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   218
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   219
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   220
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   221
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    <resource: #menu>
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    ^ 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
     #(Menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        (
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
         (MenuItem
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
   228
            label: 'Implementors...'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
            itemValue: browseImplementorsOfIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
            translateLabel: true
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
   231
            submenuChannel: implementorsMenu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
            shortcutKey: ImplementorsOfIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
         (MenuItem
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
   235
            label: 'Senders...'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
            itemValue: browseSendersOfIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
            translateLabel: true
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
   238
            submenuChannel: sendersMenu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
            shortcutKey: SendersOfIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
            label: 'Refactor'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
            isVisible: false
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
            shortcutKey: Shift
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
            label: '-'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
            label: 'Accept'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
            itemValue: accept
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
            shortcutKey: Accept
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
            label: '-'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
            label: 'Cut'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
            itemValue: cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
            shortcutKey: Cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
            label: 'Copy'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
            itemValue: copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
            shortcutKey: Copy
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
            label: 'Paste'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
            itemValue: pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
            shortcutKey: Paste
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
            label: '-'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
            label: 'Undo'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
            itemValue: undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
            shortcutKey: Undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
            label: '-'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
            label: 'Do it'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
            itemValue: doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
            shortcutKey: DoIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
            label: 'Print it'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
            itemValue: printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
            shortcutKey: PrintIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
            label: 'Inspect it'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
            itemValue: inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
            shortcutKey: InspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
            label: 'Profile it'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
            itemValue: profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
            shortcutKey: InspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
            label: '-'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
            label: 'Show Gutter'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
            nameKey: ShowGutter
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
            indication: showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
            label: 'More'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
            nameKey: More
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
            label: 'Services'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
            submenuChannel: servicesMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
         (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
            label: 'Debug'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
            translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
            submenu: 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
           (Menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
              (
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
               (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
                  label: 'Inspect '
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
                  itemValue: inspectView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
                  translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
                )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   343
               (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   344
                  label: 'Inspect Syntax Elements'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
                  itemValue: inspectSyntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
                  translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   347
                )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
               (MenuItem
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   349
                  label: 'Inspect selected selector'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   350
                  itemValue: inspectSelectedSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   351
                  translateLabel: true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   352
                )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
               )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
              nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   355
              nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   356
            )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   357
          )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   358
         )
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   359
        nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   360
        nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   361
      )
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   362
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   363
    "Created: / 08-07-2011 / 13:20:47 / cg"
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   364
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   365
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   366
editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   367
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   368
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   369
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   370
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   371
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   372
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   373
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   374
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   375
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   376
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   377
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   378
    <resource: #menu>
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   379
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   380
    ^ 
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   381
     #(Menu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   382
        (
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   383
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   384
            label: 'Undo'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   385
            itemValue: undo
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   386
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   387
            shortcutKey: Undo
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   388
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   389
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   390
            label: 'Again'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   391
            itemValue: again
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   392
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   393
            shortcutKey: Again
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   394
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   395
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   396
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   397
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   398
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   399
            label: 'Cut'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   400
            itemValue: cut
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   401
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   402
            shortcutKey: Cut
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   403
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   404
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   405
            label: 'Copy'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   406
            itemValue: copySelection
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   407
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   408
            shortcutKey: Copy
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   409
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   410
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   411
            label: 'Paste'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   412
            itemValue: pasteOrReplace
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   413
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   414
            shortcutKey: Paste
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   415
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   416
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   417
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   418
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   419
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   420
            label: 'DoIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   421
            itemValue: doIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   422
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   423
            shortcutKey: DoIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   424
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   425
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   426
            label: 'PrintIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   427
            itemValue: printIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   428
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   429
            shortcutKey: PrintIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   430
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   431
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   432
            label: 'InspectIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   433
            itemValue: inspectIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   434
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   435
            shortcutKey: InspectIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   436
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   437
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   438
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   439
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   440
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   441
            label: 'Accept'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   442
            itemValue: accept
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   443
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   444
            shortcutKey: Accept
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   445
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   446
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   447
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   448
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   449
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   450
            label: 'Refactor'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   451
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   452
            isVisible: false
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   453
            shortcutKey: Shift
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   454
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   455
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   456
            label: 'Services'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   457
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   458
            submenuChannel: servicesMenu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   459
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   460
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   461
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   462
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   463
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   464
            label: 'More'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   465
            nameKey: More
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   466
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   467
            shortcutKey: Ctrl
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   468
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   469
         )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   470
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   471
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   472
      )
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   473
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
!CodeView2 methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
acceptAction:aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
    textView acceptAction: aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
    "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
   482
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   484
breakpoints
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   485
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   486
    services do:[:each|
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   487
        (each isKindOf: BreakpointService) ifTrue:[
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   488
            ^each breakpoints
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   489
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   490
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   491
    ^ nil
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   492
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   493
    "Created: / 06-07-2011 / 18:05:35 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   494
    "Modified: / 06-10-2011 / 14:13:53 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   495
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   496
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   497
browser
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   498
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   499
    ^self browserHolder value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   500
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   501
    "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
   502
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   503
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
codeAspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    |app|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
    codeAspect ifNotNil:[^codeAspect].
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   508
    methodHolder value ifNotNil:[^#method].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
    ^((app := self topView application) notNil and:[app respondsTo: #codeAspect])
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
        ifTrue:[app codeAspect]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   512
        ifFalse:[#expression]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   513
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   514
    "Modified: / 27-07-2011 / 13:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   515
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   516
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   517
codeAspect:aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   518
    codeAspect := aSymbol.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   519
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
    ^textView contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
    "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
   526
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
contents: aStringOrStringCollection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   529
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
    textView contents: aStringOrStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   531
    "/self update:#value with: aStringOrStringCollection from: textView model
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   532
10330
212b120c198f Improvements in diffing tools
vrany
parents: 10326
diff changeset
   533
    "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
   534
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   535
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   536
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   537
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   538
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   539
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   540
diffMode:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   541
    diffMode := aBoolean.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
    textView diffMode: aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   544
    "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
   545
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   548
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
    ^textView font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
    "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
   552
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
    ^textView font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
    "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
   559
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
mode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
    ^self modeHolder value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
    "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
   566
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
mode: aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   569
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   570
    self assert: (#(expression method) includes: aSymbol).    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
    ^self modeHolder value: aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   573
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
    "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
   575
    "Modified: / 15-06-2011 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   576
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   577
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   578
model
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   579
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   580
    ^textView model.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   581
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   582
    "Created: / 27-07-2011 / 12:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   583
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   584
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   585
model: aValueModel
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   586
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   587
    |oldValue newValue|
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   588
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   589
    textView model notNil ifTrue:[
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   590
        oldValue := textView model value.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   591
        textView model removeDependent:self.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   592
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   593
    textView model: aValueModel.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   594
    textView model notNil ifTrue:[
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   595
        textView model addDependent:self.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   596
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   597
    newValue := textView model value.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   598
    oldValue ~~ newValue ifTrue:[
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   599
        self update:#value with:newValue from:textView model.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   600
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   601
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   602
    "Modified: / 27-07-2011 / 12:58:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   603
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   604
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   605
modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   606
    "return true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   608
    ^ self modifiedChannel value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   609
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   610
    "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
   611
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   612
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   613
modified:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   614
    "set/clear the modified flag"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   615
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   616
    self modifiedChannel value:aBoolean
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   617
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   618
    "Modified: / 14-02-1997 / 16:44:05 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   619
    "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
   620
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   621
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   622
scrolledView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   623
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   624
    ^self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   625
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   626
    "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
   627
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   628
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   629
services
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   630
    ^ services ? #()
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   631
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   632
    "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
   633
    "Modified (format): / 06-10-2011 / 14:11:11 / cg"
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   634
!
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   635
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   636
services:aCollectionOfServices
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   637
    "allow setting of the services (instances);
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   638
     this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   639
     services"
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   640
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   641
    servicesFromClient := true.
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   642
    services := aCollectionOfServices.
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   643
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   644
    "Created: / 06-10-2011 / 14:15:36 / cg"
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   645
!
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   646
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   647
showAcceptCancelBar
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   648
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   649
    ^showAcceptCancelBarChannel value
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   650
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   651
    "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
   652
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   653
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   654
showGutter
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   655
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   656
    ^showGutterChannel value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   657
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   658
    "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
   659
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   660
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   661
synchronizeWith: aCodeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   662
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   663
    self assert: aCodeView ~= self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   664
    (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   665
    synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
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: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   668
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   669
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   670
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   671
!CodeView2 methodsFor:'accessing - code component'!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   672
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   673
klass
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   674
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   675
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   676
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   677
    (v := self classHolder value) notNil ifTrue:[^v].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   678
    (v := self methodHolder value) notNil ifTrue:[^v mclass].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   679
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   680
    ^UndefinedObject
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   681
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   682
    "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   683
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   684
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   685
klass: aClass
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   686
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   687
    "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   688
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   689
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   690
language
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   691
    "return the value in 'languageHolder'"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   692
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   693
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   694
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   695
    (v := self languageHolder value) notNil ifTrue:[^v].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   696
    (v := self methodHolder value) notNil ifTrue:[^v programmingLanguage].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   697
    (v := self classHolder value) notNil ifTrue:[^v programmingLanguage].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   698
10967
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   699
    "/No, no default language, please.
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   700
    "/^SmalltalkLanguage instance
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   701
    ^nil
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   702
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   703
    "Modified: / 07-12-2011 / 16:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   704
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   705
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   706
language: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   707
    "set the value in 'languageHolder'"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   708
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   709
    self languageHolder value: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   710
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   711
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   712
method
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   713
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   714
    ^self methodHolder value
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   715
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   716
    "Created: / 27-07-2011 / 13:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   717
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   718
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   719
method: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   720
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   721
    ^self methodHolder value: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   722
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   723
    "Created: / 27-07-2011 / 13:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   724
! !
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   725
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   726
!CodeView2 methodsFor:'aspects'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   727
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   728
browserHolder
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
   729
    browserHolder isNil ifTrue:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
        browserHolder := ValueHolder new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   732
    ^browserHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   733
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
    "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
   735
    "Modified: / 18-11-2011 / 14:58:15 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
browserHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
    browserHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
    "return/create the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
    classHolder isNil ifTrue:[
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   746
        classHolder := ValueHolder with: nil.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
    ^ classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   751
    "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
   752
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
classHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
    "set the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
        oldValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
        classHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
    classHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
    newValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   770
        self update:#value with:newValue from:classHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
    self changed: #classHolder with: old -> classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   774
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
    "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
   776
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   777
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   778
languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
    languageHolder isNil ifTrue:[
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   780
        "/ cg: I dont like this default here; everyone who is not showing ST-code (expecco, filebrowser etc.)
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   781
        "/ has to explicitely clear the valueholder. I guess, it is better for the few
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   782
        "/ others to explicitely set it, if they do not provide syntaxHighlighter per method
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   783
        "/ or class.
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   784
        languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
    ^ languageHolder
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   788
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
   789
    "Modified (format): / 26-09-2011 / 17:04:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   790
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
languageHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
    "set the 'languageHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   794
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
        oldValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
        languageHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   800
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   801
    languageHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   802
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   803
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   804
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
    old := languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
    newValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   807
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   808
        self update:#value with:newValue from:languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
    self changed: #languageHolder with: old -> languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
    "Modified: / 17-06-2011 / 12:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    "return/create the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
    methodHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   820
        methodHolder := ValueHolder new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   823
    ^ methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   824
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   825
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
methodHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
    "set the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   832
        oldValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   833
        methodHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
    methodHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
    newValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
        self update:#value with:newValue from:methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
    self changed: #methodHolder with: old -> methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
    "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
   848
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   850
modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
    "return/create the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   852
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   853
    modeHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   854
        modeHolder := #expression asValue.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   855
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   856
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   857
    ^ modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   858
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   859
    "Modified: / 13-06-2011 / 10:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   860
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   861
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   862
modeHolder:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   863
    "set the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   864
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   865
    |oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   866
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   867
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   868
        oldValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   869
        modeHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   870
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   871
    modeHolder := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   872
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
    newValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
        self update:#value with:newValue from:modeHolder.
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
    self changed: #modeHolder with: modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   881
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
    "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
   883
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
!CodeView2 methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
update:aspect with:param from:sender
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   889
    sender == showGutterChannel ifTrue: [
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   890
        self updateGutterVisibility.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   891
        ^self.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   892
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   894
    services do:[:each | 
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   895
        each isEnabled ifTrue:[
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   896
            each update:aspect with:param from:sender 
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   897
        ]
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   898
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
    super update:aspect with:param from:sender
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
    "Modified: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   903
    "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
   904
    "Modified: / 06-10-2011 / 14:14:36 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
updateGutterVisibility
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
    self showGutterChannel value ifTrue:[        
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
        textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
        gutterView beVisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
    ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
        textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
        gutterView beInvisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
    "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
   918
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
!CodeView2 methodsFor:'channels'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
modifiedChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   923
    "return the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   925
    ^ textView modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   926
"/    ^ modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   927
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   928
    "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
   929
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
modifiedChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   932
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   934
    textView modifiedChannel removeDependent:self.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   935
    textView modifiedChannel:aValueHolder.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
   936
    textView modifiedChannel addDependent:self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   937
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   938
"/    |prev|
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   939
"/
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   940
"/    prev := modifiedChannel.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   941
"/    modifiedChannel := aValueHolder.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   942
"/    self setupChannel:aValueHolder for:nil withOld:prev
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   943
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   944
    "Created: / 30-01-1998 / 14:51:32 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   945
    "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
   946
    "Modified: / 05-09-2011 / 05:13:27 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   947
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   948
10785
vrany
parents: 10784
diff changeset
   949
reallyModifiedChannel
vrany
parents: 10784
diff changeset
   950
    "return the valueHolder holding true if text was modified"
vrany
parents: 10784
diff changeset
   951
vrany
parents: 10784
diff changeset
   952
    ^ textView reallyModifiedChannel
vrany
parents: 10784
diff changeset
   953
vrany
parents: 10784
diff changeset
   954
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
   955
    "Created: / 08-10-2011 / 12:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
   956
!
vrany
parents: 10784
diff changeset
   957
vrany
parents: 10784
diff changeset
   958
reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
   959
vrany
parents: 10784
diff changeset
   960
    ^ textView reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
   961
vrany
parents: 10784
diff changeset
   962
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
   963
    "Created: / 08-10-2011 / 12:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
   964
!
vrany
parents: 10784
diff changeset
   965
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   966
showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   967
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   968
    ^showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   969
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   970
    "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
   971
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   972
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   973
showAcceptCancelBarChannel:aValueHolder
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   974
    "set the valueHolder holding true if text was modified"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   975
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   976
    |prev|
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   977
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   978
    prev := showAcceptCancelBarChannel.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   979
    showAcceptCancelBarChannel := aValueHolder.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   980
    self setupChannel:aValueHolder for:nil withOld:prev.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   981
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   982
    "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
   983
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   984
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
    ^showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
    "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
   990
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
showGutterChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   995
    |prev|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   996
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
    prev := showGutterChannel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
    showGutterChannel := aValueHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
    self setupChannel:aValueHolder for:nil withOld:prev
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1000
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1001
    "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
  1002
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1004
!CodeView2 methodsFor:'code services'!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1005
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1006
browseMethod: method
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1007
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1008
    self browseMethod: method label: nil.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1009
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1010
    "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
  1011
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1012
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1013
browseMethod: method label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1014
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1015
    self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1016
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1017
        or:[self browser navigationState modified])  
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1018
        ifTrue:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1019
            [self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1020
                spawnFullBrowserInClass: method mclass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1021
                selector:method selector 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1022
                in:#newBuffer]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1023
        ifFalse:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1024
            [self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1025
                switchToClass: method containingClass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1026
                selector: method selector].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1027
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1028
    "Modified: / 19-02-2008 / 10:15:17 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1029
    "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1030
    "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
  1031
    "Modified: / 18-11-2011 / 14:58:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1032
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1033
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1034
browseMethods: methods label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1035
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1036
    methods size = 1 ifTrue:
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1037
        [^self browseMethod: methods anyOne label: label].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1038
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1039
    self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1040
        ifNil: [NewSystemBrowser browseMethods: methods title: label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1041
        ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1042
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1043
    "Created: / 26-12-2007 / 11:32:04 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1044
    "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1045
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1046
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1047
extractSelectorAndSelectedTextFrom: givenSelectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1048
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1049
    | selector selectedText compilerClass na |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1050
    selectedText := givenSelectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1051
    compilerClass := self language compilerClass.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1052
    selectedText size > 0 ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1053
        self windowGroup withWaitCursorDo:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1054
            "/ hack, for now and expecco; must ask the Parser eventually...
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1055
            (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1056
                "/ selector is in one piece anyway
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1057
                (selectedText includes:$_) ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1058
                    "/ zero or one args - sigh (need to parse more to figure this out)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1059
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1060
                    selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1061
                ] ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1062
                    "/ count _#s plus one arg - sigh
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1063
                    na := (selectedText occurrencesOf:$_) + 1. 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1064
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1065
                ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1066
            ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1067
                selector := SystemBrowser extractSelectorFrom:selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1068
            ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1069
        ]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1070
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1071
    ^Array with: selector with: selectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1072
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1073
    "Created: / 30-06-2011 / 19:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1074
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1075
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1076
implementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1077
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1078
    selector isNil ifTrue:[^#()].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1079
    ^SystemBrowser
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1080
        findImplementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1081
        in: Smalltalk allClasses
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1082
        ignoreCase: false
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1083
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1084
    "Created: / 26-12-2007 / 11:37:11 / janfrog"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1085
    "Modified: / 18-11-2011 / 14:58:17 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1086
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1087
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1088
sendersOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1089
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1090
    selector isNil ifTrue:[^#()].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1091
    ^SystemBrowser
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1092
        findSendersOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1093
        in: Smalltalk allClasses
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1094
        ignoreCase: false
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1095
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1096
    "Created: / 26-12-2007 / 11:37:22 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1097
    "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
  1098
    "Modified: / 18-11-2011 / 14:58:19 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1099
! !
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1100
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
!CodeView2 methodsFor:'delegation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    ((textView respondsTo: aMessage selector) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
    and:[(TraceSelectors includes:aMessage selector) not])
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
        ifTrue:[^aMessage sendTo: textView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
    ^super doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
    "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
  1111
    "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
  1112
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
    ^textView hasSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
    "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
  1119
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
!CodeView2 methodsFor:'delegation - drawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
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
  1124
    "See the comment in
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
     CodeViewService>>drawLine:in:atX..."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
    services do:[:each|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
        each 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
  1129
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1130
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1131
    "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
  1132
    "Modified: / 06-10-2011 / 14:14:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1133
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1134
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1135
redrawVisibleLine: visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1136
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1137
    "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
  1138
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1139
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1140
redrawVisibleLine:visLine col:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
    "Modified: / 05-11-2007 / 17:35:53 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
    "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
  1144
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1145
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1146
redrawVisibleLine:visLine from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
    "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
  1149
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
redrawVisibleLine:visLine from:startCol to:endCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
    "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
  1154
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
!CodeView2 methodsFor:'delegation - events'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
buttonMotion: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1163
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1164
    ^ services
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
        inject: false
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1166
        into:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1167
            [:processed :service|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1168
            service isEnabled 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1169
                ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1170
                    [processed]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1171
                ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1172
                    [processed | ((service buttonMotion: button x:x y:y in: view) == true)]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1173
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
    "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1175
    "Modified: / 06-10-2011 / 14:13:57 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1177
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
buttonPress: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1179
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1180
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1183
    ^ services
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
        inject: false
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
        into:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
            [:processed :service|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
            service isEnabled 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1188
                ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1189
                    [processed]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1190
                ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1191
                    [processed | ((service buttonPress: button x:x y:y in: view) == true)]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1193
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1194
    "Modified: / 06-10-2011 / 14:14:00 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1195
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1196
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1197
keyPress: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1199
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1202
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1203
    ^ services
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
        inject: false
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
        into:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1206
            [:processed :service|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
            service isEnabled 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
                ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
                    [processed]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
                ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
                    [processed | ((service keyPress: key x:x y:y in: view) == true)]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
    "Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1214
    "Modified: / 06-10-2011 / 14:14:11 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
keyRelease: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1218
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1219
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1220
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1221
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1222
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1223
    ^ services
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1224
        inject: false
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1225
        into:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1226
            [:processed :service|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
            service isEnabled 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
                ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
                    [processed]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
                ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
                    [processed | ((service keyRelease: key x:x y:y in: view) == true)]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
    "Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1234
    "Modified: / 06-10-2011 / 14:14:13 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1237
linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1238
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1239
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1240
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1241
            each linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1242
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1243
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1244
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1245
    "Created: / 06-07-2011 / 17:12:54 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1246
    "Modified: / 06-10-2011 / 14:14:16 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1247
    "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
  1248
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1249
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1250
linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1251
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1252
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1253
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1254
            each linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1255
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1256
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1257
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1258
    "Created: / 06-07-2011 / 17:12:48 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1259
    "Modified: / 06-10-2011 / 14:14:20 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1260
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1261
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1262
linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1263
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1264
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1265
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1266
            each linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1267
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1268
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1269
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1270
    "Created: / 06-07-2011 / 17:12:58 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1271
    "Modified: / 06-10-2011 / 14:13:44 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1272
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1273
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1274
scrollDown: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1275
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1276
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1277
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1278
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1279
            synchronizedCodeViews do:[:codeView|codeView scrollDown: nLines in: view]]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
        ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1281
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1282
            textView basicScrollDown: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1283
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1284
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1285
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1286
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1287
scrollUp: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1288
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1289
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1290
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1291
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1292
            synchronizedCodeViews do:[:codeView|codeView scrollUp: nLines in: view]]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1293
        ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1294
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1295
            textView basicScrollUp: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1296
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1297
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1298
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1299
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
!CodeView2 methodsFor:'diff mode'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1301
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1302
recomputeDiff:view 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1303
    |t1 t2 pom diffHelper view2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1304
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1305
    t1 := view getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1306
    synchronizedCodeViews do:[:codeView | 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1307
        view2 := codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1308
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1309
    view changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1310
    view2 changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1311
    t2 := view2 getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1312
    pom := DiffCodeView2 new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1313
    (view == textView) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1314
        diffHelper := pom computeDiffDataForText1:t1 text2:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
        (view) contents:(diffHelper text1).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
        (view) deletedLines:(diffHelper deleted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1317
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1318
        (view) originDiffText:t1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1319
        (view) emptyLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1320
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1321
        (view2) contents:(diffHelper text2).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1322
        (view2) insertedLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1323
        (view2) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1324
        (view2) originDiffText:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1325
        (view2) emptyLines:(diffHelper deleted).
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
    "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1329
    "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
  1330
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1331
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1332
!CodeView2 methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1333
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1334
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1335
    "Invoked when a new instance is created."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1336
    "Call super initialize"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1337
    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1338
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1339
     "Now set up some visual properties"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1340
    self level:-1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1341
     "Now initialize sub-views"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1342
    showGutterChannel := (ValueHolder with: true).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1343
    showGutterChannel addDependent: self.     
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1344
    showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel)).
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1345
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1346
    self initializeGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1347
    self initializeTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1348
    gutterView setCodeView:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1349
    textView setCodeView:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1350
    modifiedChannel := ValueHolder with:false.    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1351
    diffMode := false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1352
    synchronizedCodeViews := #().
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1353
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1354
    servicesFromClient := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
    services := OrderedCollection new.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  1356
    self initializeServices.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1358
    "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
    "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
  1360
    "Modified: / 06-10-2011 / 14:15:48 / cg"
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  1361
    "Modified: / 18-10-2011 / 19:17:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1362
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1363
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
initializeGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1366
    gutterView := CodeView2::GutterView new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
    gutterView origin:(0.0 @ 0.0) corner:(gutterView preferredWidth @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
    showGutterChannel value ifTrue:[self addSubView: gutterView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1370
    "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
  1371
    "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
  1372
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1373
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1374
initializeServices
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1375
    | serviceClasses |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
  1376
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1377
    "/ 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
  1378
    "/ (FileBrowser does not want Smalltalk-specific services)
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1379
    servicesFromClient ifFalse:[
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1380
        serviceClasses := CodeViewService availableServices sort:[:a :b|name < b name].
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1381
        serviceClasses do:[:cls|
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1382
            self registerService: cls new
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1383
        ].
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1384
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1385
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
  1386
    "Modified: / 27-07-2011 / 11:37:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1387
    "Modified: / 06-10-2011 / 14:16:01 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1388
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1389
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1390
initializeTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1391
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1392
    "Initialize textView. gutterView have to be 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1393
     already initialized!!"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1394
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1395
    textViewScroller := HVScrollableView for: CodeView2::TextView in: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1396
    textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1397
        origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1398
        corner: 1.0@1.0;
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1399
        level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1400
    textView := textViewScroller scrolledView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1401
    textView level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1402
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1403
    textView modifiedChannel addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1404
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1405
    "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
  1406
    "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
  1407
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1408
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1409
!CodeView2 methodsFor:'menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1410
10689
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1411
accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1412
    textView accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1413
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1414
    "Created: / 07-09-2011 / 21:29:07 / cg"
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1415
!
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1416
10375
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1417
again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1418
    textView again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1419
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1420
    "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
  1421
    "Created: / 22-07-2011 / 17:44:31 / cg"
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1422
!
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1423
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1424
browseImplementorsOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1425
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1426
    textView browseImplementorsOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1427
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1428
    "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
  1429
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1430
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1431
browseSendersOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1432
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1433
    textView browseSendersOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1434
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1435
    "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
  1436
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1437
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1438
copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1439
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1440
    textView copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1441
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1442
    "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
  1443
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1444
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1445
cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1446
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1447
    textView cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1448
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1449
    "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
  1450
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1451
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1452
doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1453
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1454
    textView doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1455
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1456
    "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
  1457
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1458
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1459
inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1460
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1461
    textView inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1462
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1463
    "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
  1464
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1465
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1466
inspectSelectedSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1467
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1468
    self error: 'Not yet implemented'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1469
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1470
    "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
  1471
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1472
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1473
inspectSyntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1474
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1475
    syntaxElements inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1476
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1477
    "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
  1478
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1479
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1480
inspectView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1481
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1482
    self inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1483
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1484
    "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
  1485
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1486
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1487
pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1488
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1489
    textView pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1490
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1491
    "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
  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
printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1496
    textView printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1497
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
    "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
  1499
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1500
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1501
profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1502
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1503
    textView profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1504
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1505
    "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
  1506
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1507
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1508
undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1509
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1510
    textView undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1511
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1512
    "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
  1513
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1514
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1515
!CodeView2 methodsFor:'menus-dynamic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1516
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1517
editMenu
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1518
    | editMenu superEditMenu moreMenu moreMenuItem |
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1519
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1520
    superEditMenu := textView superEditMenu.
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1521
    moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1522
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1523
    textView sensor ctrlDown ifTrue:[
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1524
        ^superEditMenu
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1525
    ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1526
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
    editMenu := self class editMenu decodeAsLiteralArray.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
    moreMenuItem := editMenu menuItemLabeled: 'More'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1529
    moreMenuItem submenu: moreMenu asMenu.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1530
    editMenu findGuiResourcesIn: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
    ^editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1532
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
    "Created: / 25-12-2007 / 10:10:01 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
    "Modified: / 25-12-2007 / 19:50:53 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
    "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
  1536
    "Modified: / 08-07-2011 / 13:35:31 / cg"
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  1537
    "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
  1538
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1539
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1540
implementorsMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1541
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1542
    | selectorAndSelectedText selector selectedText  implementors |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1543
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1544
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1545
    selectedText size > 0 ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1546
        self windowGroup withWaitCursorDo:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1547
            selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1548
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1549
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1550
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1551
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1552
                implementors := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1553
                                findImplementorsOfAny:(Array with:selectedText) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1554
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1555
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1556
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1557
                ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1558
                implementors := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1559
                                findImplementorsOfAny:(Array with:selectedText with: selector) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1560
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1561
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1562
                ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1563
            ] 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1564
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1565
        implementors := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1566
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1567
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1568
    ^self implementorsMenu: implementors selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1569
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1570
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1571
    "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1572
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1573
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1574
implementorsMenu: implementors selector: selector  
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1575
    | menu|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1576
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1577
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1578
    implementors isEmptyOrNil ifTrue:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1579
        menu addItem:(MenuItem label:'No implementors found') disable
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1580
    ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1581
        menu addItem:(MenuItem 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1582
                    label:(selector storeString , (' (all implementors) ') asText allItalic)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1583
                    value:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1584
                        self browseMethods:implementors
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1585
                            label:'Implementors of ' , selector storeString
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1586
                    ]).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1587
        menu addSeparator.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1588
        implementors do:[:mth | 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1589
            menu 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1590
                addItem:(MenuItem label:(selector storeString 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1591
                                , (' in ' , mth containingClass name asText allBold))
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1592
                        value:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1593
        ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1594
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1595
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1596
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1597
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1598
    "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1599
    "Modified: / 04-08-2011 / 19:05:15 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1600
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1601
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1602
sendersMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1603
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1604
    | selectorAndSelectedText selector selectedText  senders |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1605
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1606
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1607
    selectedText size > 0 ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1608
        self windowGroup withWaitCursorDo:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1609
            selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1610
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1611
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1612
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1613
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1614
                senders := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1615
                                findSendersOfAny:(Array with:selectedText) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1616
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1617
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1618
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1619
                ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1620
                senders := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1621
                                findSendersOfAny:(Array with:selectedText with: selector) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1622
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1623
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1624
                ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1625
            ] 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1626
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1627
        senders := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1628
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1629
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1630
    ^self sendersMenu: senders selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1631
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1632
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1633
    "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1634
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1635
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1636
sendersMenu: senders  selector: selector  
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1637
    | menu shownSenderItems numCut|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1638
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1639
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  1640
    senders isEmptyOrNil ifTrue:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1641
        menu addItem:(MenuItem label:'No senders found') disable
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1642
    ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1643
        menu addItem:(MenuItem 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1644
                    label:(selector storeString , (' (all senders)') asText allItalic)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1645
                    value:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1646
                        self browseMethods:senders
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1647
                            label:'Senders of ' , selector storeString
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1648
                    ]).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1649
        menu addSeparator.
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1650
        shownSenderItems := (senders size > 20) ifTrue:[senders copyTo:20] ifFalse:[senders].
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1651
        numCut := senders size - 20.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1652
        shownSenderItems do:[:mth | 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1653
            menu 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1654
                addItem:(MenuItem label:(mth selector storeString 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1655
                                , (' in ' , mth containingClass name asText allBold))
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1656
                        value:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1657
        ].
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1658
        numCut > 0 ifTrue:[
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1659
            menu addSeparator.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1660
            menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1661
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1662
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1663
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1664
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1665
    "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1666
    "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
  1667
    "Modified: / 07-07-2011 / 14:51:54 / jv"
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  1668
    "Modified: / 21-08-2011 / 11:44:00 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1669
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1670
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1671
servicesMenu
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1672
    |menu item anyService|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1673
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1674
    menu := Menu new.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1675
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1676
    item := MenuItem label:(resources string:'Show Gutter').
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1677
    item indication:(self showGutterChannel).
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1678
    menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1679
    menu addSeparator.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1680
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1681
    anyService := false.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1682
    services do:[:service | 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1683
        |item|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1684
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1685
        item := MenuItem label:(resources string:service label).
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1686
        item indication:((AspectAdaptor forAspect:#enabled) subject:service).
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1687
        menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1688
        anyService := true.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1689
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1690
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1691
    anyService ifTrue:[
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1692
        menu addSeparator.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1693
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1694
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1695
    item := MenuItem label:(resources string:'Debug').
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1696
    item submenuChannel:[ self class debugMenu ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1697
    menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1698
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  1699
    ^ menu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1700
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1701
    "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
  1702
    "Modified: / 06-10-2011 / 14:14:30 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1703
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1704
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1705
!CodeView2 methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1706
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1707
codeCompletion
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1708
    |cls 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1709
"/     crsrPos interval node checkedNode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1710
"/     char start stop selectorSoFar matchingSelectors
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1711
    |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1712
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1713
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1714
    cls := self classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1715
    cls isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1716
        self showInfo:'No class'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1717
        ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1718
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1719
    UserInformation handle:[:ex |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1720
        self showInfo:(ex messageText).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1721
        ex proceed.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1722
    ] do:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1723
        self withWaitCursorDo:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1724
            DoWhatIMeanSupport codeCompletionForClass:cls codeView:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1725
        ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1726
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1727
    ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1728
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1729
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1730
"/    interval := self selectedInterval.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
"/    interval isEmpty ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1732
"/        crsrPos := codeView characterPositionOfCursor - 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1733
"/        char := codeView characterUnderCursor.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1734
"/        [crsrPos > 1 and:[char isSeparator or:['.' includes:char]]] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1735
"/            crsrPos := crsrPos - 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1736
"/            char := codeView characterAtCharacterPosition:crsrPos.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1738
"/        interval := crsrPos to:crsrPos.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1739
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1740
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1741
"/    node := self findNodeForInterval:interval allowErrors:true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1742
"/    [node isNil] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1743
"/        "/ expand to the left ...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1744
"/        interval start > 1 ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1745
"/            self showInfo:'No parseNode found'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1746
"/            ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1747
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1748
"/        interval start:(interval start - 1).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1749
"/        node := self findNodeForInterval:interval allowErrors:true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1750
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1751
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1752
"/    node isVariable ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1753
"/        self codeCompletionForVariable:node inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1754
"/        ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1755
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1756
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
"/    checkedNode := node.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1758
"/    [checkedNode notNil] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1759
"/        checkedNode isMessage ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1760
"/            self codeCompletionForMessage:checkedNode inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1761
"/            ^ self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1762
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1763
"/        checkedNode isMethod ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1764
"/            self codeCompletionForMethod:checkedNode inClass:cls.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1765
"/            ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1766
"/        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1767
"/        checkedNode := checkedNode parent.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1768
"/    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1769
"/
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
"/    self showInfo:'Node is neither variable nor message.'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1771
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1772
    "Modified: / 04-07-2006 / 18:48:26 / fm"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1773
    "Modified: / 20-11-2006 / 12:30:59 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1774
    "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
  1775
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1777
reallyModified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1778
    "check for modified code by comparing the source against
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
     the codeViews contents.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
     Thats the true modified value (in case user undid its changes,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1781
     and the displayed text is actually original"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1782
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1783
    |modified changedSource originalSource s1 s2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1784
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1785
    textView modified ifTrue:[^true].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1786
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1787
    "/ 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
  1788
    Processor activeProcess
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1789
        withHigherPriorityDo:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1790
            changedSource :=  textView contentsAsString asStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1791
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1792
    changedSource := changedSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1793
    changedSource := changedSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
    [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1795
        changedSource := changedSource copyWithoutLast:1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1796
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1797
    changedSource := changedSource asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1798
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1799
        originalSource := textView model value ? ''.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1801
        originalSource := originalSource asStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
        originalSource := originalSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1803
        originalSource := originalSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1804
        [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1805
            originalSource := originalSource copyWithoutLast:1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1806
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1807
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1808
        s1 := originalSource asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1809
        s2 := changedSource asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1810
        modified := (s1 ~= s2).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1811
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1812
    ^ modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1813
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1814
    "Created: / 06-02-2010 / 19:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1815
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1816
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1817
showInfo: message
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1818
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
    | app |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
    (app := self topView application) ifNotNil:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
        [(app respondsTo: #showInfo:) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1822
            [app showInfo: message]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
    "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
  1825
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1827
!CodeView2 methodsFor:'private-accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1828
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1829
gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1830
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1831
    ^gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1832
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1833
    "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
  1834
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1835
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1836
syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1837
    ^ syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1838
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1839
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
syntaxElementSelection:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1841
    syntaxElementSelection := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1842
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1843
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1844
syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1845
    ^ syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1846
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1847
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1848
syntaxElements:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1849
    syntaxElements := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1850
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1851
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1852
textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1854
    ^textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1855
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1856
    "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
  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
textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1860
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1861
    ^textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1862
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1863
    "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
  1864
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1866
!CodeView2 methodsFor:'services'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1867
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1868
registerService: aCodeViewService
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1869
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1870
    services add: aCodeViewService.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1871
    aCodeViewService registerIn: self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1872
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1873
    "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
  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
underService: aCodeViewService
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1877
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1878
    services remove: aCodeViewService ifAbsent:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1879
    aCodeViewService unregister.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1880
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1881
    "Created: / 06-03-2010 / 19:21:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1882
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1883
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1884
!CodeView2 methodsFor:'testing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
10722
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1886
isCodeView2
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1887
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1888
    ^true
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1889
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1890
    "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
  1891
!
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  1892
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
isTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1894
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1895
    ^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
    "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
  1898
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1899
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1900
!CodeView2::GutterView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1901
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1902
setTextView: aTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1903
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1904
    self assert: textView isNil message:'Attempting to set textView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1905
    textView := aTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1906
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  1907
    "/ self backgroundPaint: textView backgroundPaint darkened lighter.
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  1908
    self viewBackground: (View defaultBackgroundColor). "/ textView backgroundPaint darkened lighter.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1909
    self paint: textView paint.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1910
    self font: textView font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1911
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1912
    "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
  1913
    "Modified: / 14-12-2009 / 15:09:29 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1914
    "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
  1915
    "Modified: / 17-08-2011 / 15:15:09 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1916
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1917
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1918
setTextViewScroller:aScr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1919
    textViewScroller := aScr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1920
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1921
    "Created: / 07-12-2009 / 22:36:31 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1922
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1923
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1924
!CodeView2::GutterView methodsFor:'accessing-dimensions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1925
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1926
acceptButtonBottom
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1927
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  1928
    ^(self height * 0.6) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1929
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1930
    "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
  1931
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1932
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1933
cancelButtonBottom  
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1934
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  1935
    ^(self height * 0.8) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1936
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1937
    "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
  1938
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1939
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1940
padding
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1941
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1942
    ^self paddingLeft + self paddingRight 
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1943
        + (widthAcceptCancel ? 0)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1944
        + (widthAnnotations ? 0) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1945
        + (widthDiffInfo ? 0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1946
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1947
    "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
  1948
    "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
  1949
    "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
  1950
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1951
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1952
paddingLeft
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
    ^0"px"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1955
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1956
    "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
  1957
    "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
  1958
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1959
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1960
paddingRight
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1962
    ^0"px"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1963
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1964
    "Created: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1965
    "Modified: / 16-06-2011 / 13:47:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1966
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1967
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1968
preferredExtent
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1969
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1970
    | w h |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1971
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1972
    explicitExtent ifNotNil:[^explicitExtent].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1973
    preferredExtent ifNotNil:[^preferredExtent].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1974
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1975
    w := (self font widthOf:'00') + self padding.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
    h := textView ifNotNil:[textView height] ifNil:[self font height * 12].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
    ^preferredExtent := w @ h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1980
    "Modified: / 16-06-2011 / 14:03:11 / 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
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1983
!CodeView2::GutterView methodsFor:'actions'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1984
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1985
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1986
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1987
    textView accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1988
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1989
    "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
  1990
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1991
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1992
cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1993
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1994
    textView cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1995
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1996
    "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
  1997
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1998
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1999
diff
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2000
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2001
    "Created: / 07-10-2011 / 20:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2002
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2003
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
!CodeView2::GutterView methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
update:something with:aParameter from:changedObject
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2007
    self shown ifFalse:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2008
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2009
    (changedObject == textView) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2010
        (something == #sizeOfContents) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2011
            "/ cg: with that test, it does not update when the text becomes smaller...
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2012
"/            (firstLineShown ~= textView firstLineShown 
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2013
"/            or:[lastLineShown ~= (textView lastLineShown - 1)]) ifTrue:[
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2014
                self invalidate.
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2015
                ^self.
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2016
"/            ]
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2017
        ].
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2018
    ].
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2019
    (changedObject == textView reallyModifiedChannel) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2020
        self invalidate.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2021
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2022
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2023
    "/ changedObject == someOfMyValueHolders ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2024
    "/     self doSomethingApropriate.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2025
    "/     ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2026
    "/ ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2027
    super update:something with:aParameter from:changedObject
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2028
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2029
    "Modified (format): / 15-07-2011 / 20:14:04 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2030
    "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
  2031
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2032
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2033
!CodeView2::GutterView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2034
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2035
buttonPress: btn x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2036
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2037
    "Do not allow clicking on line numbers..."
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2038
    (x <= (self paddingLeft + widthAcceptCancel)) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2039
        (y < self acceptButtonBottom) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2040
            self accept.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2041
            ^self.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2042
        ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2043
        (y < self cancelButtonBottom) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2044
            self cancel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2045
            ^self.            
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2046
        ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2047
        self diff.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2048
        ^self.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2049
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2050
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2051
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2052
    ((x > (self paddingLeft + widthAcceptCancel)) or:
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2053
        [x < (self width - self paddingRight - widthDiffInfo)])
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2054
        ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2055
            (codeView buttonPress: btn x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2056
                ifFalse:[super buttonPress: btn x: x y: y]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2057
        ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2058
            super buttonPress: btn x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2059
        ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2060
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2061
    "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2062
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2063
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2064
!CodeView2::GutterView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2065
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2066
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2067
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2068
    super initialize.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2069
    widthAcceptCancel := 16.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2070
    widthAnnotations := 8.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2071
    widthDiffInfo := 5.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2072
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2073
    acceptColor := Color green lighter.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2074
    cancelColor := Color red lighter lighter.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2075
    diffColor := Color yellow lighter lighter.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2076
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2077
    "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
  2078
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2079
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2080
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2081
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2082
    codeView := aCodeView2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
    codeView addDependent: self.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2084
    codeView reallyModifiedChannel addDependent: self.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2085
    textView := aCodeView2 textView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2086
    textView addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2087
    textViewScroller := aCodeView2 textViewScroller.
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2088
    "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2089
    self viewBackground: (View defaultBackgroundColor).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2090
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2091
    "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
  2092
    "Modified: / 17-08-2011 / 15:15:55 / cg"
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2093
    "Modified: / 08-10-2011 / 11:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2094
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2095
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2096
!CodeView2::GutterView methodsFor:'queries'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2097
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2098
displayedString: line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2099
    "get text to display in gutter for specified list line number"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2100
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2101
    ^(line asString).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2102
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2103
    "Created: / 14-12-2009 / 13:37:47 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2104
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2105
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2106
lineColor:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2107
    "return special color for given line if required, nil otherwise"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2108
    "used only if lineFont return nil"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2109
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2110
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2111
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2112
    "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2113
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2114
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2115
lineDisplayable:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2116
    "true if this list line can be displayed"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2117
    ^(textView listLineIsVisible:line)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2118
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2119
    "Created: / 14-12-2009 / 13:38:23 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2120
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
lineFont:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2123
    "return special font for given line if required, nil otherwise"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2124
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2125
    ^nil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2126
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2127
    "Created: / 14-12-2009 / 14:40:17 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2128
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2129
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2130
yOfTextViewLine:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2131
    ^(textView yOfLine:line) + 1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2132
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2133
    "Created: / 14-12-2009 / 13:35:07 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2134
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2135
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2136
!CodeView2::GutterView methodsFor:'redrawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2137
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2138
redrawAcceptCancelBarX: x y: y width:w height:h
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2139
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2140
    | rw acceptBottom cancelBottom |
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
    x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2143
        ^self.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2144
    ].
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2145
    rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2146
    
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2147
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2148
    textView reallyModified ifFalse:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2149
        self fillRectangleX:x y:y width:rw height:h color: self viewBackground
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2150
    ] ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2151
        acceptBottom := self acceptButtonBottom.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2152
        cancelBottom := self cancelButtonBottom.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2153
        y < acceptBottom ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2154
            self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2155
        ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2156
        (y < cancelBottom) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2157
            self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2158
        ].  
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2159
        (y + h >= cancelBottom) ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2160
            self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2161
        ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2162
    
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2163
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2164
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2165
    "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
  2166
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2167
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2168
redrawBackgroundX:x y:y width:w height:h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2169
    "redraws gutter background"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2170
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2171
    "background is filled with background color"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2172
    self 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2173
        fillRectangleX:x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2174
        y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2175
        width:w
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2176
        height:h
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2177
        color: self viewBackground "backgroundPaint". 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2178
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2179
    "separator line is drawn with foreground color"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2180
    self 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2181
        displayLineFromX:(self width - 2)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2182
        y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2183
        toX:(self width - 2)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2184
        y:(y+h).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2185
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2186
    "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2187
    "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2188
    "Modified: / 17-08-2011 / 15:12:47 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2189
    "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
  2190
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2191
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2192
redrawLine:line 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2193
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2194
    ^self redrawLine:line cleared: false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2195
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2196
    "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
  2197
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2198
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2199
redrawLine:line cleared: cleared
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2200
    "redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2201
    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2202
    |lineString y0 textW requiredW oldFont newFont oldColor newColor|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2203
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2204
    lineString := self displayedString:line.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2205
    textW := (lineString widthOn:self).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2206
    requiredW := textW + self padding.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2207
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2208
    oldFont := self font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2209
    oldColor := self paint.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2210
    newFont := self lineFont:line.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2211
    newFont 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2212
        ifNotNil:[ self font:newFont. ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2213
        ifNil:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2214
            newColor := self lineColor:line.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2215
            newColor ifNotNil:[ self paint:newColor ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2216
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2217
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2218
    y0 := (self yOfTextViewLine:line) + ((self font) ascentOn:device).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2219
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2220
    cleared ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2221
        self clearRectangleX:0 y:y0 - font height width: self width - 2 height: font height + font descent.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2222
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2223
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2224
    "Let the services to draw annotations and other stuff"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2225
    codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2226
        drawLine:line in: self 
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2227
        atX: self paddingLeft + (widthAcceptCancel ? 0) y:y0 width: widthAnnotations height: font height
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2228
        from:nil to:nil with:self paint and: self backgroundColor.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2229
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2230
    self 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2231
        displayString:lineString
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2232
        x:(self width - textW - self paddingRight - widthDiffInfo)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2233
        y:y0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2234
    newFont 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2235
        ifNotNil:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2236
            self font:oldFont.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2237
            self paint:oldColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2238
        ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2239
        ifNil:[ newColor ifNotNil:[ self paint:oldColor ]. ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2240
    ^ requiredW.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2241
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2242
    "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2243
    "Created: / 17-06-2011 / 14:11:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2244
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2245
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2246
redrawLinesFrom:start
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2247
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2248
    start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2249
        self redrawLine:line cleared: false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2250
    ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2251
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2252
    "Created: / 06-07-2011 / 17:25:36 / jv"
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2253
    "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
  2254
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2255
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2256
redrawX:x y:y width:w height:h 
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2257
    | requiredW currentW |
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2258
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2259
    self redrawBackgroundX:x y:y width:w height:h.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2260
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2261
    codeView showAcceptCancelBar ifTrue:[    
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2262
        self redrawAcceptCancelBarX:x y:y width:w height:h.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2263
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2264
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2265
    firstLineShown := textView firstLineShown.
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2266
    lastLineShown := textView lastLineShown - 1 min: textView list size.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2267
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2268
    currentW := requiredW := self width.
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2269
    firstLineShown to:lastLineShown do:
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2270
        [:line | 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2271
        requiredW := requiredW max: (self redrawLine:line cleared: true)].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2272
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2273
    (requiredW > self width) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2274
        self corner:(requiredW @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2275
        textViewScroller origin:(requiredW @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2276
        self invalidate.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2277
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2278
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2279
    "Created: / 03-09-2009 / 08:22:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2280
    "Modified: / 14-12-2009 / 14:13:14 / Jindra <a>"
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  2281
    "Modified: / 10-10-2011 / 16:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2282
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2283
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2284
!CodeView2::TextView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2285
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2286
changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2287
    ^ changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2288
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2289
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2290
changedDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2291
    changedDiffText := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2292
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2293
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2294
changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2295
    ^ changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2296
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2297
    "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2298
    "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2299
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2300
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2301
changedLines:something 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2302
    changedLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2303
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2304
    "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2305
    "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2306
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2307
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2308
contents: text
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2309
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2310
    super contents: text.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2311
    reallyModifiedChannel value: false.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2312
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2313
    "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
  2314
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2315
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2316
deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2317
    ^  deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2318
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2319
    "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
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
deletedLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2323
deletedLines:=something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2324
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2325
    "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2326
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2327
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2328
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2329
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2330
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2331
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2332
diffMode:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2333
    diffMode := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2334
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2335
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2336
emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2337
    ^ emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2338
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2339
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2340
emptyLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2341
    emptyLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2342
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2343
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2344
insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2345
    ^  insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2346
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2347
    "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2348
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2349
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2350
insertedLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2351
insertedLines:=something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2352
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2353
    "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2354
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2355
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2356
modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2357
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2358
    super modifiedChannel: aValueHolder
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2359
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2360
    "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
  2361
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  2362
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2363
originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2364
    ^ originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2365
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2366
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2367
originDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2368
    originDiffText := something.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2369
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2370
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2371
reallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2372
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2373
    ^self reallyModifiedChannel value
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2374
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2375
    "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
  2376
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2377
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2378
!CodeView2::TextView methodsFor:'accessing - colors'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2379
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2380
colorChanged
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2381
    ^ Color redByte:240 greenByte: 192 blueByte: 192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2382
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2383
    "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
  2384
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2385
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2386
colorDeleted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2387
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2388
    ^ self colorInserted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2389
    "/^ Color pink
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2390
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2391
    "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
  2392
    "Modified (format): / 07-10-2011 / 20:26:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2393
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2394
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2395
colorInserted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2396
    ^ Color redByte: 239 greenByte: 225 blueByte: 152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2397
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2398
    "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
  2399
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2400
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2401
!CodeView2::TextView methodsFor:'accessing-contents'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2402
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2403
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2404
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2405
    super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2406
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2407
    reallyModifiedChannel value: false.
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2408
    self notifyLinesModifiedFrom: 1 to: list size.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2409
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2410
    "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2411
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2412
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2413
setList:aCollection expandTabs:expandTabs redraw:doRedraw
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2414
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2415
    super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2416
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2417
    reallyModifiedChannel value: false.
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  2418
    self notifyLinesModifiedFrom: 1 to: list size.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2419
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2420
    "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2421
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2422
10785
vrany
parents: 10784
diff changeset
  2423
!CodeView2::TextView methodsFor:'accessing-state'!
vrany
parents: 10784
diff changeset
  2424
vrany
parents: 10784
diff changeset
  2425
beUnmodified
vrany
parents: 10784
diff changeset
  2426
vrany
parents: 10784
diff changeset
  2427
    self modifiedChannel value: false.
vrany
parents: 10784
diff changeset
  2428
    reallyModifiedChannel value: false.
vrany
parents: 10784
diff changeset
  2429
    listOriginal := list copy.
vrany
parents: 10784
diff changeset
  2430
vrany
parents: 10784
diff changeset
  2431
    "Created: / 08-10-2011 / 12:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2432
!
vrany
parents: 10784
diff changeset
  2433
vrany
parents: 10784
diff changeset
  2434
isModified
vrany
parents: 10784
diff changeset
  2435
vrany
parents: 10784
diff changeset
  2436
    ^self modified
vrany
parents: 10784
diff changeset
  2437
vrany
parents: 10784
diff changeset
  2438
    "Created: / 08-10-2011 / 12:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2439
!
vrany
parents: 10784
diff changeset
  2440
vrany
parents: 10784
diff changeset
  2441
isReallyModified
vrany
parents: 10784
diff changeset
  2442
vrany
parents: 10784
diff changeset
  2443
    ^self reallyModified
vrany
parents: 10784
diff changeset
  2444
vrany
parents: 10784
diff changeset
  2445
    "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  2446
! !
vrany
parents: 10784
diff changeset
  2447
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2448
!CodeView2::TextView methodsFor:'channels'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2449
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2450
reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2451
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2452
    ^ reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2453
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2454
    "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
  2455
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2456
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2457
reallyModifiedChannel: aValueModel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2458
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2459
    |prev|
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2460
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2461
    prev := reallyModifiedChannel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2462
    prev notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2463
        gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2464
            reallyModifiedChannel removeDependent: gutterView.
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
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2467
    reallyModifiedChannel := aValueModel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2468
    self setupChannel:aValueModel for:nil withOld:prev.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2469
    gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2470
        reallyModifiedChannel addDependent: gutterView.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2471
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2472
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2473
    "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
  2474
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2475
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2476
!CodeView2::TextView methodsFor:'drawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2477
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2478
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2479
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2480
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2481
        drawFromVisibleLine:startVisLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2482
        to:endVisLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2483
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2484
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2485
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2486
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2487
    "Created: / 05-04-2010 / 12:08:38 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2488
    "Modified: / 02-05-2010 / 18:46:04 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2489
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2490
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2491
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2492
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2493
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2494
        drawLine:line
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2495
        fromX:x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2496
        inVisible:visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2497
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2498
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2499
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2500
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2501
    "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2502
    "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2503
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2504
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2505
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2506
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2507
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2508
        drawLine:lineStringArg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2509
        inVisible:visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2510
        col:col
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2511
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2512
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2513
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2514
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2515
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2516
    "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2517
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2518
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2519
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2520
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2521
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2522
        drawLine:lineStringArg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2523
        inVisible:visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2524
        from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2525
        to:endColOrNil
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2526
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2527
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2528
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2529
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2530
    "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2531
    "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2532
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2533
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2534
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2535
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2536
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2537
        drawLine:lineString
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2538
        inVisible:visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2539
        from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2540
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2541
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2542
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2543
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2544
    "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2545
    "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2546
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2547
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2548
drawVisibleLine:visLineNr with:fg and:bg 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2549
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2550
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2551
        drawVisibleLine:visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2552
        with:fg
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2553
        and:bg.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2554
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2555
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2556
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2557
    "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2558
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2559
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2560
redraw
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2561
    "/ thisContext fullPrintAll.   
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2562
    super redraw.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2563
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2564
    "Created: / 30-06-2011 / 11:04:32 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2565
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2566
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2567
redrawLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2568
    |i pom|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2569
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2570
    diffMode ifFalse:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2571
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2572
    pom := self hasSelection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2573
    (pom) ifTrue:[ ^ self. ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2574
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2575
    [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2576
        i <= (deletedLines size)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2577
    ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2578
        ((deletedLines at:i) > 0) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2579
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2580
                drawVisibleLine:(deletedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2581
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2582
                and:self colorDeleted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2583
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2584
        i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2585
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2586
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2587
    [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2588
        i <= (insertedLines size)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2589
    ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2590
        ((insertedLines at:i) > 0) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2591
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2592
                drawVisibleLine:(insertedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2593
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2594
                and:self colorInserted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2595
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2596
        i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2597
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2598
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2599
    [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2600
        i <= (changedLines size)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2601
    ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2602
        ((changedLines at:i) > 0) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2603
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2604
                drawVisibleLine:(changedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2605
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2606
                and:self colorChanged.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2607
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2608
        i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2609
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2610
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2611
    "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2612
    "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2613
    "Modified: / 08-04-2011 / 20:52:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2614
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2615
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2616
!CodeView2::TextView methodsFor:'editing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2617
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2618
contentsChanged
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2619
    super contentsChanged.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2620
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2621
    codeView diffMode ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2622
        changedDiffText ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2623
            codeView recomputeDiff:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2624
        ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2625
            changedDiffText := true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2626
        ].  
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2627
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2628
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2629
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2630
    "Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2631
    "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
  2632
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2633
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2634
deleteCharBeforeCursor
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2635
    "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
  2636
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2637
    "BIG FAT WARNING: This method is copied from TextEditView,
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2638
    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
  2639
    before the patch will be pushed up"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2640
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2641
    |soCol wasOn lineNrAboveCursor ln prevTab|
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2642
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2643
    wasOn := self hideCursor.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2644
    autoIndent ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2645
        prevTab := (self prevTabBefore:cursorCol) max:1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2646
        "JV@2011-12-10: The list can be shorter that cursorLine,
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2647
         trailing because empty lines are not physically in the list."
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2648
        (list size >= cursorLine) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2649
            ln := (list at:cursorLine) ? ''.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2650
        ] ifFalse:[        
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2651
            ln := ''.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2652
        ].    
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2653
        ln size < prevTab ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2654
            ln := ln , (String new:prevTab withAll:Character space).
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2655
        ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2656
        (ln copyTo:prevTab) isBlank ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2657
            (ln copyFrom:prevTab+1) isBlank ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2658
                cursorCol > prevTab ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2659
                    self cursorLine:cursorLine col:prevTab.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2660
                    wasOn ifTrue:[ self showCursor ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2661
                    ^  self
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2662
                ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2663
            ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2664
                self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2665
                self cursorLine:cursorLine col:prevTab.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2666
                wasOn ifTrue:[ self showCursor ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2667
                ^  self.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2668
            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2669
        ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2670
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2671
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2672
"/        (autoIndent
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2673
"/    and:[cursorCol  ~~ 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2674
"/    and:[cursorLine <= (list size)]])
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2675
"/     ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2676
"/        soCol := (self leftIndentForLine:cursorLine) + 1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2677
"/
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2678
"/        (cursorCol == soCol and:[soCol > 1]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2679
"/            ln := list at:cursorLine.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2680
"/            (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2681
"/                soCol := 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2682
"/            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2683
"/        ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2684
"/    ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2685
        soCol := 1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2686
"/    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2687
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2688
    (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2689
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2690
         somewhere in the middle of a line
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2691
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2692
        self cursorLeft.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2693
        self deleteCharAtLine:cursorLine col:cursorCol.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2694
    ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2695
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2696
         at begin of line - merge with previous line;
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2697
         except for the very first line.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2698
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2699
        (cursorLine == 1) ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2700
            lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2701
            lineNrAboveCursor < cursorLine ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2702
                (lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2703
                    "/ we are beyond the end of the text.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2704
                    "/ move the cursor to the previous line.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2705
                    self cursorLine:lineNrAboveCursor col:1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2706
                ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2707
                    self mergeLine:lineNrAboveCursor removeBlanks:false.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2708
                ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2709
            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2710
        ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2711
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2712
    wasOn ifTrue:[ self showCursor ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2713
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2714
    "Modified: / 16-01-1998 / 22:33:04 / cg"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2715
    "Modified (comment): / 10-12-2011 / 13:43:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2716
!
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  2717
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2718
getNewOriginText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2719
    |i size pole pom text helperText|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2720
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2721
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2722
    pole := list.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2723
    size := list size.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2724
    text:=''.
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  2725
    emptyLines isNil ifTrue:[emptyLines := #()].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2726
    [ i <= size ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2727
        pom := emptyLines indexOf:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2728
        (pom = 0) ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2729
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2730
            (helperText = '') ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2731
                (helperText isNil)ifTrue:[helperText:=''].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2732
                helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2733
                text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2734
            ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2735
        ] ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2736
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2737
            (helperText isNil)ifTrue:[helperText:=''].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2738
            helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2739
            text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2740
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2741
    i:=i+1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2742
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2743
^text
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2744
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2745
    "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2746
    "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
  2747
    "Modified: / 18-11-2011 / 14:58:22 / 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
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2750
!CodeView2::TextView methodsFor:'editing-basic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2751
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2752
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
  2753
    "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
  2754
10731
5904065850c6 Fixed notification in #basicDeleteChars...
vrany
parents: 10728
diff changeset
  2755
    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
  2756
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2757
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2758
    "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
  2759
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2760
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2761
basicDeleteFromLine:startLineNr toLine:endLineNr 
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2762
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2763
    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
  2764
    self notifyLinesDeletedFrom:startLineNr to:endLineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2765
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2766
    "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
  2767
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2768
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2769
basicDeleteLineWithoutRedraw:lineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2770
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2771
    super basicDeleteLineWithoutRedraw:lineNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2772
    self notifyLinesDeletedFrom: lineNr to: lineNr.
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
    "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
  2775
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2776
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2777
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
  2778
    "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
  2779
     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
  2780
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2781
    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
  2782
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2783
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2784
    "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
  2785
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2786
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2787
basicMergeLine:lineNr removeBlanks:removeBlanks
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2788
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2789
    super basicMergeLine:lineNr removeBlanks:removeBlanks.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2790
    self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2791
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2792
    "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
  2793
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2794
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2795
basicSplitLine:lineNr before:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2796
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2797
    super basicSplitLine:lineNr before:colNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  2798
    self notifyLinesInsertedFrom: lineNr +1 to: lineNr + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2799
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2800
    "Created: / 28-06-2011 / 09:14:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2801
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2802
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2803
!CodeView2::TextView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2804
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2805
buttonMotion:button x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2806
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2807
    (codeView buttonMotion:button x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2808
        ifFalse:[super buttonMotion:button x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2809
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2810
    "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
  2811
    "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
  2812
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2813
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2814
buttonPress: button x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2815
    | ctrlDown  |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2816
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2817
    (codeView buttonPress:button x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2818
        ifFalse:[super buttonPress:button x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2819
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2820
    ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil]) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2821
        ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2822
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2823
        buttonPress: button
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2824
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2825
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2826
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2827
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2828
    "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
  2829
    "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
  2830
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2831
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2832
exposeX:x y:y width:w height:h 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2833
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2834
        exposeX:x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2835
        y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2836
        width:w
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2837
        height:h.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2838
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2839
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2840
    "Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2841
    "Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2842
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2843
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2844
keyPress:key x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2845
    (codeView keyPress:key x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2846
        ifFalse:[super keyPress:key x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2847
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2848
    "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
  2849
    "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2850
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2851
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2852
keyRelease: key x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2853
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2854
    (codeView keyRelease:key x:x y:y in: self)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2855
        ifFalse:[super keyRelease:key x:x y:y].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2856
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2857
    (key = #Control_L) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2858
        [ codeView highlightClear. self redraw ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2859
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2860
    ^ super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2861
        keyRelease: key
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2862
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2863
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2864
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2865
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2866
    "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
  2867
    "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
  2868
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2869
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2870
!CodeView2::TextView methodsFor:'formatting'!
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2871
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2872
leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2873
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2874
    | lang |
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2875
    lang := codeView language.
10973
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  2876
    "Bit hacky here, should ask language some language toolbox
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  2877
    for formatting helper, that should do it..."
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  2878
    (lang notNil and:[lang isSmalltalk]) ifTrue:[
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2879
        | line lineNo indent |
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2880
        lineNo := lineNr.    
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2881
        [lineNo ~~ 1] whileTrue:[
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2882
            lineNo  := lineNo - 1.
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2883
            line := self listAt:lineNo.
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2884
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2885
            line notNil ifTrue:[
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2886
                indent := line indexOfNonSeparatorStartingAt:1.
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2887
                "beggining od block"
10972
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2888
                line notEmptyOrNil ifTrue:[
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2889
                    line last == $[ ifTrue:[
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2890
                        indent := indent + 4.
10972
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2891
                    ] ifFalse:[
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2892
                        "end of block args"
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2893
                        (line last == $| and: [line includes: $[]) ifTrue:[
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2894
                            indent := indent + 4.
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2895
                        ]   
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2896
                    ].        
7f13cb6e9a93 Fixed leftIndent...
vrany
parents: 10971
diff changeset
  2897
                ].
10970
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2898
                indent ~~ 0 ifTrue:[
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2899
                ^ indent - 1
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2900
                ]
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2901
            ]            
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2902
        ].
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2903
        ^0.
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2904
    ].
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2905
    ^super leftIndentForLine:lineNr
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2906
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2907
    "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
  2908
! !
dc9da0fc38ef Small improvement for auto-indent (when enabled, not by default)
vrany
parents: 10967
diff changeset
  2909
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2910
!CodeView2::TextView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2911
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2912
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2913
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2914
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2915
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2916
    changedDiffText := true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2917
    diffMode := false.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2918
    suppressNotifications := false.
10523
ff18a902b162 Added preference for auto indent
vrany
parents: 10496
diff changeset
  2919
    autoIndent := UserPreferences current codeView2AutoIndent.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2920
    reallyModifiedChannel := false asValue.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2921
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  2922
    self enableMotionEvents.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  2923
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2924
    "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
  2925
    "Modified: / 06-07-2011 / 17:46:31 / jv"
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  2926
    "Modified: / 21-08-2011 / 10:09:29 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2927
    "Modified: / 07-10-2011 / 19:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2928
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2929
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2930
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2931
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2932
    codeView := aCodeView2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2933
    codeView addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2934
    gutterView := aCodeView2 gutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2935
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2936
    "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
  2937
    "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
  2938
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2939
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2940
setGutterView: aGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2941
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2942
    self assert: gutterView isNil message:'Attempting to set gutterView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2943
    gutterView := aGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2944
    gutterView setTextView: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2945
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2946
    "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
  2947
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2948
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2949
!CodeView2::TextView methodsFor:'menu & menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2950
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2951
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2952
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2953
    super accept.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2954
    reallyModifiedChannel value: false.
10785
vrany
parents: 10784
diff changeset
  2955
    listOriginal := list copy.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2956
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2957
    "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
  2958
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2959
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2960
cancel
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2961
10785
vrany
parents: 10784
diff changeset
  2962
    self list: listOriginal
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2963
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2964
    "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
  2965
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  2966
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2967
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2968
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2969
    ^codeView editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2970
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2971
    "Created: / 14-02-2010 / 15:49:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2972
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2973
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2974
!CodeView2::TextView methodsFor:'notification'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2975
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2976
notifyLinesDeletedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2977
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2978
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2979
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2980
    codeView linesDeletedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2981
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2982
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2983
    "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
  2984
    "Modified: / 06-07-2011 / 17:47:05 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2985
    "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
  2986
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2987
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2988
notifyLinesInsertedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2989
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2990
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2991
    suppressNotifications ifTrue:[^self].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2992
    codeView linesInsertedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2993
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  2994
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2995
    "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
  2996
    "Modified: / 06-07-2011 / 17:47:20 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2997
    "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
  2998
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  2999
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3000
notifyLinesModifiedFrom: startLine to: endLine
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3001
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3002
    self updateReallyModified.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3003
    suppressNotifications ifTrue:[^self].
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3004
    codeView linesModifiedFrom: startLine to: endLine.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3005
    suppressNotifications := true.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3006
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  3007
    "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
  3008
    "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
  3009
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3010
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3011
!CodeView2::TextView methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3012
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3013
superEditMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3014
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3015
    ^super editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3016
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3017
    "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
  3018
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3019
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3020
updateReallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3021
    "check for modified code by comparing the source against
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3022
     the codeViews contents.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3023
     Thats the true modified value (in case user undid its changes,
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3024
     and the displayed text is actually original"
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3025
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3026
    |modified changedSource originalSource|
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3027
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3028
    reallyModifiedChannel isNil ifTrue:[^self].
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3029
    "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
  3030
     interested. Not sure if it is a good idea, thought."
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3031
    reallyModifiedChannel dependents isEmptyOrNil ifTrue:[^self].
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3032
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3033
    "/ 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
  3034
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3035
    modified := false.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3036
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3037
    list size ~~ listOriginal size ifTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3038
        modified := true.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3039
    ] ifFalse:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3040
        changedSource := list ? #().
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3041
        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3042
        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3043
            changedSource := changedSource removeLast.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3044
        ].
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3045
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3046
        originalSource := listOriginal ? #() "self model value ? ''".
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3047
        originalSource := originalSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3048
        [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3049
            originalSource := originalSource removeLast
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3050
        ].
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3051
        originalSource size ~~ changedSource size ifTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3052
            modified := true.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3053
        ] ifFalse:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3054
            | i s |
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3055
            i := 1.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3056
            s := originalSource size + 1.            
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3057
            [ modified not and:[ i < s ] ] whileTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3058
                | originalL changedL |
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3059
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3060
                originalL := ((originalSource at: i) ? '') string.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3061
                changedL :=  ((changedSource  at: i) ? '') string.                
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3062
                originalL ~= changedL ifTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3063
                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3064
                        modified := true.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3065
                    ]
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3066
                ].
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3067
                i := i + 1.
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3068
            ]
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3069
        ]
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3070
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3071
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3072
    reallyModifiedChannel value: modified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3073
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3074
    "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
  3075
    "Modified: / 08-10-2011 / 11:10:01 / cg"
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  3076
    "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
  3077
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3078
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3079
!CodeView2::TextView methodsFor:'scrolling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3080
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3081
basicScrollDown:nLines 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3082
    |i|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3083
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3084
    (lastFirstLine isNil) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3085
        lastFirstLine := firstLineShown.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3086
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3087
    super scrollDown:nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3088
    (lastFirstLine = firstLineShown) ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3089
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3090
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3091
            i <= changedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3092
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3093
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3094
                drawVisibleLine:(changedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3095
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3096
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3097
            changedLines at:i put:(changedLines at:i) - nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3098
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3099
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3100
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3101
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3102
            i <= insertedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3103
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3104
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3105
                drawVisibleLine:(insertedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3106
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3107
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3108
            insertedLines at:i put:(insertedLines at:i) - nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3109
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3110
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3111
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3112
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3113
            i <= deletedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3114
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3115
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3116
                drawVisibleLine:(deletedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3117
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3118
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3119
            deletedLines at:i put:(deletedLines at:i) - nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3120
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3121
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3122
        lastFirstLine := firstLineShown.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3123
        self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3124
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3125
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3126
    "Created: / 06-04-2010 / 14:03:28 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3127
    "Modified: / 02-05-2010 / 19:29:23 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3128
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3129
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3130
basicScrollUp:nLines 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3131
    |i|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3132
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3133
    (scrolled isNil) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3134
        scrolled := false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3135
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3136
    (lastFirstLine isNil) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3137
        lastFirstLine := firstLineShown.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3138
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3139
    super scrollUp:nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3140
    (lastFirstLine = firstLineShown) ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3141
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3142
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3143
            i <= insertedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3144
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3145
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3146
                drawVisibleLine:(insertedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3147
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3148
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3149
            insertedLines at:i put:(insertedLines at:i) + nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3150
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3151
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3152
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3153
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3154
            i <= deletedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3155
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3156
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3157
                drawVisibleLine:(deletedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3158
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3159
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3160
            deletedLines at:i put:(deletedLines at:i) + nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3161
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3162
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3163
        i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3164
        [
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3165
            i <= changedLines size
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3166
        ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3167
            super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3168
                drawVisibleLine:(changedLines at:i)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3169
                with:fgColor
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3170
                and:Color white.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3171
            changedLines at:i put:(changedLines at:i) + nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3172
            i := i + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3173
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3174
        lastFirstLine := firstLineShown.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3175
        self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3176
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3177
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3178
    "Created: / 06-04-2010 / 14:03:46 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3179
    "Modified: / 02-05-2010 / 19:19:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3180
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3181
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3182
originChanged:delta
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3183
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3184
    super originChanged:delta.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3185
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3186
    gutterView invalidate.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3187
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3188
    "Created: / 07-12-2009 / 21:50:49 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3189
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3190
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3191
scrollDown:nLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3193
    codeView scrollDown: nLines in: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3194
    self basicScrollDown: nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3195
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3196
    "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3197
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3198
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3199
scrollUp:nLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3200
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3201
    codeView scrollUp: nLines in: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3202
    self basicScrollUp: nLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3203
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3204
    "Modified: / 06-04-2010 / 14:05:40 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3205
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3206
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3207
!CodeView2::TextView methodsFor:'undo & again'!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3208
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3209
nonUndoableDo: aBlock
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3210
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3211
    super nonUndoableDo: aBlock.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3212
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3213
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3214
    "Created: / 06-07-2011 / 17:48:27 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3215
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3216
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3217
undoableDo: aBlock info: into
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3218
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3219
    super undoableDo: aBlock info: into.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3220
    suppressNotifications := false.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3221
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3222
    "Created: / 06-07-2011 / 17:48:49 / jv"
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3223
! !
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3224
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3225
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3226
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3227
version
10973
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3228
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.44 2011-12-14 11:11:23 vrany Exp $'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3229
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  3230
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3231
version_CVS
10973
44ccdbc1fb0a fix in #leftIndentForLine: for view with nil language
vrany
parents: 10972
diff changeset
  3232
    ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.44 2011-12-14 11:11:23 vrany Exp $'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3233
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3234
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3235
version_SVN
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3236
    ^ '§Id: Tools__CodeView2.st 7797 2011-06-28 07:45:06Z vranyj1 §'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3237
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3238
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3239
CodeView2 initialize!