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