Tools__CodeView2.st
author Claus Gittinger <cg@exept.de>
Mon, 20 Jan 2020 21:02:47 +0100
changeset 19422 c6ca1c3e0fd7
parent 19369 52d2aa01b22f
child 19473 fbb9a49e80e0
permissions -rw-r--r--
#REFACTORING by exept class: MultiViewToolApplication added: #askForFile:default:forSave:thenDo: changed: #askForFile:default:thenDo: #askForFile:thenDo: #menuSaveAllAs #menuSaveAs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
     1
"{ Encoding: utf8 }"
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
     2
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     4
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     5
              All Rights Reserved
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     6
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     7
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     8
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
     9
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    10
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    11
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    12
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    13
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    14
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    15
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    16
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    17
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    18
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    19
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    20
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    21
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    22
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    23
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    24
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    25
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
    26
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ Package: 'stx:libtool' }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
"{ NameSpace: Tools }"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
SimpleView subclass:#CodeView2
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    33
	instanceVariableNames:'gutterView textView textViewScroller methodHolder languageHolder
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    34
		classHolder browserHolder codeAspect modifiedChannel
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    35
		showGutterChannel showAcceptCancelBarChannel modeHolder services
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    36
		servicesFromClient syntaxElements currentParseNodeHolder
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    37
		currentBlockNodeHolder syntaxElementSelection highlightEmphasis
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
    38
		diffMode synchronizedCodeViews smallLintRulesHolder'
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    39
	classVariableNames:'TraceSelectors'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    40
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    41
	category:'Interface-CodeView'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    44
AbstractBackground subclass:#AnnotationShowingScrollerBackground
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
    45
	instanceVariableNames:'annotations breakpoints textView'
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    46
	classVariableNames:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    47
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    48
	privateIn:CodeView2
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    49
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
    50
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
SimpleView subclass:#GutterView
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    52
	instanceVariableNames:'codeView textView textViewScroller widthAcceptCancel
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    53
		widthAnnotations widthDiffInfo numberOfLines acceptColor
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    54
		cancelColor diffColor menuHolder currentBlockNodeHolder
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
    55
		showLineNumbers blockWaitingForPossibleDoubleClick compareAction
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
    56
		lineNrColor'
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
    57
	classVariableNames:'DefaultLineNrColor'
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    58
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    59
	privateIn:CodeView2
9985
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
CodeView subclass:#TextView
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    63
	instanceVariableNames:'listOriginal codeView gutterView diffMode deletedLines
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    64
		insertedLines lastFirstLine changedLines scrollInProgress
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    65
		originDiffText emptyLines changedDiffText suppressNotifications
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    66
		reallyModifiedChannel'
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    67
	classVariableNames:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    68
	poolDictionaries:''
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
    69
	privateIn:CodeView2
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
copyright
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
"
10072
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    76
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    77
              All Rights Reserved
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    78
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    79
Permission is hereby granted, free of charge, to any person
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    80
obtaining a copy of this software and associated documentation
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    81
files (the 'Software'), to deal in the Software without
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    82
restriction, including without limitation the rights to use,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    83
copy, modify, merge, publish, distribute, sublicense, and/or sell
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    84
copies of the Software, and to permit persons to whom the
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    85
Software is furnished to do so, subject to the following
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    86
conditions:
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    87
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    88
The above copyright notice and this permission notice shall be
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    89
included in all copies or substantial portions of the Software.
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    90
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    91
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    92
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    93
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    94
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    95
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    96
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
7ceb629b7d13 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10007
diff changeset
    97
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
    98
OTHER DEALINGS IN THE SOFTWARE.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
"
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   100
!
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   101
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   102
documentation
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   103
"
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   104
    documentation to be added.
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   105
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   106
    class:
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   107
        <a short class summary here, describing what instances represent>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   108
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   109
    responsibilities:    
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   110
        <describing what my main role is>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   111
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   112
    collaborators:    
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   113
        <describing with whom and how I talk to>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   114
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   115
    API:
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   116
        <public api and main messages>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   117
        
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   118
    example:
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   119
        <a one-line examples on how to use - can also be in a separate example method>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   120
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   121
    implementation:
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   122
        <implementation points>
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   123
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   124
    [author:]
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   125
        exept MBP
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   126
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   127
    [instance variables:]
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   128
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   129
    [class variables:]
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   130
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   131
    [see also:]
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   132
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   133
"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
!CodeView2 class methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    "Invoked at system start or when the class is dynamically loaded."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "/ please change as required (and remove this comment)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    TraceSelectors := IdentitySet new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    "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
   146
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
!CodeView2 class methodsFor:'debugging'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
trace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
    TraceSelectors add: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    "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
   155
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
untrace: aSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    TraceSelectors remove: aSelector ifAbsent:[]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "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
   162
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
untraceAll
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
    TraceSelectors := IdentitySet new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    "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
   169
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
!CodeView2 class methodsFor:'examples'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
example1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    | window codeView |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    window := StandardSystemView new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    window extent: 300 @ 300.              
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    window label: 'CodeView2 example1'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
    codeView := Tools::CodeView2 in: window.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
        origin: 0.1 @ 0.1
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
        corner: 0.9 @ 0.9.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    window open.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
    "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
   191
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
!CodeView2 class methodsFor:'menu specs'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   195
debugMenu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   196
    "This resource specification was automatically generated
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   197
     by the MenuEditor of ST/X."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   198
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   199
    "Do not manually edit this!! If it is corrupted,
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   200
     the MenuEditor may not be able to read the specification."
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   201
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   202
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   203
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   204
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   205
    "
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   206
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   207
    <resource: #menu>
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   208
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   209
    ^ 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   210
     #(Menu
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   211
              (
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   212
               (MenuItem
16613
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   213
                  label: 'Inspect View'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   214
                  itemValue: inspectView
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   215
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   216
                )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   217
               (MenuItem
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   218
                  label: 'Inspect Syntax Elements'
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   219
                  itemValue: inspectSyntaxElements
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   220
                  translateLabel: true
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   221
                )
18796
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   222
               (MenuItem
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   223
                  label: 'Inspect Breakpoints'
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   224
                  itemValue: inspectBreakpoints
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   225
                  isVisible: hasBreakpointService
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   226
                  enabled: hasBreakpoints
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   227
                  translateLabel: true
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   228
                )
16613
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   229
"/               (MenuItem
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   230
"/                  label: 'Inspect Selected Selector'
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   231
"/                  itemValue: inspectSelectedSelector
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   232
"/                  translateLabel: true
4e8ed0268ad4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16607
diff changeset
   233
"/                )
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   234
               )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   235
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   236
              nil
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   237
            )
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   238
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   239
    "Created: / 08-07-2011 / 13:36:02 / cg"
18796
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
   240
    "Modified: / 29-05-2019 / 14:55:03 / Claus Gittinger"
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   241
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
   242
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "This resource specification was automatically generated
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
     by the MenuEditor of ST/X."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    "Do not manually edit this!! If it is corrupted,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
     the MenuEditor may not be able to read the specification."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   255
    UserPreferences current eclipseStyleMenus ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   256
        ^ self editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   257
    ].
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   258
    ^ self editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   259
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   260
    "Modified: / 08-07-2011 / 13:23:35 / cg"
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   261
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   262
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   263
editMenu_eclipseStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   264
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   265
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   266
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   267
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   268
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   269
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   270
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   271
    "
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   272
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_eclipseStyle
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   273
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   274
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   275
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    <resource: #menu>
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   278
    ^
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
     #(Menu
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   280
        (
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   281
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   282
            label: 'Implementors...'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   283
            itemValue: browseImplementorsOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   284
            submenuChannel: implementorsMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   285
            shortcutKey: ImplementorsOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   286
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   287
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   288
            label: 'Senders...'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   289
            itemValue: browseSendersOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   290
            submenuChannel: sendersMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   291
            shortcutKey: SendersOfIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   292
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   293
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   294
            label: 'Refactor'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   295
            nameKey: refactor
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   296
            isVisible: false
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   297
            shortcutKey: Shift
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   298
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   299
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   300
            label: '-'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   301
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   302
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   303
            label: 'Accept'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   304
            itemValue: accept
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   305
            shortcutKey: Accept
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   306
            enabled: canAccept
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   307
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   308
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   309
            label: '-'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   310
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   311
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   312
            label: 'Cut'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   313
            itemValue: cut
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   314
            shortcutKey: Cut
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   315
            enabled: canCut
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   316
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   317
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   318
            label: 'Copy'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   319
            itemValue: copySelection
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   320
            shortcutKey: Copy
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   321
            enabled: hasSelectionForCopy
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   322
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   323
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   324
            label: 'Paste'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   325
            itemValue: pasteOrReplace
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   326
            shortcutKey: Paste
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   327
            enabled: isNotReadOnly
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   328
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   329
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   330
            label: '-'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   331
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   332
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   333
            label: 'Undo'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   334
            itemValue: undo
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   335
            shortcutKey: Undo
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   336
            enabled: hasUndoAction
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   337
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   338
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   339
            label: 'Redo'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   340
            itemValue: redo
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   341
            shortcutKey: Redo
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   342
            enabled: hasRedoAction
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   343
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   344
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   345
            label: '-'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   346
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   347
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   348
            label: 'Do it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   349
            itemValue: doIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   350
            shortcutKey: DoIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   351
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   352
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   353
            label: 'Print it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   354
            itemValue: printIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   355
            shortcutKey: PrintIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   356
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   357
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   358
            label: 'Inspect it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   359
            itemValue: inspectIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   360
            shortcutKey: InspectIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   361
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   362
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   363
            label: 'Profile it'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   364
            itemValue: profileIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   365
            shortcutKey: InspectIt
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   366
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   367
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   368
            label: '-'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   369
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   370
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   371
            label: 'Show Gutter'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   372
            nameKey: ShowGutter
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   373
            indication: showGutterChannel
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   374
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   375
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   376
            label: 'More'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   377
            nameKey: More
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   378
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   379
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   380
            label: 'Services'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   381
            submenuChannel: servicesMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   382
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   383
         (MenuItem
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   384
            label: 'Debug'
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   385
            submenuChannel: debugMenu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   386
          )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   387
         )
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   388
        nil
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
   389
        nil
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   390
      )
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   391
!
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   392
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   393
editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   394
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   395
     by the MenuEditor of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   396
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   397
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   398
     the MenuEditor may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   399
11241
e3d6bdc7a790 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11220
diff changeset
   400
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   401
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   402
     MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   403
     (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   404
    "
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   405
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   406
    <resource: #menu>
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   407
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   408
    ^ 
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   409
     #(Menu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   410
        (
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   411
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   412
            label: 'Undo'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   413
            itemValue: undo
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   414
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   415
            shortcutKey: Undo
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   416
            enabled: hasUndoAction
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   417
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   418
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   419
            label: 'Again'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   420
            itemValue: again
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   421
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   422
            shortcutKey: Again
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   423
            enabled: canDoAgain
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   424
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   425
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   426
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   427
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   428
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   429
            label: 'Cut'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   430
            itemValue: cut
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   431
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   432
            shortcutKey: Cut
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   433
            enabled: canCut
10290
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: 'Copy'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   437
            itemValue: copySelection
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   438
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   439
            shortcutKey: Copy
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   440
            enabled: hasSelectionForCopy
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   441
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   442
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   443
            label: 'Paste'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   444
            itemValue: pasteOrReplace
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   445
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   446
            shortcutKey: Paste
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   447
            enabled: isNotReadOnly
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   448
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   449
         (MenuItem
18518
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   450
            label: 'Paste...'
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   451
            itemValue: pasteOrReplaceFromHistory
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   452
            translateLabel: true
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   453
            shortcutKey: PasteFromHistory
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   454
            enabled: isNotReadOnly
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   455
          )
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   456
         (MenuItem
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   457
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   458
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   459
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   460
            label: 'DoIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   461
            itemValue: doIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   462
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   463
            shortcutKey: DoIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   464
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   465
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   466
            label: 'PrintIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   467
            itemValue: printIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   468
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   469
            shortcutKey: PrintIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   470
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   471
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   472
            label: 'InspectIt'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   473
            itemValue: inspectIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   474
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   475
            shortcutKey: InspectIt
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   476
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   477
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   478
            label: '-'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   479
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   480
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   481
            label: 'Accept'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   482
            itemValue: accept
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   483
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   484
            shortcutKey: Accept
14997
df3528dd1c58 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14992
diff changeset
   485
            enabled: canAccept
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   486
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   487
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   488
            label: '-'
11353
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   489
            isVisible: false
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   490
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   491
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   492
            label: 'Refactor'
11311
15a2965ceba2 changed:
Claus Gittinger <cg@exept.de>
parents: 11241
diff changeset
   493
            nameKey: refactor
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   494
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   495
            isVisible: false
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   496
            shortcutKey: Shift
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   497
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   498
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   499
            label: 'Services'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   500
            translateLabel: true
11241
e3d6bdc7a790 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11220
diff changeset
   501
            isVisible: false
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   502
            submenuChannel: servicesMenu
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   503
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   504
         (MenuItem
11353
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   505
            label: '='
10290
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   506
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   507
         (MenuItem
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   508
            label: 'More'
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   509
            nameKey: More
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   510
            translateLabel: true
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   511
            shortcutKey: Ctrl
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   512
          )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   513
         )
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   514
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   515
        nil
Claus Gittinger <cg@exept.de>
parents: 10262
diff changeset
   516
      )
11353
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   517
5cb468550ad2 changed: #editMenu_stxStyle
Claus Gittinger <cg@exept.de>
parents: 11311
diff changeset
   518
    "Modified: / 02-03-2012 / 19:53:19 / cg"
18518
56d43f5e3ca4 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18516
diff changeset
   519
    "Modified: / 09-11-2018 / 10:38:35 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   520
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   521
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   522
!CodeView2 methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   523
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   524
acceptAction:aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   525
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   526
    textView acceptAction: aBlock
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   528
    "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
   529
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   530
16968
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   531
acceptEnabled:aBoolean
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   532
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   533
    textView acceptEnabled:aBoolean
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   534
!
db7d639de0e8 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 16910
diff changeset
   535
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   536
breakpoints
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   537
    |s|
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   538
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   539
    (s := self breakpointService) notNil ifTrue:[
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
   540
        ^ s breakpoints
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   541
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   542
    ^ nil
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   543
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   544
    "Created: / 06-07-2011 / 18:05:35 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   545
    "Modified: / 06-10-2011 / 14:13:53 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   546
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
   547
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   548
browser
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   549
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   550
    ^self browserHolder value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   551
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   552
    "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
   553
!
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   554
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
codeAspect
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   556
    ^ textView codeAspect
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   557
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   558
    "Modified: / 27-07-2012 / 22:22:27 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   559
    "Modified: / 27-09-2013 / 10:01:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   562
codeAspect: aSymbol
14638
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   563
    "tell the textView what is shown, so it can adjust the
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   564
     syntaxhighlighter.
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   565
     See SyntaxHighlighter codeAspectXXX for possible aspects."
7c401f3a4d9b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14632
diff changeset
   566
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   567
    ^ textView codeAspect: aSymbol
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   568
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   569
    "Modified: / 27-07-2012 / 22:32:19 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
   570
    "Modified: / 27-09-2013 / 10:01:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   573
compareAction:aBlock
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   574
    gutterView notNil ifTrue:[
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   575
        gutterView compareAction:aBlock
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   576
    ].
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   577
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   578
    "Created: / 27-04-2018 / 16:52:47 / stefan"
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   579
!
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
   580
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   581
compilerClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   582
    ^textView compilerClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   583
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   584
    "Created: / 10-05-2012 / 23:47:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   585
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   586
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   587
compilerClass: aClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   588
    textView compilerClass: aClass
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   589
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   590
    "Created: / 10-05-2012 / 23:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   591
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   592
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   595
    ^textView contents
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   596
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
    "Created: / 14-02-2010 / 22:13:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   599
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
contents: aStringOrStringCollection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   602
    textView contents: aStringOrStringCollection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   603
    "/self update:#value with: aStringOrStringCollection from: textView model
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   604
10330
212b120c198f Improvements in diffing tools
vrany
parents: 10326
diff changeset
   605
    "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
   606
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   607
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   608
contents: aStringOrStringCollection clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   609
    "Set the contents. If clearPrevous is true, then
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   610
     previous original text is cleared and set to given one.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   611
     (so the text is considered not modified)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   612
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   613
    textView contents: aStringOrStringCollection clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   614
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   615
    "Modified: / 19-07-2011 / 13:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   616
    "Created: / 17-02-2012 / 00:33:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   617
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   618
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   619
currentParseNode
14101
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   620
    |sel|
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   621
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   622
    sel := self syntaxElementSelection.
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   623
    sel isNil ifTrue:[^ nil].
ee267ce43178 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14057
diff changeset
   624
    ^ sel node
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   625
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   626
    "Created: / 21-02-2012 / 14:20:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14057
94bd4556cf5d Fixes in CodeNavigationService - semi-modal navigation should work again.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14050
diff changeset
   627
    "Modified: / 25-02-2014 / 22:06:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   628
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   629
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   630
delegate: anObject
18116
fd048907f820 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18065
diff changeset
   631
    "I want to see the events of the text and gutter view"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   632
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   633
    super delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   634
    self textView delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   635
    self gutterView delegate: anObject.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   636
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   637
    "Created: / 11-05-2012 / 10:29:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   638
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   639
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   640
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   641
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   642
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   643
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   644
diffMode:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   645
    diffMode := aBoolean.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   646
    textView diffMode: aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   647
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   648
    "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
   649
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   650
14194
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   651
editedLanguage: aProgrammingLanguage
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   652
    self languageHolder value: aProgrammingLanguage
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   653
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   654
    "Created: / 09-04-2014 / 14:49:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   655
!
efb533b63fee Tools::CodeView2>>#editedLanguage:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14145
diff changeset
   656
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   657
editedMethodOrClass:aMethodOrClass
18039
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   658
    "Sets the edited method or class (for code completion and highlighting)"
17456
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   659
    
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   660
    textView editedMethodOrClass:aMethodOrClass.
18039
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   661
    aMethodOrClass isBehavior ifTrue:[
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   662
        self classHolder value:aMethodOrClass.
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   663
        self methodHolder value:nil.
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   664
    ] ifFalse:[
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   665
        aMethodOrClass notNil ifTrue:[
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   666
            self classHolder value:(aMethodOrClass mclass).
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   667
        ] ifFalse:[
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   668
            self classHolder value:nil.
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
   669
        ].
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   670
        self methodHolder value:aMethodOrClass
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
   671
    ].
17456
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   672
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   673
    "Modified (comment): / 09-03-2017 / 10:41:00 / cg"
12914
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   674
!
fbab25348919 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12905
diff changeset
   675
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   676
font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   677
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   678
    ^textView font
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   679
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   680
    "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
   681
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   682
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   683
font: aFont
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   684
18497
82d65ac83ddd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18362
diff changeset
   685
    textView font: aFont
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
    "Created: / 16-02-2010 / 10:26:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18497
82d65ac83ddd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18362
diff changeset
   688
    "Modified: / 27-10-2018 / 23:00:06 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   689
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   690
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   691
mode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   692
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   693
    ^self modeHolder value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   694
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   695
    "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
   696
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   697
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   698
mode: aSymbol
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
   699
    "is this the same as codeAspect ?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   700
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   701
    self assert: (#(expression method) includes: aSymbol).    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   702
    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   703
    ^self modeHolder value: aSymbol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   704
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   705
    "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
   706
    "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
   707
    "Modified (comment): / 27-07-2012 / 22:19:49 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   708
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   709
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   710
model
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   711
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   712
    ^textView model.
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   713
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   714
    "Created: / 27-07-2011 / 12:47:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   715
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   716
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   717
model:newModel
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   718
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   719
    |oldModel oldValue newValue|
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   720
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   721
    (oldModel := textView model) notNil ifTrue:[
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   722
        oldValue := oldModel value.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   723
        oldModel removeDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   724
    ].
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   725
    textView model:newModel.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   726
    newModel notNil ifTrue:[
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   727
        newModel addDependent:self.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   728
    ].
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   729
    newValue := newModel value.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   730
    oldValue ~~ newValue ifTrue:[
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   731
        self update:#value with:newValue from:newModel.
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   732
    ].
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   733
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   734
    "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   735
    "Modified: / 12-03-2019 / 15:42:21 / Claus Gittinger"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   736
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   737
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
    "return true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   741
    ^ self modifiedChannel value
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   742
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   743
    "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
   744
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
modified:aBoolean
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
    "set/clear the modified flag"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   749
    self modifiedChannel value:aBoolean
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   750
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   751
    "Modified: / 14-02-1997 / 16:44:05 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
   752
    "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
   753
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   755
services
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   756
    ^ services ? #()
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   757
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   758
    "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
   759
    "Modified (format): / 06-10-2011 / 14:11:11 / cg"
10487
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   760
!
8865d5a3c200 SmallLint UI improvements
vrany
parents: 10465
diff changeset
   761
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   762
services:aCollectionOfServices
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   763
    "allow setting of the services (instances);
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   764
     this is needed for FileBrowser, to setup a codeView2 without Smalltalk-specific
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   765
     services"
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   766
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   767
    services notEmptyOrNil ifTrue:[ 
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   768
        services do:[:service | service unregister ].
18190
41c70f47bd2b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18141
diff changeset
   769
        services := OrderedCollection new.
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   770
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   771
    servicesFromClient := true.
18190
41c70f47bd2b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18141
diff changeset
   772
    services := aCollectionOfServices asOrderedCollection.
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   773
    services notEmptyOrNil ifTrue:[ 
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   774
        services do:[:service | service registerIn: self ].
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   775
    ].
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   776
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
   777
    "Created: / 06-10-2011 / 14:15:36 / cg"
14495
2507816f2ee1 Fix in Tools::CodeView2>>#services: - when setting services
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14492
diff changeset
   778
    "Modified: / 13-06-2014 / 14:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18190
41c70f47bd2b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18141
diff changeset
   779
    "Modified: / 11-06-2018 / 11:51:22 / Claus Gittinger"
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   780
!
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
   781
14519
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   782
servicesFromClient
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   783
    ^ servicesFromClient ? false
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   784
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   785
    "Modified: / 17-06-2014 / 10:22:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   786
!
47d5751883ab Added Tools::CodeView2>>#servicesFromClient
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14511
diff changeset
   787
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   788
showAcceptCancelBar
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   789
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   790
    ^showAcceptCancelBarChannel value
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   791
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   792
    "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
   793
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
   794
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
showGutter
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   797
    ^showGutterChannel value
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   798
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   799
    "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
   800
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   801
17456
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   802
simulatedSelf
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   803
    ^ textView simulatedSelf
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   804
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   805
    "Created: / 09-03-2017 / 10:50:29 / cg"
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   806
!
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
   807
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   808
smallLintRulesHolder:aHolder
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   809
    "if set, this is returned and the browser is not asked"
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   810
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   811
    smallLintRulesHolder := aHolder.
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   812
!
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
   813
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   814
synchronizeWith: aCodeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
    self assert: aCodeView ~= self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
    synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   820
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   822
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   823
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   824
unsynchronizeWith: aCodeView
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   825
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   826
    self assert: aCodeView ~= self.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   827
    (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   828
    synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   829
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   830
    "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   831
    "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   832
    "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
   833
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
14050
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   835
!CodeView2 methodsFor:'accessing-behavior'!
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   836
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   837
expandTabsWhenUpdating
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   838
    "return the tab expansion behavior.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   839
     If true (the default), the list of lines as given via #list: or
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   840
     due to a model update is processed and lines are replaced by lines with
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   841
     tabs expanded.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   842
     This behavior is ok in 99.99% of all applications.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   843
     However, you may turn this off iff:
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   844
        - you are certain, that no tabs are in the passed in list
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   845
        - it is very expensive to process the list (for example, because the list
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   846
          is defined by a virtual array, which computes the lines dynamically, on the fly).
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   847
     One use where this flag should be turned off is in the hex-memory display,
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   848
     which is able to simulate texts with millions of lines, but they are actually
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   849
     simulated by generating the presented lines dynamically, as they are displayed.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   850
     Notice, that to totally prevent scanning og the whole text, you may have to turn off
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   851
     other flags, such as checkineEndConventionWhenUpdating"
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   852
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   853
    ^ textView expandTabsWhenUpdating
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   854
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   855
    "Created: / 12-03-2019 / 15:21:19 / Claus Gittinger"
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   856
!
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   857
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   858
expandTabsWhenUpdating:aBoolean
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   859
    "define the tab expansion behavior.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   860
     If true (the default), the list of lines as given via #list: or
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   861
     due to a model update is processed and lines are replaced by lines with
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   862
     tabs expanded.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   863
     This behavior is ok in 99.99% of all applications.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   864
     However, you may turn this off iff:
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   865
        - you are certain, that no tabs are in the passed in list
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   866
        - it is very expensive to process the list (for example, because the list
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   867
          is defined by a virtual array, which computes the lines dynamically, on the fly).
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   868
     One use where this flag should be turned off is in the hex-memory display,
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   869
     which is able to simulate texts with millions of lines, but they are actually
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   870
     simulated by generating the presented lines dynamically, as they are displayed.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   871
     Notice, that to totally prevent scanning og the whole text, you may have to turn off
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   872
     other flags, such as checkineEndConventionWhenUpdating"
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   873
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   874
    textView expandTabsWhenUpdating:aBoolean
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   875
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   876
    "Created: / 12-03-2019 / 15:20:51 / Claus Gittinger"
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   877
!
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
   878
14050
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   879
readOnly:aBoolean
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   880
    "ignored here; present for compatibility with some textView subclasses,
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   881
     so that UIPainter can handle it in its TextView spec (which contains a
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   882
     readOnly field)"
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   883
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   884
    super readOnly:aBoolean.
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   885
    textView readOnly: aBoolean. 
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   886
    gutterView readOnly: aBoolean.
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   887
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   888
    "Created: / 21-02-2014 / 11:45:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   889
! !
39037498b7e1 class: Tools::CodeView2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14005
diff changeset
   890
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
   891
!CodeView2 methodsFor:'accessing-code component'!
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   892
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   893
klass
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   894
    "the class or the class of the method being shown."
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   895
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   896
    | v |
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   897
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   898
    (v := self classHolder value) notNil ifTrue:[^v].
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   899
    (v := self method) notNil ifTrue:[^v mclass].
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   900
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
   901
    ^nil
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   902
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   903
    "Created: / 27-07-2011 / 13:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   904
    "Modified: / 22-07-2013 / 13:34:05 / cg"
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
   905
!
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   906
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   907
klass: aClass
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   908
    "the class or the class of the method being shown"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   909
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   910
    "Created: / 27-07-2011 / 13:13:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   911
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   912
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   913
language
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   914
    "return the value in 'languageHolder', the programmingLanguage of the class
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   915
     or method being shown.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   916
     BAD name: confusion with the national language.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   917
     why not call this 'programmingLanguage' ?"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   918
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   919
    | v m c |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   920
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   921
    (v := self languageHolder value) notNil ifTrue:[^v].
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   922
    (m := self method) notNil ifTrue:[^m programmingLanguage].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   923
    (c := self classHolder value) notNil ifTrue:[^c programmingLanguage].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   924
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
   925
    "/No, no default language, please (for workspaces, etc.).
10967
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   926
    "/^SmalltalkLanguage instance
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   927
    ^nil
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   928
8c142eff5641 No highlighting by default (either method or language must be set)
vrany
parents: 10877
diff changeset
   929
    "Modified: / 07-12-2011 / 16:38:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13199
8ad41afc0022 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13165
diff changeset
   930
    "Modified: / 22-07-2013 / 13:34:17 / cg"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   931
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   932
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   933
language: newValue
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   934
    "set the value in 'languageHolder', the programmingLanguage of the class
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   935
     or method being shown.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   936
     BAD name: confusion with the national language.
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   937
     why not call this 'programmingLanguage' ?"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   938
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   939
    self languageHolder value: newValue
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   940
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   941
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   942
method
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   943
    "the method being shown, or nil"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   944
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   945
    ^self methodHolder value
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   946
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   947
    "Created: / 27-07-2011 / 13:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   948
!
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   949
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   950
method: aMethod
15377
96011e799f1a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15361
diff changeset
   951
    "the method being shown, or nil"
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   952
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   953
    ^self methodHolder value: aMethod
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   954
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   955
    "Created: / 27-07-2011 / 13:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   956
! !
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   957
15875
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   958
!CodeView2 methodsFor:'accessing-look'!
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   959
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   960
backgroundColor:aColor
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   961
    textView backgroundColor:aColor
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   962
!
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   963
17395
6e4f908dc515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17322
diff changeset
   964
viewBackground:aColor
6e4f908dc515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17322
diff changeset
   965
    textView viewBackground:aColor
6e4f908dc515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17322
diff changeset
   966
6e4f908dc515 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17322
diff changeset
   967
    "Modified (format): / 12-02-2017 / 12:58:44 / cg"
15875
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   968
! !
Claus Gittinger <cg@exept.de>
parents: 15826
diff changeset
   969
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
!CodeView2 methodsFor:'aspects'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
browserHolder
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
   973
    browserHolder isNil ifTrue:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
        browserHolder := ValueHolder new
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
    ^browserHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
    "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
   979
    "Modified: / 18-11-2011 / 14:58:15 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   982
browserHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   983
    browserHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   984
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   986
classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   987
    "return/create the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   988
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   989
    classHolder isNil ifTrue:[
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   990
        classHolder := ValueHolder with: nil.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   991
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   992
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   993
    ^ classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   994
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
   995
    "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
   996
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   997
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   998
classHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   999
    "set the 'classHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1000
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1001
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1002
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1003
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1004
        oldValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1005
        classHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1006
    ].
14521
6625c6f46bf3 Fixed stupid bug in CodeVIew2>>classHolder: - send correct old classHolder with change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14520
diff changeset
  1007
    old := classHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1008
    classHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
    classHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1010
        classHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
    newValue := classHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
        self update:#value with:newValue from:classHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1016
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1017
    self changed: #classHolder with: old -> classHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1018
14521
6625c6f46bf3 Fixed stupid bug in CodeVIew2>>classHolder: - send correct old classHolder with change.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14520
diff changeset
  1019
    "Modified: / 17-06-2014 / 13:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1020
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1021
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1022
currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1023
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1024
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1025
    currentBlockNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1026
        currentBlockNodeHolder := ValueHolder new.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1027
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1028
    ^ currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1029
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1030
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1031
currentBlockNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1032
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1033
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1034
    currentBlockNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1035
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1036
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1037
currentParseNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1038
    "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1039
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1040
    currentParseNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1041
        currentParseNodeHolder := ValueHolder new.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1042
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1043
    ^ currentParseNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1044
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1045
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1046
currentParseNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1047
    "set the 'currentParseNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1048
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1049
    currentParseNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1050
    gutterView notNil ifTrue:[ gutterView currentBlockNodeHolder: currentBlockNodeHolder ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1051
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1052
    "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1053
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1054
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1055
languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1056
    languageHolder isNil ifTrue:[
17039
8ba8072d1b4f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16968
diff changeset
  1057
        "/ cg: I don't like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
  1058
        "/ 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
  1059
        "/ 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
  1060
        "/ or class.
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
  1061
        languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1064
    ^ languageHolder
10723
e9f1e0dad878 changed: #languageHolder
Claus Gittinger <cg@exept.de>
parents: 10722
diff changeset
  1065
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
  1066
    "Modified: / 19-07-2012 / 16:51:04 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1069
languageHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
    "set the 'languageHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1071
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1072
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1073
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1074
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1075
        oldValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1076
        languageHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1077
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
    languageHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
    languageHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
        languageHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
    old := languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
    newValue := languageHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
        self update:#value with:newValue from:languageHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
    self changed: #languageHolder with: old -> languageHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
    "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
  1091
    "Modified: / 19-07-2012 / 16:51:08 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
    "return/create the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
    methodHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
        methodHolder := ValueHolder new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
    ^ methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
methodHolder:aValueModel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
    "set the 'methodHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
    |old oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
        oldValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
        methodHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
    old := methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
    methodHolder := aValueModel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
    methodHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
        methodHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
    newValue := methodHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
        self update:#value with:newValue from:methodHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
    self changed: #methodHolder with: old -> methodHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
    "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
  1126
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1129
    "return/create the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1130
11706
06ad80a28e48 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 11616
diff changeset
  1131
    "is this the codeAspect?"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1132
    modeHolder isNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1133
        modeHolder := #expression asValue.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1134
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1135
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1136
    ^ modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1137
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1138
    "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
  1139
    "Modified (comment): / 27-07-2012 / 22:22:19 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1140
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
modeHolder:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
    "set the 'modeHolder' value holder (automatically generated)"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1144
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1145
    |oldValue newValue|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1146
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
        oldValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
        modeHolder removeDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
    modeHolder := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
    modeHolder notNil ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
        modeHolder addDependent:self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
    newValue := modeHolder value.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
    oldValue ~~ newValue ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
        self update:#value with:newValue from:modeHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
    self changed: #modeHolder with: modeHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
    "Modified: / 17-06-2011 / 12:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1163
!
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1164
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1165
smalllintRulesHolder
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1166
    |browser|
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1167
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1168
    smallLintRulesHolder notNil ifTrue:[^ smallLintRulesHolder].
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1169
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1170
    (browser := self browser) notNil ifTrue:[
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1171
        ^ browser smalllintRulesOrDefaultHolder.
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1172
    ].
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1173
    ^ nil
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1174
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
!CodeView2 methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1177
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
update:aspect with:param from:sender
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1179
    sender == methodHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1180
        textView editedMethodOrClass: methodHolder value.
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1181
    ].
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1182
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1183
    sender == classHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1184
        methodHolder value isNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1185
            textView editedMethodOrClass: classHolder value.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1186
        ].
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1187
    ].
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1188
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1189
    sender == languageHolder ifTrue:[
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  1190
        "/ languageHolder value class == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  1191
        "/ languageHolder value  == Workflow::ExecutionEditorShellScript::Shell_Language ifTrue:[self halt].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1192
        textView editedLanguage: languageHolder value.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1193
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1194
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1195
    sender == modeHolder ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1196
        codeAspect := modeHolder value
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1197
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1198
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1199
    sender == showGutterChannel ifTrue: [
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1200
        self updateGutterVisibility.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1201
        ^self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1202
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1204
    services do:[:each |
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1205
        each isEnabled ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1206
            each update:aspect with:param from:sender
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1207
        ]
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1208
    ].
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1209
    "/ self updateScrollersViewBackground.
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1210
    
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
    super update:aspect with:param from:sender
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1213
    "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
  1214
    "Modified: / 06-10-2011 / 14:14:36 / cg"
13587
0f06b4a66ae7 Refactoring after moving codeAspect to EditTextView.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13584
diff changeset
  1215
    "Modified: / 27-09-2013 / 10:16:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1217
12950
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1218
updateGutter
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1219
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1220
    self showGutterChannel value ifTrue:[        
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1221
        gutterView invalidate.
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1222
    ]
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1223
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1224
    "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1225
!
990f530e57c5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12914
diff changeset
  1226
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1227
updateGutterVisibility
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1228
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1229
    self showGutterChannel value ifTrue:[        
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1230
        textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1231
        gutterView beVisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1232
    ] ifFalse:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1233
        textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1234
        gutterView beInvisible.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1235
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1236
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1237
    "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1238
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1239
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1240
updateScrollersViewBackground
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1241
    "this changes the scroller's background, to show the positions of
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1242
     warnings, for easy location of interesting spots"
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1243
     
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1244
    |allAnnotations allBreakpoints scroller newBackground verticalScrollBar|
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1245
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1246
    allAnnotations := OrderedCollection new.
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1247
    allBreakpoints := OrderedCollection new.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1248
    services do:[:eachService |
19333
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1249
        eachService enabled ifTrue:[
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1250
            allAnnotations addAll:(eachService annotations ? #()).
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1251
            eachService isBreakpointService ifTrue:[
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1252
                allBreakpoints addAll:(eachService breakpoints ? #()).
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1253
            ].
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  1254
        ]
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1255
    ].
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1256
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1257
    verticalScrollBar := textViewScroller verticalScrollBar.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1258
    verticalScrollBar notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1259
        scroller := verticalScrollBar thumb.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1260
    ].
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1261
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1262
    (allAnnotations isEmpty and:[allBreakpoints isEmpty]) ifTrue:[
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1263
        "/ nothing special to show
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1264
        scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1265
            scroller viewBackground isColor ifTrue:[^ self].
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1266
            scroller initStyle
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1267
        ].
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  1268
    ] ifFalse:[
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1269
        "/ yep, there are some annotations
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  1270
        newBackground := AnnotationShowingScrollerBackground new.
18619
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1271
        newBackground 
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1272
            textView:textView;
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1273
            annotations:allAnnotations; 
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1274
            breakpoints:allBreakpoints.
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1275
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1276
        scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1277
            scroller viewBackground:newBackground.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1278
        ].
16577
57afbd99e827 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16557
diff changeset
  1279
    ].
16910
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1280
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1281
    scroller notNil ifTrue:[
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1282
        scroller invalidate.
83403af26b43 #BUGFIX by sr
sr
parents: 16890
diff changeset
  1283
    ].
18619
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1284
cb4a479b9922 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18600
diff changeset
  1285
    "Modified: / 26-02-2019 / 13:37:08 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1286
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1287
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1288
!CodeView2 methodsFor:'channels'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1289
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1290
modifiedChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1291
    "return the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1292
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1293
    ^ textView modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1294
"/    ^ modifiedChannel
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1295
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1296
    "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
  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
modifiedChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1300
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1301
10662
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1302
    textView modifiedChannel removeDependent:self.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1303
    textView modifiedChannel:aValueHolder.
4d67f850e4f7 comment/format in: #update:with:from:
Claus Gittinger <cg@exept.de>
parents: 10630
diff changeset
  1304
    textView modifiedChannel addDependent:self.
10245
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1305
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1306
"/    |prev|
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1307
"/
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1308
"/    prev := modifiedChannel.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1309
"/    modifiedChannel := aValueHolder.
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1310
"/    self setupChannel:aValueHolder for:nil withOld:prev
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1311
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1312
    "Created: / 30-01-1998 / 14:51:32 / cg"
1a1b298637d1 Attempt to fix the accept/cancel bar - no success.
vrany
parents: 10224
diff changeset
  1313
    "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
  1314
    "Modified: / 05-09-2011 / 05:13:27 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1315
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1316
10785
vrany
parents: 10784
diff changeset
  1317
reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1318
    "return the valueHolder holding true if text was modified"
vrany
parents: 10784
diff changeset
  1319
vrany
parents: 10784
diff changeset
  1320
    ^ textView reallyModifiedChannel
vrany
parents: 10784
diff changeset
  1321
vrany
parents: 10784
diff changeset
  1322
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1323
    "Created: / 08-10-2011 / 12:47:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1324
!
vrany
parents: 10784
diff changeset
  1325
vrany
parents: 10784
diff changeset
  1326
reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1327
vrany
parents: 10784
diff changeset
  1328
    ^ textView reallyModifiedChannel: aValueModel
vrany
parents: 10784
diff changeset
  1329
vrany
parents: 10784
diff changeset
  1330
    "Modified: / 07-07-2011 / 12:07:26 / Jan Vrany <jan.vrant@fit.cvut,cz>"
vrany
parents: 10784
diff changeset
  1331
    "Created: / 08-10-2011 / 12:47:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  1332
!
vrany
parents: 10784
diff changeset
  1333
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1334
showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1335
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1336
    ^showAcceptCancelBarChannel
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1337
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1338
    "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
  1339
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1340
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1341
showAcceptCancelBarChannel:aValueHolder
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1342
    "set the valueHolder holding true if text was modified"
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1343
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1344
    |prev|
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1345
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1346
    prev := showAcceptCancelBarChannel.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1347
    showAcceptCancelBarChannel := aValueHolder.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1348
    self setupChannel:aValueHolder for:nil withOld:prev.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1349
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1350
    "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
  1351
!
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1352
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1353
showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1354
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1355
    ^showGutterChannel
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1356
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1357
    "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
  1358
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1359
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1360
showGutterChannel:aValueHolder
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1361
    "set the valueHolder holding true if text was modified"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1362
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1363
    |prev|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1364
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1365
    prev := showGutterChannel.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1366
    showGutterChannel := aValueHolder.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1367
    self setupChannel:aValueHolder for:nil withOld:prev
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1368
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1369
    "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
  1370
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1371
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1372
!CodeView2 methodsFor:'code services'!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1373
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1374
browseMethod: method
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1375
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1376
    self browseMethod: method label: nil.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1377
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1378
    "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
  1379
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1380
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1381
browseMethod: method label: label
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1382
    |browser|
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1383
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1384
    (browser := self browser) isNil ifTrue: [^NewSystemBrowser openInMethod:method].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1385
    (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1386
        or:[browser navigationState modified])  
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1387
        ifTrue:
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1388
            [browser 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1389
                spawnFullBrowserInClass: method mclass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1390
                selector:method selector 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1391
                in:#newBuffer]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1392
        ifFalse:
19369
52d2aa01b22f #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19333
diff changeset
  1393
            [ browser 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1394
                switchToClass: method containingClass 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1395
                selector: method selector].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1396
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1397
    "Modified: / 19-02-2008 / 10:15:17 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1398
    "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1399
    "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
  1400
    "Modified: / 18-11-2011 / 14:58:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1401
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1402
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1403
browseMethods: methods label: label
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1404
19145
59c56f824a5d #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 19122
diff changeset
  1405
    methods size == 1 ifTrue:
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1406
        [^self browseMethod: methods anyOne label: label].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1407
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1408
    self browser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1409
        ifNil: [NewSystemBrowser browseMethods: methods title: label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1410
        ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1411
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1412
    "Created: / 26-12-2007 / 11:32:04 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1413
    "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1414
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1415
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1416
extractSelectorAndSelectedTextFrom: givenSelectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1417
    | selector selectedText compilerClass na |
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1418
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1419
    selectedText := givenSelectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1420
    compilerClass := self language compilerClass.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1421
    selectedText size > 0 ifTrue:[
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1422
        "/ self windowGroup withWaitCursorDo:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1423
            "/ hack, for now and expecco; must ask the Parser eventually...
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1424
            (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1425
                "/ selector is in one piece anyway
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1426
                (selectedText includes:$_) ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1427
                    "/ zero or one args - sigh (need to parse more to figure this out)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1428
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1429
                    selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1430
                ] ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1431
                    "/ count _#s plus one arg - sigh
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1432
                    na := (selectedText occurrencesOf:$_) + 1. 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1433
                    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1434
                ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1435
            ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1436
                selector := SystemBrowser extractSelectorFrom:selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1437
            ].
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  1438
        "/ ]
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1439
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1440
    ^Array with: selector with: selectedText
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1441
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1442
    "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
  1443
    "Modified: / 05-03-2012 / 09:04:12 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1444
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1445
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1446
implementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1447
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1448
    selector isNil ifTrue:[^#()].
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1449
    ^SystemBrowser
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1450
        findImplementorsOf: selector
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1451
        in: Smalltalk allClasses
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1452
        ignoreCase: false
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1453
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1454
    "Created: / 26-12-2007 / 11:37:11 / janfrog"
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1455
    "Modified: / 18-11-2011 / 14:58:17 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1456
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1457
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1458
sendersOf: selector
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1459
    |senderBlock|
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1460
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  1461
    selector isNil ifTrue:[^#()].
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1462
    selector knownAsSymbol ifFalse:[^#()].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1463
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1464
    "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1465
    senderBlock := SystemBrowser searchBlockForSymbol:selector asSymbol.
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1466
    senderBlock == false ifTrue:[ ^ #() ].
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1467
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1468
    ^ SystemBrowser
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1469
        allMethodsIn:Smalltalk allClasses
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1470
        where:senderBlock.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1471
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1472
    "/ exact, but much slower
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1473
"/    ^SystemBrowser
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1474
"/        findSendersOf: selector
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1475
"/        in: Smalltalk allClasses
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1476
"/        ignoreCase: false
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1477
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1478
    "Created: / 26-12-2007 / 11:37:22 / janfrog"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1479
    "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
  1480
    "Modified: / 18-11-2011 / 14:58:19 / cg"
14447
10f98c40548b fixed ALT-right click (senders of selector under cursor)
az
parents: 14439
diff changeset
  1481
    "Modified: / 04-06-2014 / 11:10:47 / az"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1482
! !
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1483
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1484
!CodeView2 methodsFor:'delegation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1485
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1486
doesNotUnderstand: aMessage
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1487
17456
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1488
    ((textView respondsTo:aMessage selector) 
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1489
      and:[(TraceSelectors includes:aMessage selector) not]
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1490
    ) ifTrue:[
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1491
        ^ aMessage sendTo:textView
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1492
    ].
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1493
    ^ super doesNotUnderstand:aMessage
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1494
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1495
    "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
  1496
    "Modified: / 14-02-2010 / 09:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17456
bb04272d0316 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17395
diff changeset
  1497
    "Modified (format): / 09-03-2017 / 10:51:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1498
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1499
19036
e0b582bedd37 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19017
diff changeset
  1500
executeDoIt:theCode
e0b582bedd37 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19017
diff changeset
  1501
    ^ textView executeDoIt:theCode
e0b582bedd37 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19017
diff changeset
  1502
!
e0b582bedd37 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 19017
diff changeset
  1503
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1504
hasSelection
17928
ae4f5a045f26 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17893
diff changeset
  1505
    "true if there us a text selection"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1506
19017
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  1507
    ^ textView hasSelection
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
    "Created: / 14-02-2010 / 09:53:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
19017
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  1510
!
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  1511
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  1512
textFromCharacterPosition:start to:end
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  1513
    ^ textView textFromCharacterPosition:start to:end
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1514
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1515
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1516
!CodeView2 methodsFor:'delegation-drawing'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1517
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1518
drawLine:lineNo in: view atX:x y:yBaseline width: w height:hFont ascent:aFont
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1519
    from:startCol to:endColOrNil with:fg and:bg
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1520
    "See the comment in
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1521
     CodeViewService>>drawLine:in:atX..."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1522
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  1523
    self servicesDo:[:each|
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1524
        each drawLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:aFont
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  1525
             from:startCol to:endColOrNil with:fg and:bg
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1526
    ]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1527
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1528
    "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
  1529
    "Modified: / 06-10-2011 / 14:14:04 / cg"
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  1530
    "Modified: / 27-11-2014 / 15:37:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1531
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1532
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1533
redrawVisibleLine: visLineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1534
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1535
    "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
  1536
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1537
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1538
redrawVisibleLine:visLine col:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1539
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1540
    "Modified: / 05-11-2007 / 17:35:53 / cg"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1541
    "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
  1542
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1543
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1544
redrawVisibleLine:visLine from:startCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1545
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1546
    "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
  1547
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1548
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1549
redrawVisibleLine:visLine from:startCol to:endCol
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1550
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1551
    "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
  1552
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1553
11393
fb1c9eb2aab7 category of:20 methods
Claus Gittinger <cg@exept.de>
parents: 11377
diff changeset
  1554
!CodeView2 methodsFor:'delegation-events'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1555
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1556
buttonMotion: button x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1557
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1558
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1559
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1560
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1561
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1562
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1563
            service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1564
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1565
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1566
    "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1567
    "Modified: / 06-10-2011 / 14:13:57 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1568
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1569
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1570
buttonMultiPress: button x:x y:y in: view
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1571
    "Delegates events to services. Answers true iff at least
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1572
     one service handler method returns true. In that case,
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1573
     the event is is NOT processes by the view."
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1574
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1575
    ^ services
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1576
        contains:[:service |
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  1577
            service isEnabled 
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  1578
            and:[ ((service buttonMultiPress: button x:x y:y in: view) == true) ]
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1579
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1580
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1581
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1582
    "Modified: / 06-10-2011 / 14:14:00 / cg"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1583
    "Modified (format): / 05-03-2012 / 08:56:02 / cg"
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1584
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  1585
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1586
buttonPress: button x:x y:y in: view
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1587
    "Possibly delegate event a service. 
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1588
     Answers true (i.e. event was handled) iff at least
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1589
     one service handler method returns true. 
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1590
     In that case, the event is is NOT processes by the view.
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1591
     Notice, that this is called both for events in the gutter AND for events in the text."
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1592
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1593
    |bpntService|
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1594
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1595
    "/ cg: I want to toggle breakpoints on single click, but only if its the only service
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1596
    "/ which is interested in that line (i.e. there is no lint-info icon there).
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1597
    "/ Modified to do a first round asking any for a single-press action;
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1598
    "/ on the fly, remember any breakpoint service.
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1599
    services
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1600
        do:[:eachService |
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1601
            eachService isEnabled ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1602
                ((eachService buttonPress: button x:x y:y in: view) == true) ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1603
                    ^ true.
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1604
                ].
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1605
                eachService isBreakpointService ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1606
                    bpntService := eachService
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1607
                ]
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1608
            ].
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1609
        ].
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1610
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1611
    "/ then, if there was no one interested, but there is a breakpoint service,
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1612
    "/ let it handle it.
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1613
    bpntService notNil ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1614
        view == gutterView ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1615
            button == 1 ifTrue:[
19098
b8b0683054da #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 19079
diff changeset
  1616
                bpntService singleClickToToggle ifTrue:[
b8b0683054da #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 19079
diff changeset
  1617
                    bpntService setOrToggleBreakpointAtX:x y:y.
b8b0683054da #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 19079
diff changeset
  1618
                    ^ true.
b8b0683054da #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 19079
diff changeset
  1619
                ]
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1620
            ]
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1621
        ]
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1622
    ].
19098
b8b0683054da #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 19079
diff changeset
  1623
    ^ false
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  1624
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1625
    "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1626
    "Modified: / 06-10-2011 / 14:14:00 / cg"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1627
    "Modified (format): / 05-03-2012 / 08:56:02 / cg"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1628
!
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1629
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1630
buttonRelease: button x:x y:y in: view
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1631
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1632
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1633
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1634
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1635
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1636
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1637
            service isEnabled and:[ ((service buttonRelease: button x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1638
        ].
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1639
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1640
15170
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1641
highlightClassVariable:name
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1642
    "interface from browser (when a class var is selected)"
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1643
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1644
    services do:[:each|
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1645
        each highlightClassVariable:name
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1646
    ].
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1647
!
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1648
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1649
highlightInstanceVariable:name
15170
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1650
    "interface from browser (when an inst var is selected)"
a4ce93833783 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15130
diff changeset
  1651
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1652
    services do:[:each|
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1653
        each highlightInstanceVariable:name
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1654
    ].
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1655
!
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  1656
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1657
keyPress: key x:x y:y in: view
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1658
    "Delegates events to services. Answers true iff at least
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1659
     one service handler method returns true. In that case,
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1660
     the event is is NOT processes by the view."
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1661
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1662
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1663
        contains:[:service |
13582
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1664
            |handledByService|
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1665
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1666
            handledByService := service isEnabled 
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1667
                                and:[ ((service keyPress: key x:x y:y in: view) == true)].
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1668
            "/ handledByService ifTrue:[ Transcript showCR:'handled by ',service printString ].
666891267a54 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13575
diff changeset
  1669
            handledByService
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1670
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1671
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1672
    "Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1673
    "Modified: / 06-10-2011 / 14:14:11 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1674
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1675
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1676
keyRelease: key x:x y:y in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1677
    "Delegates events to services. Answers true iff at least
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1678
     one service handler method returns true. In that case,
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1679
     the event is is NOT processes by the view."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1680
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1681
    ^ services 
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1682
        contains:[:service |
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1683
            service isEnabled and:[ ((service keyRelease: key x:x y:y in: view) == true) ]
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  1684
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1685
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1686
    "Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1687
    "Modified: / 06-10-2011 / 14:14:13 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1688
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1689
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1690
linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1691
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1692
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1693
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1694
            each linesDeletedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1695
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1696
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1697
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1698
    "Created: / 06-07-2011 / 17:12:54 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1699
    "Modified: / 06-10-2011 / 14:14:16 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  1700
    "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
  1701
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1702
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1703
linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1704
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1705
    services do: [:each |
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1706
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1707
            each linesInsertedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1708
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1709
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1710
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1711
    "Created: / 06-07-2011 / 17:12:48 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1712
    "Modified: / 06-10-2011 / 14:14:20 / cg"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1713
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1714
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1715
linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1716
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  1717
    services do:[:each |
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1718
        each isEnabled ifTrue: [
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1719
            each linesModifiedFrom: start to: end
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1720
        ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1721
    ].
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1722
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1723
    "Created: / 06-07-2011 / 17:12:58 / jv"
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1724
    "Modified: / 06-10-2011 / 14:13:44 / cg"
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  1725
    "Modified (format): / 22-08-2018 / 09:23:04 / Claus Gittinger"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1726
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  1727
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1728
scrollDown: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1729
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1730
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1731
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1732
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1733
            synchronizedCodeViews do:[:codeView|codeView scrollDown: nLines in: view]]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1734
        ifFalse:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1735
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1736
            textView basicScrollDown: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1737
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1738
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1739
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1740
14005
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1741
scrollTo:origin redraw:doRedraw in: view
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1742
    view == textView ifTrue: [
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1743
        "/my text view scrolled...
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1744
        synchronizedCodeViews do:[:codeView|
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1745
            codeView scrollTo:origin redraw:doRedraw in: view.
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1746
        ]
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1747
    ] ifFalse: [
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1748
        "/other code view scrolls and I'm notified about that
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1749
        textView basicScrollTo:origin redraw:doRedraw.
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1750
    ]
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1751
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1752
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1753
    "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1754
!
64ce1418dcc8 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 13993
diff changeset
  1755
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1756
scrollUp: nLines in: view
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1757
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1758
    view == textView 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1759
        ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1760
            ["/my text view scrolled...
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1761
            synchronizedCodeViews do:[:codeView|codeView scrollUp: nLines in: view]]
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
            ["/other code view scrolls and I'm notified about that
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1764
            textView basicScrollUp: nLines]
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1765
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1766
    "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1767
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1768
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1769
!CodeView2 methodsFor:'diff mode'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1770
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1771
recomputeDiff:view 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1772
    |t1 t2 pom diffHelper view2|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1773
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1774
    t1 := view getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1775
    synchronizedCodeViews do:[:codeView | 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1776
        view2 := codeView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1777
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1778
    view changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1779
    view2 changedDiffText:false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1780
    t2 := view2 getNewOriginText.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1781
    pom := DiffCodeView2 new.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1782
    (view == textView) ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1783
        diffHelper := pom computeDiffDataForText1:t1 text2:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1784
        (view) contents:(diffHelper text1).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1785
        (view) deletedLines:(diffHelper deleted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1786
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1787
        (view) originDiffText:t1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1788
        (view) emptyLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1789
        (view) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1790
        (view2) contents:(diffHelper text2).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1791
        (view2) insertedLines:(diffHelper inserted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1792
        (view2) changedLines:(diffHelper changed).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1793
        (view2) originDiffText:t2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1794
        (view2) emptyLines:(diffHelper deleted).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1795
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1796
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1797
    "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1798
    "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
  1799
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1800
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1801
!CodeView2 methodsFor:'initialize & release'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1802
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1803
defaultServices
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1804
    "/ used to call "CodeViewService availableServices",
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1805
    "/ which enumerated all subclasses.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1806
    "/ this is BAD BAD BAD, because it does not allow for additional service
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1807
    "/ subclasses to be built for special applications. For example,
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1808
    "/ a debugging breakpoint service for a GDB application, a breakpoint service for
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1809
    "/ expecco's codeview.
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1810
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1811
    "/ therefore, the list of services to use in codeView2 is now filtered
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1812
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1813
    ^ CodeViewService availableServices
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1814
        select:[:service | service isUsefulFor:self]
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1815
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1816
    "Created: / 22-07-2013 / 13:57:40 / cg"
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1817
!
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1818
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1820
    "Invoked when a new instance is created."
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1821
    "Call super initialize"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1822
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1823
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1824
     "Now set up some visual properties"
15893
8faba2344b0f #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 15875
diff changeset
  1825
    self level:(styleSheet at:#'codeView2.level' default:-1).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1826
     "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
  1827
    showGutterChannel := ValueHolder with: true.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1828
    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
  1829
    "/ 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
  1830
    "/ 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
  1831
    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
  1832
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1833
    "/ 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
  1834
    "/ initialize methods
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1835
    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
  1836
    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
  1837
    textView := textViewScroller scrolledView.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  1838
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1839
    self initializeGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1840
    self initializeTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1841
    textView setCodeView:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1842
    modifiedChannel := ValueHolder with:false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1843
    diffMode := false.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1844
    synchronizedCodeViews := #().
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1845
    currentParseNodeHolder := ValueHolder new.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1846
    currentBlockNodeHolder := ValueHolder new.
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1847
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1848
    servicesFromClient := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1849
    services := OrderedCollection new.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  1850
    self initializeServices.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1851
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1852
    "Modified: / 14-12-2009 / 13:59:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1853
    "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
  1854
    "Modified: / 06-10-2011 / 14:15:48 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1855
    "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
  1856
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1857
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1858
initializeGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1859
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1860
    gutterView setCodeView:self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  1861
    gutterView currentBlockNodeHolder: self currentBlockNodeHolder.
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  1862
    gutterView origin:(0.0 @ 0.0) corner:(gutterView preferredWidth+1 @ 1.0).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1863
    showGutterChannel value ifTrue:[self addSubView: gutterView].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1864
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1865
    "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
  1866
    "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
  1867
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1868
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1869
initializeServices
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1870
    | serviceClasses |
10409
585a43ba93c5 Fixes for debugger
vrany
parents: 10375
diff changeset
  1871
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1872
    "/ 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
  1873
    "/ (FileBrowser does not want Smalltalk-specific services)
10767
2432e277a643 services setup
Claus Gittinger <cg@exept.de>
parents: 10755
diff changeset
  1874
    servicesFromClient ifFalse:[
16587
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1875
        serviceClasses := self defaultServices 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1876
                            sort:[:a :b|
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1877
                                a priority = b priority 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1878
                                    ifTrue:[a name < b name] 
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1879
                                    ifFalse:[a priority > b priority]
bd22b8fd7edb #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 16578
diff changeset
  1880
                            ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1881
        serviceClasses do:[:cls|
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1882
            self registerService: cls new
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  1883
        ].
10755
3cc7a80e9d58 added: #services:
Claus Gittinger <cg@exept.de>
parents: 10731
diff changeset
  1884
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1885
13208
2c9e9dc1b880 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13199
diff changeset
  1886
    "Modified: / 22-07-2013 / 14:02:59 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  1887
    "Modified: / 24-07-2013 / 11:56:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1888
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1889
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1890
initializeTextView
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  1891
    "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
  1892
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1893
    textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1894
        origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1895
        corner: 1.0@1.0;
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1896
        level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1897
    textView level: 0.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1898
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1899
    textView modifiedChannel addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1900
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1901
    "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
  1902
    "Modified: / 23-06-2010 / 19:38:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1903
!
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1904
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1905
release
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1906
    services do:[:service | service unregister ].
18190
41c70f47bd2b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18141
diff changeset
  1907
    services := OrderedCollection new.
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1908
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1909
    textView model notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1910
        textView model removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1911
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1912
    textView modifiedChannel notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1913
        textView modifiedChannel removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1914
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1915
    showGutterChannel removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1916
    languageHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1917
        languageHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1918
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1919
    classHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1920
        classHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1921
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1922
    methodHolder notNil ifTrue:[ 
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1923
        methodHolder removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1924
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1925
    super release.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1926
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  1927
    "Created: / 23-06-2014 / 20:16:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14549
077001d56ef7 Oops, fix in Tools::CodeView2>>release - release could be (and sometimes is) called twice.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14545
diff changeset
  1928
    "Modified: / 23-06-2014 / 22:18:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18190
41c70f47bd2b #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18141
diff changeset
  1929
    "Modified: / 11-06-2018 / 11:50:37 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1930
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1931
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1932
!CodeView2 methodsFor:'menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1933
10689
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1934
accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1935
    textView accept
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1936
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1937
    "Created: / 07-09-2011 / 21:29:07 / cg"
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1938
!
825d52f63cf7 added: #accept
Claus Gittinger <cg@exept.de>
parents: 10662
diff changeset
  1939
10375
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1940
again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1941
    textView again
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1942
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1943
    "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
  1944
    "Created: / 22-07-2011 / 17:44:31 / cg"
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1945
!
9b5d4c887f5e added: #again
Claus Gittinger <cg@exept.de>
parents: 10330
diff changeset
  1946
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1947
browseImplementorsOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1948
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1949
    textView browseImplementorsOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1950
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1951
    "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
  1952
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1953
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1954
browseSendersOfIt
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1955
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1956
    textView browseSendersOfIt
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1957
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  1958
    "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
  1959
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1960
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1961
copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1962
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1963
    textView copySelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1964
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1965
    "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
  1966
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1967
17464
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1968
copySelectionBox
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1969
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1970
    textView copySelectionBox
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1971
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1972
    "Created: / 14-03-2017 / 16:29:45 / cg"
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1973
!
0e340b03ddd5 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 17456
diff changeset
  1974
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1975
cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1976
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1977
    textView cut
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1978
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1979
    "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
  1980
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1981
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1982
doIt
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 doIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1986
    "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
  1987
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1988
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1989
inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1990
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1991
    textView inspectIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1992
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1993
    "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
  1994
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1995
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1996
inspectSelectedSelector
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1997
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1998
    self error: 'Not yet implemented'
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1999
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2000
    "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
  2001
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2002
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2003
inspectSyntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2004
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2005
    syntaxElements inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2006
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2007
    "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
  2008
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2009
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2010
inspectView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2011
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2012
    self inspect
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2013
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2014
    "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
  2015
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2016
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2017
pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2018
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2019
    textView pasteOrReplace
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2020
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2021
    "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
  2022
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2023
18516
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2024
pasteOrReplaceFromHistory
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2025
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2026
    textView pasteOrReplaceFromHistory
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2027
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2028
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2029
!
dd25bb9c82c4 #UI_ENHANCEMENT by cgexept.de
Claus Gittinger <cg@exept.de>
parents: 18497
diff changeset
  2030
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2031
printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2032
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2033
    textView printIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2034
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2035
    "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
  2036
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2037
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2038
profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2039
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2040
    textView profileIt
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2041
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2042
    "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
  2043
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2044
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2045
undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2046
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2047
    textView undo
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2048
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2049
    "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
  2050
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2051
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2052
!CodeView2 methodsFor:'menus-dynamic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2053
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2054
debugMenu
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2055
    ^ self class debugMenu decodeAsLiteralArray
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2056
        receiver:self.
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2057
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2058
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2059
editMenu
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2060
    | editMenu superEditMenu moreMenu moreMenuItem |
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2061
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2062
    superEditMenu := textView superEditMenu.
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2063
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2064
    textView sensor ctrlDown ifTrue:[
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2065
        ^superEditMenu
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2066
    ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2067
13072
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  2068
    "/ install the standard 'more' menu into my own menu
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  2069
    moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
390ebcd412f8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13062
diff changeset
  2070
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2071
    editMenu := self class editMenu decodeAsLiteralArray.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2072
    moreMenuItem := editMenu menuItemLabeled: 'More'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2073
    moreMenuItem submenu: moreMenu asMenu.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2074
    editMenu findGuiResourcesIn: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2075
    ^editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2076
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2077
    "Created: / 25-12-2007 / 10:10:01 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2078
    "Modified: / 25-12-2007 / 19:50:53 / janfrog"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2079
    "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
  2080
    "Modified: / 08-07-2011 / 13:35:31 / cg"
10780
1093fdd69f27 Fix for edit menu issue ( #D1863483 )
vrany
parents: 10767
diff changeset
  2081
    "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
  2082
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2083
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2084
implementorsMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2085
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2086
    | selectorAndSelectedText selector selectedText  implementors |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2087
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2088
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2089
    selectedText size > 0 ifTrue:[
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2090
        "/ self windowGroup withWaitCursorDo:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2091
            selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2092
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2093
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2094
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2095
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2096
                implementors := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2097
                                    findImplementorsOf:selectedText "Any: (Array with:selectedText)" 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2098
                                    in:(Smalltalk allClasses) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2099
                                    ignoreCase:false)
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2100
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2101
            ] ifFalse:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2102
                implementors := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2103
                                    findImplementorsOfAny:(Array with:selectedText with: selector) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2104
                                    in:(Smalltalk allClasses) 
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2105
                                    ignoreCase:false)
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2106
            ].
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2107
        "/ ] 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2108
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2109
        implementors := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2110
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2111
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2112
    ^self implementorsMenu: implementors selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2113
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2114
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2115
    "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
  2116
    "Modified: / 05-03-2012 / 09:02:43 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2117
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2118
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2119
implementorsMenu: implementors selector: selector
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2120
    | menu|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2121
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2122
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  2123
    implementors isEmptyOrNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2124
        menu addItem:(MenuItem label:'No implementors found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2125
    ] ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2126
        menu addItem:(MenuItem
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2127
                    label:(selector storeString , (' (all implementors) ') allItalic)
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2128
                    itemValue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2129
                        self browseMethods:implementors
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2130
                            label:'Implementors of ' , selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2131
                    ]).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2132
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2133
        menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2134
        (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2135
        "implementors" do:[:mth |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2136
            menu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2137
                addItem:(MenuItem label:(selector storeString
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2138
                                , (' in ' , mth containingClass nameInBrowser allBold))
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2139
                        itemValue:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2140
        ]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2141
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2142
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2143
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2144
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2145
    "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2146
    "Modified: / 07-03-2012 / 12:56:56 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2147
    "Modified: / 14-10-2013 / 10:47:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2148
    "Modified: / 13-03-2019 / 22:06:59 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2149
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2150
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2151
sendersMenu
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2152
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2153
    | selectorAndSelectedText selector selectedText  senders |
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2154
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2155
    selectedText := textView selectionAsString.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2156
    selectedText size > 0 ifTrue:[
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2157
        "/ self windowGroup withWaitCursorDo:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2158
            selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2159
            selector := selectorAndSelectedText first.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2160
            selectedText := selectorAndSelectedText second.
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2161
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2162
            (selector notNil and:[selector = selectedText]) ifTrue:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2163
                senders := (SystemBrowser 
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2164
                                findSendersOf:selectedText "Any:(Array with:selectedText)" 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2165
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2166
                                ignoreCase:false)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2167
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2168
            ] ifFalse:[
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2169
                senders := (SystemBrowser 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2170
                                findSendersOfAny:(Array with:selectedText with: selector) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2171
                                in:(Smalltalk allClasses) 
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2172
                                ignoreCase:false)
11359
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2173
            ].
911eaee39d50 changed:
Claus Gittinger <cg@exept.de>
parents: 11353
diff changeset
  2174
        "/ ] 
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2175
    ] ifFalse:[
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2176
        senders := #().
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2177
    ].
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2178
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2179
    ^self sendersMenu: senders selector: (selector ? selectedText)
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2180
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2181
    "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2182
    "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
  2183
    "Modified: / 05-03-2012 / 09:02:56 / cg"
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2184
!
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2185
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2186
sendersMenu: senders  selector: selector
11377
e995583db311 changed:
Claus Gittinger <cg@exept.de>
parents: 11359
diff changeset
  2187
    | menu shownSenderItems numCut sendersSorted|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2188
10262
39688cd73dff Merged with JV's branch
vrany
parents: 10245
diff changeset
  2189
    menu := Menu new.
10465
7bb5a6157330 changed:
Claus Gittinger <cg@exept.de>
parents: 10409
diff changeset
  2190
    senders isEmptyOrNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2191
        menu addItem:(MenuItem label:'No senders found') disable
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2192
    ] ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2193
        menu addItem:(MenuItem
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2194
                    label:(selector storeString , (' (all senders)') allItalic)
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2195
                    itemValue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2196
                        self browseMethods:senders
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2197
                            label:'Senders of ' , selector storeString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2198
                    ]).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2199
        menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2200
        sendersSorted := senders asOrderedCollection
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2201
                            sort:[:a :b | a whoString < b whoString].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2202
        shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2203
        numCut := senders size - 20.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2204
        shownSenderItems do:[:mth |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2205
            menu
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2206
                addItem:(MenuItem label:(mth selector storeString
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2207
                                , (' in ' , mth containingClass nameInBrowser allBold))
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2208
                        itemValue:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2209
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2210
        numCut > 0 ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2211
            menu addSeparator.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2212
            menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2213
        ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2214
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2215
    ^ menu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2216
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2217
    "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2218
    "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
  2219
    "Modified: / 07-07-2011 / 14:51:54 / jv"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2220
    "Modified: / 07-03-2012 / 12:58:31 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2221
    "Modified: / 14-10-2013 / 10:47:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18688
d890379d68cd #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18669
diff changeset
  2222
    "Modified: / 13-03-2019 / 22:07:12 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2223
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2224
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2225
servicesMenu
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2226
    |menu item anyService|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2227
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2228
    menu := Menu new.
13110
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2229
    item := (MenuItem label:(resources string:'Services (experimental)')) enabled:false.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2230
    menu addItem:item.
2ca621dee00c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13108
diff changeset
  2231
    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2232
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2233
    "/ disabled, because this menu is now on the gutter,
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2234
    "/ and it makes it hard to show it again, once hidden
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2235
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2236
"/    item := MenuItem label:(resources string:'Show Gutter').
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2237
"/    item indication:(self showGutterChannel).
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2238
"/    menu addItem:item.
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2239
"/    menu addSeparator.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2240
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2241
    anyService := false.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2242
    services do:[:service | 
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2243
        |item|
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2244
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2245
        item := MenuItem label:(resources string:service label).
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2246
        item indication:((AspectAdaptor forAspect:#enabled) subject:service).
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2247
        item hideMenuOnActivated:false.
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2248
        menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2249
        anyService := true.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2250
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2251
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2252
    anyService ifTrue:[
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2253
        menu addSeparator.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2254
    ].
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2255
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2256
    item := MenuItem label:(resources string:'Debug').
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2257
    item submenuChannel:[ self debugMenu ].
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2258
    menu addItem:item.
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2259
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  2260
    ^ menu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2261
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2262
    "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
  2263
    "Modified: / 06-10-2011 / 14:14:30 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2264
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2265
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2266
!CodeView2 methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2267
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2268
codeCompletion
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2269
    "/ I found this code 3 times (CodeView2, NewSystemBrowser and DebugView) - smell? 
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2270
    "/ (can we move that to a utility - probably DoWhatIMeanSupport)
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2271
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2272
    |cls language|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2273
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2274
    cls := self classHolder value.
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2275
    cls notNil ifTrue:[
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2276
        language := cls programmingLanguage
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2277
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2278
    UserInformation handle:[:ex |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2279
        self showInfo:(ex messageText).
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2280
        ex proceed.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2281
    ] do:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2282
        self withWaitCursorDo:[
14110
c671dfc959ef class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14101
diff changeset
  2283
            DoWhatIMeanSupport codeCompletionForLanguage:language class:cls context:nil codeView:self.
9985
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
    ^ self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2287
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2288
    "Modified: / 04-07-2006 / 18:48:26 / fm"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2289
    "Modified: / 20-11-2006 / 12:30:59 / cg"
13559
5215c061491c Pass programming language when asking DWIM to complete code
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13517
diff changeset
  2290
    "Modified: / 18-09-2013 / 14:18:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2291
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2292
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2293
reallyModified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2294
    "check for modified code by comparing the source against
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  2295
     the codeView's contents.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2296
     That's the true modified value 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2297
     (in case user undid his changes, and the displayed text is actually original)"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2298
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2299
    |modified|
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2300
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2301
    "/ cg: why this? It does not make sense to me.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2302
    "/ either we can depend on what the textView tells me here
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2303
    "/ in which case we don't need the code below,
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2304
    "/ or we cannot, in which the textView modified query should be removed.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2305
    "/ from tracing, it looks as if the textView modified query is correct all the time.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2306
    "/ Can someone validate/verify this, please?
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2307
    textView modified ifTrue:[^true].   
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2308
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2309
     "/ higher prio to prevent it from being changed while we convert it (by editing)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2310
    Processor activeProcess
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2311
        withHigherPriorityDo:[
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  2312
            modified := textView isTextDifferentFromOriginalSource.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2313
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2314
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2315
    ^ modified
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2316
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2317
    "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
  2318
    "Modified (format): / 05-06-2012 / 23:55:02 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2319
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2320
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2321
showInfo: message
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2322
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2323
    | app |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2324
    (app := self topView application) ifNotNil:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2325
        [(app respondsTo: #showInfo:) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2326
            [app showInfo: message]].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2327
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2328
    "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
  2329
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2330
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2331
!CodeView2 methodsFor:'private-accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2332
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2333
gutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2334
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2335
    ^gutterView
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-02-2010 / 15:21:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
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
syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2341
    ^ syntaxElementSelection
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2342
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2343
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2344
syntaxElementSelection:anElement
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2345
    syntaxElementSelection := anElement.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2346
"/    anElement isNil ifTrue:[
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2347
"/        currentParseNodeHolder value: nil.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2348
"/"/        currentBlockNodeHolder value: nil.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2349
"/    ] ifFalse:[
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2350
"/        currentParseNodeHolder value: anElement node.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2351
"/"/        currentBlockNodeHolder value: anElement node enclosingBlock.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2352
"/    ]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2353
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2354
    "Modified: / 24-09-2013 / 00:14:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2355
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2356
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2357
syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2358
    ^ syntaxElements
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2359
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2360
14705
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2361
syntaxElements:aCollection
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2362
    aCollection notNil ifTrue:[
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2363
        aCollection isSortedCollection ifFalse:[ 
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2364
            aCollection sort.
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2365
        ].
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2366
    ].
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2367
    syntaxElements := aCollection.
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2368
4750b6f40d9a Temporary hack - sort syntaxElements if not already/
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14674
diff changeset
  2369
    "Modified: / 08-08-2014 / 13:18:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2370
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2371
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2372
textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2373
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2374
    ^textView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2375
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2376
    "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
  2377
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2378
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2379
textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2380
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2381
    ^textViewScroller
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2382
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2383
    "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
  2384
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2385
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2386
!CodeView2 methodsFor:'realization'!
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2387
13062
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2388
disableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2389
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2390
    services do:[:service|
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2391
        service enabled:false.
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2392
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2393
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2394
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2395
enableAllServices
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2396
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2397
    services do:[:service|
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2398
        service enabled:true.
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2399
    ]
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2400
!
caed0c14f32c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13057
diff changeset
  2401
11179
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2402
postRealize
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2403
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2404
    services do:[:service|
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2405
        service viewRealized.
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2406
    ]
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2407
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2408
    "Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2409
! !
dc0c7401bce0 added: #postRealize
vrany
parents: 11054
diff changeset
  2410
13975
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2411
!CodeView2 methodsFor:'redrawing'!
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2412
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2413
flash
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2414
    textView flash.
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2415
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2416
    "Created: / 21-02-2014 / 16:57:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14988
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2417
!
a0bec91d2399 class: Tools::CodeView2
Stefan Vogel <sv@exept.de>
parents: 14986
diff changeset
  2418
18988
4d63ba5439f6 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18962
diff changeset
  2419
flash:aString
4d63ba5439f6 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18962
diff changeset
  2420
    "flash the view and show aString for a moment."
4d63ba5439f6 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18962
diff changeset
  2421
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2422
    "delegated to my textview"
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2423
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2424
    textView flash:aString.
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2425
!
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2426
17718
449427f1c172 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17675
diff changeset
  2427
flash:messageOrNil withColor:flashColor
15826
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2428
    "delegated to my textview"
faa2d1d06728 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15788
diff changeset
  2429
17718
449427f1c172 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17675
diff changeset
  2430
    textView flash:messageOrNil.
449427f1c172 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17675
diff changeset
  2431
449427f1c172 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17675
diff changeset
  2432
    "Modified (format): / 21-10-2017 / 23:13:35 / cg"
13975
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2433
! !
21b5fc56a638 Added Tools::CodeView2>>#flash
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13962
diff changeset
  2434
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2435
!CodeView2 methodsFor:'services'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2436
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2437
breakpointService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2438
    "that one or nil"
14844
7a0e0c3a430e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14843
diff changeset
  2439
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2440
    ^ services detect:[:any| (any isKindOf: BreakpointService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2441
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2442
18600
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2443
breakpointService:newServiceOrNil
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2444
    "set the breakpoint service"
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2445
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2446
    |oldService|
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2447
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2448
    (oldService := self breakpointService) notNil ifTrue:[
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2449
        self unregisterService:oldService.
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2450
    ].
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2451
    newServiceOrNil notNil ifTrue:[
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2452
        self registerService:newServiceOrNil.
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2453
    ].
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2454
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2455
    "Created: / 18-02-2019 / 19:45:52 / Claus Gittinger"
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2456
!
5d39ca1a04f8 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18570
diff changeset
  2457
18796
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2458
hasBreakpointService
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2459
    ^ self breakpointService notNil
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2460
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2461
    "Created: / 29-05-2019 / 14:54:42 / Claus Gittinger"
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2462
!
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2463
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2464
hasBreakpoints
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2465
    |bpService|
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2466
    
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2467
    ^ (bpService := self breakpointService) notNil 
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2468
    and:[ bpService hasBreakpoints]
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2469
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2470
    "Created: / 29-05-2019 / 14:53:29 / Claus Gittinger"
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2471
!
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2472
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2473
inspectBreakpoints
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2474
    self breakpointService breakpoints inspect.
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2475
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2476
    "Created: / 29-05-2019 / 14:53:20 / Claus Gittinger"
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2477
!
40fa54644659 #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18711
diff changeset
  2478
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2479
lintService
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2480
    "prefers the smallsense-lint service over others"
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2481
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2482
    ^ services 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2483
        detect:[:any| (any isKindOf:SmallSense::SmalltalkLintService)] 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2484
        ifNone:[
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2485
            services 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2486
                detect:[:any| (any isLintService)] 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2487
                ifNone:nil
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2488
        ]
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2489
!
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2490
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2491
registerService: aCodeViewService
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2492
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2493
    services add: aCodeViewService.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2494
    aCodeViewService registerIn: self
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2495
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2496
    "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
  2497
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2498
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2499
servicesDo:aBlock
14927
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2500
    services notNil ifTrue:[ 
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2501
        services do:[ :service | service isEnabled ifTrue:[ aBlock value: service ] ] 
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2502
    ]
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2503
b109a354435c Fixes for enabling / disabling individual CodeView2 services.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14915
diff changeset
  2504
    "Modified: / 27-11-2014 / 15:38:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2505
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2506
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2507
syntaxHighlightingService
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2508
    "that one or nil"
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2509
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2510
    ^ services detect:[:any| (any isKindOf: CodeHighlightingService)] ifNone:nil
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2511
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2512
13125
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2513
unregisterAllServices
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2514
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2515
    services copy do:[:eachService | self unregisterService:eachService ].
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2516
!
71954878986b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13110
diff changeset
  2517
11616
c23e4a5d3384 added: #unregisterService:
Claus Gittinger <cg@exept.de>
parents: 11606
diff changeset
  2518
unregisterService: aCodeViewService
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2519
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2520
    services remove: aCodeViewService ifAbsent:[^self].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2521
    aCodeViewService unregister.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2522
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2523
    "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
  2524
    "Created: / 19-07-2012 / 16:34:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2525
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2526
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2527
!CodeView2 methodsFor:'testing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2528
14915
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2529
hasOwnScrollbars
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2530
    "a hack for codeView2, which behaves like a TextView, but has its own
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2531
     scrollbars embedded - sigh (an extra load one).
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2532
     This allows for the UIBuilder to avoid creating an extra set around such
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2533
     a view (as is the case with TextSpec with scrollbars when using CodeView2)"
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2534
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2535
    ^ true
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2536
!
f7a2835e0040 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14851
diff changeset
  2537
10722
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2538
isCodeView2
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2539
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2540
    ^true
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2541
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2542
    "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
  2543
!
b5c270e3971c category of: #isCodeView2
Claus Gittinger <cg@exept.de>
parents: 10708
diff changeset
  2544
18141
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2545
isReadOnly
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2546
    ^textView isReadOnly
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2547
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2548
    "Created: / 22-05-2018 / 15:34:26 / Claus Gittinger"
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2549
!
836849c8c846 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18116
diff changeset
  2550
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2551
isTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2552
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2553
    ^true
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2554
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2555
    "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
  2556
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2557
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2558
!CodeView2::AnnotationShowingScrollerBackground class methodsFor:'documentation'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2559
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2560
documentation
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2561
"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2562
    I am a scroller background used to show annotation positions
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2563
    (very similar to the DiffTextScrollerBackground).
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2564
    I draw little markers at positions where annotations are.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2565
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2566
    I need a reference to the textView and the list of annotations.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2567
"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2568
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2569
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2570
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'accessing'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2571
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2572
annotations:aCollectionOfAnnotations
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2573
    annotations := aCollectionOfAnnotations.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2574
!
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2575
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2576
breakpoints:aCollectionOfBreakpoints
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2577
    breakpoints := aCollectionOfBreakpoints.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2578
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2579
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2580
textView:something
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2581
    textView := something.
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2582
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2583
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2584
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'drawing'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2585
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2586
fillRectangleX:x y:y width:w height:h in:aScroller
16620
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2587
    "I am asked to draw the background of aScroller.
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2588
     If any annotation is in that range, draw it"
5fbb028b00dd #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16613
diff changeset
  2589
    
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2590
    |overAllHeight drawRect scrollerHeight|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2591
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2592
    annotations isEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2593
        breakpoints isEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2594
            ^ self 
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2595
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2596
    ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2597
    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2598
    scrollerHeight := aScroller height.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2599
    drawRect :=
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2600
        [:lineNr :clrInside |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2601
            |clrBorder yThumb|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2602
            
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2603
            yThumb := (scrollerHeight * (lineNr / overAllHeight)) rounded.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2604
            (yThumb between:y-5 and:(y + h + 5)) ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2605
                clrBorder := clrInside darkened.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2606
                aScroller paint:clrInside.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2607
                aScroller fillRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:8.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2608
                aScroller paint:clrBorder.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2609
                aScroller displayRectangleX:3 y:(yThumb-5 max:0) width:aScroller width-5 height:9.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2610
            ].    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2611
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2612
        
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2613
    overAllHeight := textView numberOfLines.
19122
3c948e229a60 #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 19098
diff changeset
  2614
    overAllHeight == 0 ifTrue:[ ^ self ].
14992
d8e909bf2407 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14988
diff changeset
  2615
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2616
    annotations notEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2617
        annotations do:[:eachAnnotation |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2618
            |lineNr severityColor severity|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2619
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2620
            (lineNr := eachAnnotation line) notNil ifTrue:[ 
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2621
                severity := eachAnnotation rule severity.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2622
                severity == #error ifTrue:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2623
                    severityColor := Color red.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2624
                ] ifFalse:[
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  2625
                    severity == #warning ifTrue:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2626
                        severityColor := Color yellow.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2627
                    ] ifFalse:[
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2628
                        severityColor := Color blue.
16578
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2629
                    ].    
5158bde22d4c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16577
diff changeset
  2630
                ].    
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2631
                drawRect value:lineNr value:severityColor lightened.
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2632
            ].
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2633
        ].
16890
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2634
    ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2635
    breakpoints notEmptyOrNil ifTrue:[
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2636
        breakpoints do:[:eachBreakpoint |
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2637
            (eachBreakpoint isVisible and:[eachBreakpoint isEnabled]) ifTrue:[ 
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2638
                |lineNr bpntColor|
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2639
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2640
                (lineNr := eachBreakpoint line) notNil ifTrue:[    
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2641
                    bpntColor := eachBreakpoint isTracepoint
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2642
                                    ifTrue:[ Color blue lightened]
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2643
                                    ifFalse:[ Color red ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2644
                    drawRect value:lineNr value:bpntColor.
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2645
                ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2646
            ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2647
        ].
8b4fad7fb72d #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16865
diff changeset
  2648
    ].
14986
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2649
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2650
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2651
!CodeView2::AnnotationShowingScrollerBackground methodsFor:'ignored conversion'!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2652
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2653
asFormOn:aDevice
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2654
    "superclass AbstractBackground says that I am responsible to implement this method"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2655
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2656
    ^ self 
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2657
!
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2658
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2659
onDevice:aDevice
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2660
    "superclass AbstractBackground says that I am responsible to implement this method"
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2661
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2662
    ^ self 
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2663
! !
7f39d0272ebc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14983
diff changeset
  2664
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2665
!CodeView2::GutterView class methodsFor:'defaults'!
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2666
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2667
updateStyleCache
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2668
    DefaultLineNrColor := StyleSheet 
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2669
                            colorAt:#'gutter.lineNrColor' 
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2670
                            default:[
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2671
                                View defaultViewBackgroundColor brightness < 0.8 
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2672
                                    ifTrue:[Color grey:75]
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2673
                                    ifFalse:[Color grey]]
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2674
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2675
    "Created: / 28-08-2018 / 14:59:31 / Claus Gittinger"
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2676
! !
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  2677
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2678
!CodeView2::GutterView class methodsFor:'documentation'!
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2679
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2680
documentation
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2681
"
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2682
    documentation to be added.
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2683
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2684
    [author:]
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2685
        stefan
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2686
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2687
    [instance variables:]
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2688
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2689
    [class variables:]
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2690
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2691
    [see also:]
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2692
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2693
"
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2694
! !
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2695
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2696
!CodeView2::GutterView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2697
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2698
compareAction
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2699
    ^ compareAction
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2700
!
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2701
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2702
compareAction:something
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2703
    compareAction := something.
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2704
!
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2705
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2706
menuHolder:aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2707
    menuHolder := aValueThing
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2708
!
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2709
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2710
setTextView: aTextView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2711
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2712
    self assert: textView isNil message:'Attempting to set textView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2713
    textView := aTextView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2714
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2715
    textView addDependent:self.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2716
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2717
    "/ self backgroundPaint: textView backgroundPaint darkened lighter.
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  2718
    self viewBackground: (View defaultBackgroundColor). "/ textView backgroundPaint darkened lighter.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2719
    self paint: textView paint.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2720
    self font: textView font.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2721
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2722
    "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
  2723
    "Modified: / 14-12-2009 / 15:09:29 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2724
    "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
  2725
    "Modified: / 17-08-2011 / 15:15:09 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2726
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2727
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2728
setTextViewScroller:aScr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2729
    textViewScroller := aScr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2730
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2731
    "Created: / 07-12-2009 / 22:36:31 / Jindra <a>"
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2732
!
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2733
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2734
showLineNumbers:aBoolean
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2735
    "can be used to turn off linenumber drawing, 
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2736
     in case the gutter is used with another view anf only the other features (breakpoints) are needed"
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2737
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2738
    showLineNumbers := aBoolean.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2739
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2740
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2741
!CodeView2::GutterView methodsFor:'accessing-dimensions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2742
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2743
acceptButtonBottom
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2744
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2745
    ^(self height * 0.6) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2746
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2747
    "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
  2748
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2749
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2750
acceptCancelRight
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2751
    ^((self paddingLeft) + self usedWidthForAcceptCancel)
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2752
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2753
    "Created: / 10-09-2013 / 03:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2754
    "Modified: / 14-02-2014 / 12:06:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2755
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2756
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2757
cancelButtonBottom  
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2758
10791
a12cd2d06fe3 Bug fix in accept/cancel bar redraw
vrany
parents: 10788
diff changeset
  2759
    ^(self height * 0.8) ceiling.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2760
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2761
    "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
  2762
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2763
18522
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2764
computePreferredExtent
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2765
    | font w h |
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2766
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2767
    font := self font.
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2768
    w := (font widthOf:'00') + self padding.
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2769
    h := textView notNil 
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2770
            ifTrue:[textView height] 
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2771
            ifFalse:[font height * 12].
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2772
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2773
    ^ (preferredExtent := w @ h)
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2774
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2775
    "Created: / 09-11-2018 / 20:03:11 / Claus Gittinger"
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2776
!
abbfc74aa427 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18518
diff changeset
  2777
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2778
padding
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2779
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2780
    ^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
  2781
        + self usedWidthForAcceptCancel    
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2782
        + (widthAnnotations ? 0) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2783
        + (widthDiffInfo ? 0)
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2784
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2785
    "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
  2786
    "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
  2787
    "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
  2788
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2789
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2790
paddingLeft
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2791
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2792
    ^0"px"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2793
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2794
    "Created: / 14-02-2010 / 22:27:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2795
    "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
  2796
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2797
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2798
paddingRight
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2799
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2800
    ^3"px"
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: / 14-02-2010 / 22:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2803
    "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
  2804
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2805
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  2806
usedWidthForAcceptCancel
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2807
    ^ (codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[widthAcceptCancel ? 0] ifFalse:[0]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2808
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2809
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2810
!CodeView2::GutterView methodsFor:'actions'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2811
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2812
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2813
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2814
    textView accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2815
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2816
    "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
  2817
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2818
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2819
cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2820
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2821
    textView cancel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2822
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2823
    "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
  2824
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2825
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2826
compare
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2827
    "diff agains original version"
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2828
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2829
    compareAction value.
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2830
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  2831
    "Created: / 27-04-2018 / 16:51:09 / stefan"
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2832
!
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2833
13108
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2834
inspectView
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2835
    self halt.
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2836
!
a403bad1bc7f codeView2 fixes
Claus Gittinger <cg@exept.de>
parents: 13105
diff changeset
  2837
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2838
middleButtonMenu    
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2839
    menuHolder notNil ifTrue:[^ menuHolder value].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  2840
    codeView isNil ifTrue:[^ nil].
13097
0244f714f047 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2841
    ^ codeView servicesMenu
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2842
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2843
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2844
!CodeView2::GutterView methodsFor:'aspects'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2845
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2846
currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2847
    "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2848
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2849
    currentBlockNodeHolder isNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2850
        currentBlockNodeHolder := ValueHolder new.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2851
        currentBlockNodeHolder addDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2852
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2853
    ^ currentBlockNodeHolder
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2854
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2855
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2856
currentBlockNodeHolder:something
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2857
    "set the 'currentBlockNodeHolder' value holder (automatically generated)"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2858
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2859
    |oldValue newValue|
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2860
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2861
    currentBlockNodeHolder notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2862
        oldValue := currentBlockNodeHolder value.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2863
        currentBlockNodeHolder removeDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2864
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2865
    currentBlockNodeHolder := something.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2866
    currentBlockNodeHolder notNil ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2867
        currentBlockNodeHolder addDependent:self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2868
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2869
    newValue := currentBlockNodeHolder value.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2870
    oldValue ~~ newValue ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2871
        self update:#value with:newValue from:currentBlockNodeHolder.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2872
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2873
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  2874
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2875
!CodeView2::GutterView methodsFor:'change & update'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2876
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2877
adjustSizeForLongestLine
17767
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2878
    <resource: #obsolete>
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2879
    "recompute the required width (longest linenumber present, not shown)"
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2880
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2881
    ^ self adjustSizeForLongestLineNumber
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2882
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2883
    "Modified: / 19-11-2017 / 14:02:57 / cg"
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2884
!
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2885
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2886
adjustSizeForLongestLineNumber
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2887
    "recompute the required width (longest linenumber present, not shown)"
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2888
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2889
    |newNumberOfLines longestLineString textW requiredW newWidth|
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2890
13568
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2891
    showLineNumbers ifFalse:[^ self].
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2892
18039
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
  2893
    newNumberOfLines := (textView numberOfLines max:textView cursorLine).
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2894
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2895
    longestLineString := self displayedString:(newNumberOfLines max:99).
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2896
    textW := (longestLineString widthOn:self).
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2897
    requiredW := textW + self padding.
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2898
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2899
    ((requiredW > width) or:[requiredW < (width * 3 // 4)]) ifTrue:[
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2900
        "/ some hysteresis to avoid quick readjust again
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  2901
        newWidth := (requiredW "* 1.1") rounded.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2902
        self corner:(newWidth+1 @ 1.0).
13316
1f476bdeb46c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13213
diff changeset
  2903
13085
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2904
        [
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2905
            textView removeDependent:self.
13568
c251f9a016d9 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13567
diff changeset
  2906
            textViewScroller notNil ifTrue:[ textViewScroller origin:(newWidth+1 @ 0.0) corner:(1.0 @ 1.0) ].
13085
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2907
        ] ensure:[
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2908
            textView addDependent:self.
42d374ca3b6e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13072
diff changeset
  2909
        ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2910
        self invalidate.
13098
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2911
    ] ifFalse:[
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2912
        numberOfLines ~= newNumberOfLines ifTrue:[
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2913
            self invalidate
ce4a7109bbcd class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13097
diff changeset
  2914
        ]
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2915
    ].
17767
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2916
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2917
    "Created: / 19-11-2017 / 14:01:49 / cg"
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2918
!
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2919
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2920
update:something with:aParameter from:changedObject
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2921
    |deltaY numPixels hScrollerHeight|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2922
10326
Claus Gittinger <cg@exept.de>
parents: 10312
diff changeset
  2923
    (changedObject == textView) ifTrue:[
17618
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2924
        something == #pointerInView ifTrue:[
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2925
            ^ self.
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2926
        ].    
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2927
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2928
        something == #font ifTrue:[
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2929
            |sz|
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2930
            
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2931
            sz := textView font size.
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2932
            self font:(self font asSize:sz).
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2933
            self invalidate.
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2934
            ^ self.
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2935
        ].
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2936
        
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2937
        ((something == #sizeOfContents)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2938
        or:[ "false "(something == #visibility)"" ]) ifTrue:[
17767
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2939
            self adjustSizeForLongestLineNumber.
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2940
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2941
            "/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2942
            "/     self invalidate.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2943
            "/ ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2944
            ^ self.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2945
        ].
17618
bedd937b4de6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17502
diff changeset
  2946
        
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2947
        something == #originOfContents ifTrue:[
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2948
            aParameter notNil ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2949
                deltaY := aParameter y.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2950
                deltaY = 0 ifTrue:[^ self].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2951
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2952
                numPixels := deltaY abs.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2953
                numPixels < (height // 5) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2954
                    deltaY < 0 ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2955
                        self invalidateX:0 y:0 width:width height:numPixels.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2956
                    ] ifFalse:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2957
                        hScrollerHeight := 0.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2958
                        (textViewScroller notNil
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2959
                        and:[textViewScroller horizontalScrollBar notNil]) ifTrue:[
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2960
                            hScrollerHeight := textViewScroller horizontalScrollBar height.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2961
                        ].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2962
                        numPixels := numPixels + 4.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2963
                        self invalidateX:0 y:height-numPixels-hScrollerHeight width:width height:numPixels+hScrollerHeight.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2964
                    ].
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  2965
                    "/ self repairDamage.
14127
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2966
                    ^ self.
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2967
                ].
7bc7d22565b3 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14110
diff changeset
  2968
            ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2969
            self invalidateLines.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2970
            ^ self.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2971
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2972
        "/ something printCR.
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  2973
    ].
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  2974
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2975
    (changedObject == textView reallyModifiedChannel) ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2976
        self invalidateAcceptCancelBar.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2977
        ^self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  2978
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2979
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2980
    super update:something with:aParameter from:changedObject
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2981
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  2982
    "Modified: / 14-02-2014 / 12:08:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17767
195cf7c7e58f #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17718
diff changeset
  2983
    "Modified: / 19-11-2017 / 14:02:08 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2984
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2986
!CodeView2::GutterView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2987
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2988
buttonMultiPress: btn x: x y: y
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2989
    |acceptCancelBarWidthOrZero extraSafeArea|
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  2990
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2991
    Processor removeTimedBlock:blockWaitingForPossibleDoubleClick.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2992
    blockWaitingForPossibleDoubleClick := nil.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  2993
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  2994
    "/ for the embedded accept-cancel bar, if enabled
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2995
    (acceptCancelBarWidthOrZero := self usedWidthForAcceptCancel) ~~ 0 ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2996
        (x <= (self paddingLeft + acceptCancelBarWidthOrZero)) ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2997
            textView reallyModified ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2998
                (y < self acceptButtonBottom) ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  2999
                    ^self.
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3000
                ].
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3001
                (y < self cancelButtonBottom) ifTrue:[
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3002
                    ^self.            
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3003
                ].
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3004
            ].
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3005
            ^self.
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3006
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3007
    ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3008
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3009
    false ifTrue:[
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3010
        "Do not allow clicking on line numbers..."
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3011
        extraSafeArea := "('999' widthOn:self)" 5.
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3012
        x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3013
    ].
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3014
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3015
    codeView notNil ifTrue:[
19079
a7fc32763337 #OTHER by exept
Claus Gittinger <cg@exept.de>
parents: 19036
diff changeset
  3016
        ((x > (self paddingLeft + acceptCancelBarWidthOrZero)) or:
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3017
            [x < (self width - self paddingRight - widthDiffInfo)]
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3018
        ) ifTrue:[
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3019
            (codeView buttonMultiPress: btn x:x y:y in: self) ifTrue:[^ self].   "/ event eaten
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3020
        ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3021
    ].
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3022
    super buttonMultiPress: btn x: x y: y
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3023
!
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3024
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3025
buttonPress:btn x:x y:y
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3026
    btn == 1 ifTrue:[
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3027
        blockWaitingForPossibleDoubleClick :=
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3028
            [
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3029
                self nonMultiButtonPress:btn x:x y:y
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3030
            ].
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3031
        Processor 
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3032
            addTimedBlock:blockWaitingForPossibleDoubleClick 
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3033
            for:Processor activeProcess 
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3034
            afterMilliseconds:200.
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3035
    ] ifFalse:[
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3036
        super buttonPress:btn x:x y:y
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3037
    ].
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3038
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3039
    "Modified: / 02-03-2019 / 12:28:36 / Claus Gittinger"
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3040
!
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3041
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3042
mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3043
    "/ forward to my text view
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3044
    textView mouseWheelMotion:buttonState x:x y:y amount:amount deltaTime:dTime
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3045
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3046
    "Created: / 02-03-2019 / 12:02:52 / Claus Gittinger"
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3047
!
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3048
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3049
nonMultiButtonPress: btn x: x y: y
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3050
    "this is now called delayed for a single button press
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3051
     (i.e. if there is no other click within some time)"
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3052
11520
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  3053
    |extraSafeArea|
091c7e0e435a added a save-area (line-number) into which a click does not toggle
Claus Gittinger <cg@exept.de>
parents: 11467
diff changeset
  3054
14851
eeee217e8bee class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14850
diff changeset
  3055
    "/ for the embedded accept-cancel bar, if enabled
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3056
    (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
  3057
        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
  3058
            (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
  3059
                self accept.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3060
                ^self.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3061
            ].
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3062
            (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
  3063
                self cancel.
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3064
                ^self.            
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3065
            ].
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  3066
            self compare.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3067
        ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3068
        ^self.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3069
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3070
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3071
    false ifTrue:[
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3072
        "Do not allow clicking on line numbers..."
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3073
        extraSafeArea := "('999' widthOn:self)" 5.
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3074
        x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3075
    ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3076
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3077
    codeView notNil ifTrue:[
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3078
        ((x > (self paddingLeft + self usedWidthForAcceptCancel)) 
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3079
          or:[x < (self width - self paddingRight - widthDiffInfo)]
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3080
        ) ifTrue:[
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3081
            (codeView buttonPress:btn x:x y:y in:self) ifTrue:[^ self].   "/ event eaten
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3082
        ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3083
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3084
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3085
    super buttonPress:btn x:x y:y
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3086
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3087
    "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
  3088
    "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
18065
5f0dc2b1c237 #FEATURE by stefan
Stefan Vogel <sv@exept.de>
parents: 18039
diff changeset
  3089
    "Modified: / 27-04-2018 / 17:03:23 / stefan"
18642
7e2c1db00573 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18619
diff changeset
  3090
    "Modified: / 02-03-2019 / 12:27:39 / Claus Gittinger"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3091
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3092
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3093
sizeChanged:how
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3094
    super sizeChanged:how.
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  3095
    "/ self invalidateAcceptCancelBar.
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  3096
    self invalidate.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3097
    "Created: / 10-09-2013 / 03:19:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3098
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3099
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  3100
!CodeView2::GutterView methodsFor:'help'!
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  3101
17893
dea9d14caed4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 17809
diff changeset
  3102
helpTextAt:aPointOrNil
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3103
    |lineNr textCollector services|
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3104
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3105
    codeView isNil ifTrue:[^ nil].
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3106
    aPointOrNil isNil ifTrue:[^ nil].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3107
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3108
    lineNr := codeView lineAtY:aPointOrNil y.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3109
    lineNr isNil ifTrue:[^ nil].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3110
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3111
    textCollector := TextStream new.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3112
    
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3113
    "/ which service has an annotation for that line
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3114
    services := codeView services.
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3115
    "/ show lintservice-help first
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3116
    services := (services select:[:s | s isLintService])
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3117
                ,(services reject:[:s | s isLintService]).
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3118
                
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3119
    services do:[:eachService |
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3120
        |tooltip|
19333
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3121
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3122
        eachService enabled ifTrue:[
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3123
            tooltip := eachService helpTextAtLine:lineNr.
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3124
            tooltip notEmptyOrNil ifTrue:[
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3125
                textCollector notEmpty ifTrue:[ textCollector cr].
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3126
                textCollector nextPutAllText:tooltip withCRs.
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3127
                tooltip last == Character cr ifFalse:[textCollector cr].
e2b7b1048131 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 19184
diff changeset
  3128
            ].
14843
ab82df4f1f99 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14705
diff changeset
  3129
        ].
12903
22da380892a5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12870
diff changeset
  3130
    ].
16557
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3131
    textCollector isEmpty ifTrue:[ ^ nil ].
4039e1ff5147 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 16243
diff changeset
  3132
    ^ textCollector contents.    
11220
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  3133
! !
82c46989af92 flybyhelp in gutter
Claus Gittinger <cg@exept.de>
parents: 11179
diff changeset
  3134
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3135
!CodeView2::GutterView methodsFor:'initialize & release'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3136
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3137
initStyle
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3138
    super initStyle.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3139
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3140
    acceptColor := Color greenCaringForColorBlindness.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3141
    cancelColor := Color redCaringForColorBlindness.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3142
    diffColor := Color yellow.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3143
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3144
    acceptColor := acceptColor lighter onDevice:device.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3145
    cancelColor := cancelColor lighter lighter onDevice:device.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3146
    diffColor := diffColor lighter lighter onDevice:device.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3147
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3148
    lineNrColor := DefaultLineNrColor ? Color grey.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3149
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3150
    "Created: / 28-08-2018 / 14:58:43 / Claus Gittinger"
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3151
!
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3152
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3153
initialize
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 initialize.
11988
b482d2c77040 changed to not take up screen space for the accept/cancel gutter,
Claus Gittinger <cg@exept.de>
parents: 11903
diff changeset
  3156
14963
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3157
    blockWaitingForPossibleDoubleClick := nil.
7247ac7242bf class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14959
diff changeset
  3158
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3159
    showLineNumbers := true.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3160
    widthAcceptCancel := 16.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3161
    widthAnnotations := "16"8.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3162
    widthDiffInfo := 5.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3163
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3164
    self initStyle.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3165
14983
4e23aedeee9a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14963
diff changeset
  3166
    self enableMotionEvents.   "/ for per-line tooltips
4e23aedeee9a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14963
diff changeset
  3167
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3168
    "Created: / 16-06-2011 / 13:47:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17322
52be40f937e7 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 17254
diff changeset
  3169
    "Modified: / 03-02-2017 / 14:05:03 / cg"
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3170
    "Modified: / 28-08-2018 / 14:58:55 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3171
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3172
14545
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3173
release
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3174
    codeView removeDependent: self.  
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3175
    textView removeDependent: self.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3176
    currentBlockNodeHolder notNil ifTrue:[
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3177
        currentBlockNodeHolder removeDependent: self
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3178
    ].
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3179
    super release.
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3180
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3181
    "Created: / 23-06-2014 / 20:47:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3182
!
473b413f198b Added CodeView2>>release, GutterView>>release to release views from dependencies.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14521
diff changeset
  3183
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3184
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3185
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3186
    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
  3187
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3188
    codeView addDependent: self.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3189
    codeView reallyModifiedChannel addDependent: self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  3190
    "/ codeView currentBlockNodeHolder addDependent: self. - not needed; currentBlockNodeHolder: does it
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3191
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3192
    textView := aCodeView2 textView.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3193
    textView addDependent: self.
13993
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  3194
    "/ do not fetch stuff from others - let others give me things (caller change to send currentBlockNodeHolder: explicitly)
ec74fc4b84e5 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13978
diff changeset
  3195
    "/ self currentBlockNodeHolder: codeView currentBlockNodeHolder.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3196
    textViewScroller := aCodeView2 textViewScroller.
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  3197
    "/ self backgroundPaint: (textView viewBackground "backgroundPaint" blendWith: (Color gray:80)).
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  3198
    self viewBackground: (View defaultBackgroundColor).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3199
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3200
    "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
  3201
    "Modified: / 17-08-2011 / 15:15:55 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3202
    "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
  3203
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3204
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3205
!CodeView2::GutterView methodsFor:'queries'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3206
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3207
displayedString:lineNr
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3208
    "get text to display in gutter for specified list line number"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3209
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3210
    ^ (lineNr asString).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3211
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3212
    "Created: / 14-12-2009 / 13:37:47 / Jindra <a>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3213
    "Modified (format): / 28-04-2017 / 08:04:39 / cg"
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3214
!
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3215
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3216
lineColorForLine:lineNr
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3217
    "return special color for given line if required, nil otherwise"
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3218
    "used only if lineFont returns nil"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3219
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3220
    lineNrColor isNil ifTrue:[
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3221
        View defaultViewBackgroundColor brightness < 0.8 ifTrue:[
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3222
            lineNrColor := Color grey:75.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3223
        ] ifFalse:[    
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3224
            lineNrColor := Color grey.
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3225
        ].
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3226
    ].
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3227
    ^ lineNrColor.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3228
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3229
    "Created: / 14-12-2009 / 15:01:31 / Jindra <a>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3230
    "Modified: / 28-04-2017 / 08:04:53 / cg"
18362
89f3501aec41 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 18348
diff changeset
  3231
    "Modified: / 28-08-2018 / 15:05:44 / Claus Gittinger"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3232
!
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3233
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3234
lineDisplayable:lineNr
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3235
    "true if this list line can be displayed"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3236
    
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3237
    ^ (textView listLineIsVisible:lineNr)
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3238
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3239
    "Created: / 14-12-2009 / 13:38:23 / Jindra <a>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3240
    "Modified (format): / 28-04-2017 / 08:05:08 / cg"
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3241
!
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3242
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3243
lineFontForLine:lineNr
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3244
    "return special font for given line if required, nil otherwise"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3245
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3246
    ^ nil
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3247
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3248
    "Created: / 14-12-2009 / 14:40:17 / Jindra <a>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3249
    "Modified (format): / 28-04-2017 / 08:05:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3250
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3251
13566
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  3252
wantsFocusWithButtonPress
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  3253
    ^ false.
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  3254
!
e238ad7e24fc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13565
diff changeset
  3255
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3256
yOfTextViewLine:lineNr
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3257
    "defined to allow computation of a line below what is visible in
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3258
     the textView (because gutter may become higher than textView, iff
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3259
     the textView has a horizontal scrollbar"
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3260
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3261
    |visibleLineNr "{ Class: SmallInteger }"|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3262
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3263
    "/JV: BAD, BAD BAD - check senders, they must be prepared to get nil!!
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3264
    shown ifFalse:[^ nil].
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3265
    lineNr isNil ifTrue:[^ nil].
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3266
    
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3267
    visibleLineNr := lineNr - textView firstLineShown + 1.
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3268
    ^ textView yOfVisibleLine:visibleLineNr
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3269
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3270
    "Modified (format): / 28-08-2013 / 12:49:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3271
    "Modified (format): / 28-04-2017 / 08:06:18 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3272
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3273
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3274
!CodeView2::GutterView methodsFor:'redrawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3275
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3276
invalidateAcceptCancelBar
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3277
    | w |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3278
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  3279
    self usedWidthForAcceptCancel == 0 ifTrue:[^ self].
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3280
    w := self acceptCancelRight.
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3281
    w == 0 ifTrue:[ ^ self ].
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  3282
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3283
    self invalidateX:0 y:0 width:(w-1) height:(self height).
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3284
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3285
    "Created: / 10-09-2013 / 03:07:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3286
    "Modified: / 21-02-2014 / 21:50:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3287
    "Modified (format): / 28-04-2017 / 08:02:04 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3288
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3289
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3290
invalidateLines
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3291
    | x0 |
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3292
15520
ee71c6d3d759 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15475
diff changeset
  3293
    x0 := self acceptCancelRight "+ 1".
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3294
    self invalidateX:x0 y:0 width:(self width - x0) height:(self height).
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3295
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3296
    "Created: / 10-09-2013 / 03:08:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3297
    "Modified: / 14-02-2014 / 12:19:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3298
    "Modified (format): / 28-04-2017 / 08:02:36 / cg"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3299
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3300
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3301
redrawAcceptCancelBarX: x y: y width:w height:h
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3302
    | rw acceptRight acceptBottom cancelBottom |
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3303
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3304
    acceptRight := self acceptCancelRight.
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3305
    x >= acceptRight ifTrue:[
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3306
        ^ self.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3307
    ].
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3308
    rw := ((x + w) min: acceptRight) - x.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3309
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3310
    textView reallyModified ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3311
        gc fillRectangleX:x y:y width:rw height:h color: self viewBackground
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3312
    ] ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3313
        acceptBottom := self acceptButtonBottom.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3314
        cancelBottom := self cancelButtonBottom.
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3315
        (y < acceptBottom) ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3316
            gc fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3317
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3318
        (y < cancelBottom) ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3319
            gc fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3320
        ].
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3321
        ((y + h) >= cancelBottom) ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3322
            gc fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3323
        ]
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3324
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3325
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3326
    "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13978
f4adc42d7354 Fixed some redraw problems when internal accept-cancel is disabled.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13975
diff changeset
  3327
    "Modified: / 21-02-2014 / 21:49:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3328
    "Modified (format): / 28-04-2017 / 08:03:16 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3329
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3330
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3331
redrawBackgroundX:x y:y width:w height:h
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3332
    "redraws gutter background"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3333
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3334
    |savPaint|
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3335
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3336
    "background is filled with background color"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3337
    self 
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3338
        clearRectangleX:x y:y
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3339
        width:w height:h. 
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3340
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3341
    "separator line is drawn in grey"
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3342
    savPaint := self paint.
15521
fb618bbd9037 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15520
diff changeset
  3343
    self paint:Color grey.
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3344
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3345
    self 
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3346
        displayLineFromX:(width - 1) y:y
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3347
        toX:(width - 1) y:(y+h).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3348
13091
076f0ec1e120 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13085
diff changeset
  3349
    self paint:savPaint.
15521
fb618bbd9037 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15520
diff changeset
  3350
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3351
    "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3352
    "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
10577
ae449524a0b4 redrawing grey
Claus Gittinger <cg@exept.de>
parents: 10523
diff changeset
  3353
    "Modified: / 17-08-2011 / 15:12:47 / cg"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3354
    "Modified (comment): / 07-10-2011 / 19:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3355
    "Modified (format): / 28-04-2017 / 08:03:32 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3356
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3357
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3358
redrawLine:lineNr 
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3359
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3360
    ^ self redrawLine:lineNr cleared: false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3361
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3362
    "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17502
d46156d40277 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17501
diff changeset
  3363
    "Modified (format): / 28-04-2017 / 08:03:39 / cg"
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3364
    "Modified (format): / 29-01-2019 / 18:04:00 / Claus Gittinger"
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3365
!
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3366
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3367
redrawLine:lineNr cleared: cleared
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3368
    "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
  3369
    
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3370
    ^ self redrawLine:lineNr cleared:cleared drawServices:true
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3371
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3372
    "Modified (format): / 29-01-2019 / 18:03:56 / Claus Gittinger"
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3373
!
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3374
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3375
redrawLine:lineNr cleared:cleared drawServices:drawServices
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3376
    "redraws specified line. Returns width of drawn object.
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3377
     Color of drawn objects should be taken from lineFont, lineColor"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3378
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3379
    |lineString yTop yBaseline textViewFont fontAscent fontDescent
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3380
     textW requiredW oldFont newFont oldColor newColor 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3381
     myFont myFontAscent myFontDescent|
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3382
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3383
    shown ifFalse:[ ^ self ]. "/ Do not bother if the view is not shown.
13574
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3384
    textView isNil ifTrue:[^ self].     "/ happens when shown in UIPainter
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3385
        
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3386
    requiredW := self width.
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3387
    myFont := gc font.
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3388
    textViewFont := textView font.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3389
    
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3390
    showLineNumbers ifTrue:[
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3391
        lineString := self displayedString:lineNr.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3392
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3393
        textW := (lineString widthOn:self).
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3394
        requiredW := textW + self padding.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3395
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3396
        oldFont := myFont.
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3397
        oldColor := gc paint.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3398
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3399
        newFont := self lineFontForLine:lineNr.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3400
        newFont isNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3401
            newFont := oldFont.
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3402
            newColor := self lineColorForLine:lineNr.
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3403
            newColor notNil ifTrue:[ gc paint:newColor ].
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3404
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3405
        newFont ~~ oldFont ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3406
            "/ ensure that the line number lines are not higher than the text lines
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3407
            (newFont heightOn:device) > (textViewFont heightOn:device) ifTrue:[
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3408
                newFont := textViewFont.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3409
            ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3410
            newFont ~~ oldFont ifTrue:[
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3411
                self font:newFont.
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3412
                myFont := gc font.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3413
            ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3414
        ].
11424
69b3960c7757 care for small text-font in gutterview
Claus Gittinger <cg@exept.de>
parents: 11398
diff changeset
  3415
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3416
16243
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3417
    fontAscent := textViewFont ascentOn:device.
d10057b93404 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 16148
diff changeset
  3418
    fontDescent := textViewFont descentOn:device.
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3419
    myFontAscent := myFont ascent.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3420
    myFontDescent := myFont descent.
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3421
    
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3422
    yTop := (self yOfTextViewLine:lineNr) ? 0.
13574
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3423
    yBaseline := yTop + fontAscent.
95c71c5bc71c class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13569
diff changeset
  3424
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3425
    cleared ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3426
        gc 
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3427
            clearRectangleX:0 y:(yBaseline - myFontAscent) 
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3428
            width:(width - 2) height:(myFontAscent + myFontDescent).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3429
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3430
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3431
    "/ cg: this should be done differently: services know about the
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3432
    "/ gutter, so they should respond to a special drawGutter message.
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3433
    "/ otherwise, some redraws become unusably slow (especially
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3434
    "/ with multiple fonts/colors/emphases)...
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3435
    drawServices ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3436
        "Let services draw annotations and other stuff"
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3437
        codeView notNil ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3438
            codeView
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3439
                drawLine:lineNr in:self
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3440
                atX:(self acceptCancelRight + 1) y:yBaseline 
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3441
                width:widthAnnotations height:(myFont height) ascent:myFontAscent
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3442
                from:nil to:nil with:(self paint) and:(self backgroundColor).
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3443
        ]
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3444
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3445
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3446
    showLineNumbers ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3447
        gc displayString:lineString x:(width - widthDiffInfo - textW) y:yBaseline.
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3448
        newFont notNil ifTrue:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3449
            gc font:oldFont.
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3450
            gc paint:oldColor
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3451
        ] ifFalse:[
17254
e3d0bbb6b28f #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17242
diff changeset
  3452
            newColor notNil ifTrue:[ gc paint:oldColor ].
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3453
        ].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3454
    ].
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3455
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3456
    "/ If the view has been cleared here, we have also to redraw corresponding portion
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3457
    "/ of accept/cancel bar !!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3458
    cleared ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3459
        "/ In that case it was cleared above.
16607
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3460
        self redrawAcceptCancelBarX:0 y:(yBaseline - myFontAscent)
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3461
             width:width - 2
45afee69027d #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 16587
diff changeset
  3462
             height:(myFontAscent + myFontDescent).
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3463
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3464
    ^ requiredW.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3465
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3466
    "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3467
    "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
  3468
    "Modified: / 18-07-2012 / 19:05:24 / cg"
13943
510f0343785e Fixes off-by-one error when drawing annotations.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 13942
diff changeset
  3469
    "Modified: / 14-02-2014 / 17:58:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3470
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3471
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3472
redrawLinesFrom:startLineNr
13057
c3a27ef337d6 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13051
diff changeset
  3473
    "/ cg: obsolete?
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3474
    startLineNr to: (textView lastLineShown - 1 min: textView list size) do:[:line|
14520
777b5112f927 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14519
diff changeset
  3475
        self redrawLine:line cleared:false drawServices:true.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3476
    ]
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3477
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  3478
    "Created: / 06-07-2011 / 17:25:36 / jv"
10312
5b281e46f943 Fixes to avoid unncessary redraws of GutterView
vrany
parents: 10293
diff changeset
  3479
    "Modified: / 12-07-2011 / 17:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3480
    "Modified (format): / 29-01-2019 / 18:04:11 / Claus Gittinger"
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3481
!
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3482
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3483
redrawVisibleLine:lineNr 
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3484
    |absLineNr|
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3485
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3486
    (absLineNr := textView visibleLineToListLine:lineNr) notNil ifTrue:[
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3487
        self redrawLine:absLineNr cleared: false.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3488
    ].
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3489
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3490
    "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18570
af5090246f84 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 18537
diff changeset
  3491
    "Modified (format): / 29-01-2019 / 18:04:26 / Claus Gittinger"
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3492
!
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3493
13105
4e02e8dc7d4b class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13098
diff changeset
  3494
redrawX:x y:y width:w height:h
13213
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3495
    |firstLine lastLine yBot|
8beb5ac28bf7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13208
diff changeset
  3496
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3497
    self redrawBackgroundX:x y:y width:w height:h.
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3498
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3499
    (codeView notNil and:[codeView showAcceptCancelBar]) ifTrue:[    
10793
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3500
        self redrawAcceptCancelBarX:x y:y width:w height:h.
c19380a197aa Added channel for controlling visibility of accept/cancel
vrany
parents: 10791
diff changeset
  3501
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3502
13575
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3503
    "/ textview may be nil, if Gutter is shown in the UIPainter!!
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3504
    textView notNil ifTrue:[
18039
1b9aabb9f18a #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17928
diff changeset
  3505
        numberOfLines := (textView numberOfLines max:textView cursorLine).
13575
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3506
        yBot := y + h.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3507
        firstLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:y).
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3508
        lastLine := textView visibleLineToAbsoluteLine:(textView visibleLineOfY:yBot-1).
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3509
        lastLine := lastLine min:numberOfLines.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3510
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3511
        firstLine to:lastLine do: [:line | 
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3512
            self redrawLine:line cleared:true drawServices:true.
a3a8f530bf16 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13574
diff changeset
  3513
        ].
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3514
    ]
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3515
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3516
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3517
!CodeView2::TextView methodsFor:'accessing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3518
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3519
changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3520
    ^ changedDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3521
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3522
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3523
changedDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3524
    changedDiffText := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3525
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3526
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3527
changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3528
    ^ changedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3529
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3530
    "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3531
    "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3532
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3533
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3534
changedLines:something 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3535
    changedLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3536
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3537
    "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3538
    "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3539
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3540
15130
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3541
codeView
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3542
    ^ codeView
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3543
!
1e1510171b15 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14997
diff changeset
  3544
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3545
contents: text
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3546
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3547
    super contents: text.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3548
    reallyModifiedChannel value: false.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3549
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3550
    "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
  3551
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3552
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3553
contents: text clear: clearPrevious
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3554
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3555
    | savedListOriginal |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3556
    savedListOriginal := listOriginal.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3557
    super contents: text.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3558
    listOriginal := savedListOriginal.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3559
    self updateReallyModified.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3560
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3561
    "Created: / 17-02-2012 / 00:35:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3562
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3563
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3564
deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3565
    ^  deletedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3566
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3567
    "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3568
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3569
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3570
deletedLines:something 
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3571
    deletedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3572
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3573
    "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3574
    "Modified (format): / 17-07-2012 / 18:56:44 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3575
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3576
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3577
diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3578
    ^ diffMode
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3579
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3580
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3581
diffMode:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3582
    diffMode := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3583
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3584
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3585
emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3586
    ^ emptyLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3587
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3588
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3589
emptyLines:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3590
    emptyLines := something.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3591
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3592
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3593
fontAscent
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3594
    ^fontAscent notNil ifTrue:[fontAscent] ifFalse:[super fontAscent]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3595
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3596
    "Created: / 19-05-2012 / 14:13:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3597
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3598
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3599
insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3600
    ^  insertedLines
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3601
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3602
    "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3603
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3604
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3605
insertedLines:something 
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3606
    insertedLines := something.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3607
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3608
    "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
11597
Claus Gittinger <cg@exept.de>
parents: 11559
diff changeset
  3609
    "Modified (format): / 17-07-2012 / 18:56:50 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3610
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3611
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3612
originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3613
    ^ originDiffText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3614
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3615
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3616
originDiffText:something
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3617
    originDiffText := something.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3618
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3619
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3620
reallyModified
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3621
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3622
    ^self reallyModifiedChannel value
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3623
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3624
    "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
  3625
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3626
17809
d513e6482510 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 17770
diff changeset
  3627
!CodeView2::TextView methodsFor:'accessing-color & font'!
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3628
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3629
colorChanged
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3630
    ^ Color redByte:240 greenByte: 192 blueByte: 192
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3631
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3632
    "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
  3633
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3634
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3635
colorDeleted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3636
    ^ self colorInserted.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3637
    "/^ Color pink
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3638
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3639
    "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
  3640
    "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
  3641
    "Modified (format): / 17-07-2012 / 18:57:14 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3642
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3643
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3644
colorInserted
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3645
    ^ Color redByte: 239 greenByte: 225 blueByte: 152
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3646
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3647
    "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
  3648
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3649
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3650
!CodeView2::TextView methodsFor:'accessing-contents'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3651
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3652
list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3653
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3654
    super list:aCollection expandTabs:expand scanForNonStrings:scan includesNonStrings:nonStrings.
13517
7cf990f83349 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13456
diff changeset
  3655
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3656
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  3657
    reallyModifiedChannel value: false.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3658
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3659
    "/JV: used to be notifyLines... but that method
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3660
    "/    leaves suppressNotifications to true, which is not what
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3661
    "/    we want!!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3662
    self updateReallyModified.
17770
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  3663
    
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  3664
    "/ sorry Jan, but your code is very misleading here;
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  3665
    "/ you are not remembering any modifications, but instead just forcing a redraw;
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  3666
    "/ so why not calling it as such????
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3667
    codeView linesModifiedFrom: 1 to: list size.
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3668
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3669
    "Created: / 08-10-2011 / 12:23:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3670
    "Modified (comment): / 03-08-2013 / 13:35:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17770
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  3671
    "Modified (comment): / 19-11-2017 / 14:17:48 / cg"
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3672
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  3673
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3674
setList:aCollection expandTabs:expandTabs redraw:doRedraw
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3675
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3676
    super setList:aCollection expandTabs:expandTabs redraw:doRedraw.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3677
    listOriginal := aCollection copy.
10834
b25dd8ee319b changed: #initialize
vrany
parents: 10793
diff changeset
  3678
    reallyModifiedChannel value: false.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3679
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3680
    "/JV: used to be notifyLines... but that method
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3681
    "/    leaves suppressNotifications to true, which is not what
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3682
    "/    we want!!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3683
    self updateReallyModified.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3684
    codeView linesModifiedFrom: 1 to: list size.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3685
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3686
    "Created: / 07-10-2011 / 18:42:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3687
    "Modified (comment): / 03-08-2013 / 13:35:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3688
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3689
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3690
!CodeView2::TextView methodsFor:'accessing-look'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3691
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3692
lineSpacing
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3693
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3694
    ^lineSpacing
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3695
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3696
    "Modified: / 22-05-1996 / 12:22:29 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3697
    "Created: / 19-03-2012 / 13:22:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3698
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3699
10785
vrany
parents: 10784
diff changeset
  3700
!CodeView2::TextView methodsFor:'accessing-state'!
vrany
parents: 10784
diff changeset
  3701
vrany
parents: 10784
diff changeset
  3702
beUnmodified
vrany
parents: 10784
diff changeset
  3703
vrany
parents: 10784
diff changeset
  3704
    self modifiedChannel value: false.
vrany
parents: 10784
diff changeset
  3705
    reallyModifiedChannel value: false.
vrany
parents: 10784
diff changeset
  3706
    listOriginal := list copy.
vrany
parents: 10784
diff changeset
  3707
vrany
parents: 10784
diff changeset
  3708
    "Created: / 08-10-2011 / 12:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3709
!
vrany
parents: 10784
diff changeset
  3710
vrany
parents: 10784
diff changeset
  3711
isModified
vrany
parents: 10784
diff changeset
  3712
vrany
parents: 10784
diff changeset
  3713
    ^self modified
vrany
parents: 10784
diff changeset
  3714
vrany
parents: 10784
diff changeset
  3715
    "Created: / 08-10-2011 / 12:52:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3716
!
vrany
parents: 10784
diff changeset
  3717
vrany
parents: 10784
diff changeset
  3718
isReallyModified
vrany
parents: 10784
diff changeset
  3719
vrany
parents: 10784
diff changeset
  3720
    ^self reallyModified
vrany
parents: 10784
diff changeset
  3721
vrany
parents: 10784
diff changeset
  3722
    "Created: / 08-10-2011 / 12:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
vrany
parents: 10784
diff changeset
  3723
! !
vrany
parents: 10784
diff changeset
  3724
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3725
!CodeView2::TextView methodsFor:'bit blitting'!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3726
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3727
copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3728
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3729
    "/ If doing a vertical scroll, optimized Gutter redraw by
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3730
    "/ copying gutter's image...
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3731
    (scrollInProgress and:[aDrawable == self]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3732
        "/ Vertical scroll?
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3733
        ((srcY ~= dstY) and:[srcX = dstX]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3734
            "/ Do copy in gutter, but not accept-cancel bar!!
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3735
            | x0 |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3736
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3737
            x0 := gutterView acceptCancelRight.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3738
            gutterView
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3739
                copyFrom:gutterView
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3740
                       x:x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3741
                       y:srcY
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3742
                     toX:x0
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3743
                       y:dstY
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3744
                   width:(gutterView width - x0)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3745
                  height:h
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3746
                   async:false
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3747
        ]
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3748
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3749
    ^ super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3750
        copyFrom:aDrawable x:srcX y:srcY toX:dstX y:dstY width:w height:h async:async
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3751
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3752
    "Modified: / 14-02-2014 / 10:15:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3753
! !
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3754
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3755
!CodeView2::TextView methodsFor:'channels'!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3756
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3757
reallyModifiedChannel
13567
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3758
    "return the valueHolder holding true if text was really modified.
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3759
     This is different from #modified, as the inherited modified flag is cleared
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3760
     to trigger another change notification with every keystroke (for the syntaxHighighter).
e708e9c886e8 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13566
diff changeset
  3761
     This may be (now) considered a very bad hack"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3762
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3763
    ^ reallyModifiedChannel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3764
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3765
    "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
  3766
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3767
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3768
reallyModifiedChannel: aValueModel
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3769
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3770
    |prev|
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3771
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3772
    prev := reallyModifiedChannel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3773
    prev notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3774
        gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3775
            reallyModifiedChannel removeDependent: gutterView.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3776
        ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3777
    ].
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3778
    reallyModifiedChannel := aValueModel.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3779
    self setupChannel:aValueModel for:nil withOld:prev.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3780
    gutterView notNil ifTrue:[
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3781
        reallyModifiedChannel addDependent: gutterView.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3782
    ]
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3783
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3784
    "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
  3785
! !
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  3786
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3787
!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
  3788
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3789
isQuickMenuModifierPressed
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3790
    UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3791
        ^ self sensor ctrlDown
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3792
    ].
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3793
    ^ self sensor metaDown
12354
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3794
!
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3795
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3796
isQuickMenuModifierReleased
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3797
    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
  3798
        ^ 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
  3799
    ].
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3800
    ^ 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
  3801
! !
8aac48d63ded changed default for Jan's quick menus to use the ALT button isntead
Claus Gittinger <cg@exept.de>
parents: 12347
diff changeset
  3802
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3803
!CodeView2::TextView methodsFor:'drawing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3804
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3805
backgroundForVisibleLine:visLineNr default:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3806
    | lineNr |
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3807
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3808
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3809
    diffMode ifTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3810
        lineNr := self visibleLineToListLine:visLineNr.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3811
        (insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3812
            ^self colorInserted
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3813
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3814
        (changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3815
            ^self colorChanged
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3816
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3817
        (deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3818
            ^self colorDeleted
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3819
        ].
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3820
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3821
    ^ bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3822
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3823
    "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3824
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3825
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3826
drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3827
    "draw a visible line range in fg/bg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3828
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3829
    diffMode ifFalse:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3830
        super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3831
        ^self.
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3832
    ].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3833
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3834
    startVisLineNr to: endVisLineNr do:[:visLineNr|
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3835
        self drawVisibleLine: visLineNr with:fg and:bg
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3836
    ]
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3837
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3838
    "Modified: / 15-12-1999 / 23:19:39 / cg"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3839
    "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3840
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3841
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3842
drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3843
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3844
        drawLine:line
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3845
        fromX:x
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3846
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3847
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3848
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3849
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3850
    "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3851
    "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3852
    "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
  3853
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3854
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3855
drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3856
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3857
        drawLine:lineStringArg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3858
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3859
        col:col
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3860
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3861
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3862
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3863
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3864
    "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3865
    "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
  3866
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3867
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3868
drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3869
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3870
        drawLine:lineStringArg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3871
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3872
        from:startCol
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3873
        to:endColOrNil
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3874
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3875
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3876
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3877
    "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3878
    "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3879
    "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
  3880
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3881
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3882
drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3883
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3884
        drawLine:lineString
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3885
        inVisible:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3886
        from:startCol
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3887
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3888
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3889
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3890
    "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3891
    "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3892
    "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
  3893
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3894
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3895
drawVisibleLine:visLineNr with:fg and:bg
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3896
    super
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3897
        drawVisibleLine:visLineNr
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3898
        with:fg
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3899
        and:(self backgroundForVisibleLine:visLineNr default:bg).
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3900
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3901
    "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3902
    "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3903
    "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
  3904
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3905
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3906
redrawLines
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3907
    "redraw diff lines"
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  3908
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3909
    |i pom|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3910
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3911
    diffMode ifFalse:[^self].
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3912
    true ifTrue:[^self].
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3913
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3914
    pom := self hasSelection.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3915
    (pom) ifTrue:[ ^ self. ].
12992
d01df8476209 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12980
diff changeset
  3916
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3917
    i := 1.
14369
0c65610024eb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14321
diff changeset
  3918
    [ i <= (deletedLines size) ] whileTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3919
        ((deletedLines at:i) > 0) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3920
            super
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3921
                drawVisibleLine:(deletedLines at:i)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3922
                with:fgColor
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3923
                and:self colorDeleted.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3924
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3925
        i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3926
    ].
14369
0c65610024eb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14321
diff changeset
  3927
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3928
    i := 1.
14369
0c65610024eb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14321
diff changeset
  3929
    [ i <= (insertedLines size) ] whileTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3930
        ((insertedLines at:i) > 0) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3931
            super
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3932
                drawVisibleLine:(insertedLines at:i)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3933
                with:fgColor
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3934
                and:self colorInserted.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3935
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3936
        i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3937
    ].
14369
0c65610024eb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14321
diff changeset
  3938
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3939
    i := 1.
14369
0c65610024eb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14321
diff changeset
  3940
    [ i <= (changedLines size) ] whileTrue:[
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3941
        ((changedLines at:i) > 0) ifTrue:[
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3942
            super
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3943
                drawVisibleLine:(changedLines at:i)
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3944
                with:fgColor
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3945
                and:self colorChanged.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3946
        ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  3947
        i := i + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3948
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3949
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3950
    "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3951
    "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  3952
    "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
  3953
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3954
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3955
!CodeView2::TextView methodsFor:'editing'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  3956
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3957
deleteCharBeforeCursor
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3958
    "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
  3959
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3960
    "BIG FAT WARNING: This method is copied from TextEditView,
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3961
    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
  3962
    before the patch will be pushed up"
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3963
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3964
    |soCol wasOn lineNrAboveCursor ln originalLine prevTab|
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3965
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3966
    wasOn := self hideCursor.
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3967
12783
b52f85ed724e class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12782
diff changeset
  3968
    "JV@2012-01-06: Do not play with autoindent iff cursor is at the very beginning of the line"
18849
ebf4d59ded39 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18796
diff changeset
  3969
    (self autoIndent 
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3970
    and:[cursorCol ~~ 1
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3971
    and:[ (tabPositions includes:cursorCol) 
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3972
    ]]) ifTrue:[
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3973
        prevTab := (self prevTabBefore:cursorCol) max:1.
12782
08209e5c83aa class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12708
diff changeset
  3974
        "JV@2011-12-10: The list can be shorter than cursorLine,
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3975
         trailing because empty lines are not physically in the list."
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3976
        (list size >= cursorLine) ifTrue:[
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3977
            ln := originalLine := (list at:cursorLine) ? ''.
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3978
        ] ifFalse:[        
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3979
            ln := originalLine := ''.
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3980
        ].    
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3981
        ln size < prevTab ifTrue:[
18711
343ef798d22e #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18688
diff changeset
  3982
            ln := ln , (String new:prevTab).
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3983
        ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3984
        (ln copyTo:prevTab) isBlank ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3985
            (ln copyFrom:prevTab+1) isBlank ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3986
                cursorCol > prevTab ifTrue:[
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3987
                    self st80EditMode ifTrue:[
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3988
                        "/ ensure that there is no conflict here: st80EditMode will
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3989
                        "/ not allow a cursor position beyond the end of line,
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3990
                        "/ so avoid that cursorLine:col: will force us to the beginning of the line
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3991
                        originalLine size < prevTab ifTrue:[
12797
7428626b7c4a class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12787
diff changeset
  3992
                            self at:cursorLine put:ln
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3993
                        ]
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  3994
                    ].
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3995
                    self cursorLine:cursorLine col:prevTab.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3996
                    wasOn ifTrue:[ self showCursor ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3997
                    ^  self
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3998
                ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  3999
            ] ifFalse:[
16148
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4000
                "/ cg: this is ugly behavior; deleting multiple chars at the beginning
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4001
                "/ is annoying.
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4002
                "/ therefore, only do it, if there are only blanks after the cursor
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4003
"/                (ln copyFrom:prevTab+1 to:((cursorCol-1) min:ln size)) isBlank ifTrue:[
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4004
"/                    self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4005
"/                    self cursorLine:cursorLine col:prevTab.
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4006
"/                    wasOn ifTrue:[ self showCursor ].
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4007
"/                    ^  self.
86523ed1bb72 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 15893
diff changeset
  4008
"/                ]
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4009
            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4010
        ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4011
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4012
18849
ebf4d59ded39 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18796
diff changeset
  4013
"/        (self autoIndent
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4014
"/    and:[cursorCol  ~~ 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4015
"/    and:[cursorLine <= (list size)]])
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4016
"/     ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4017
"/        soCol := (self leftIndentForLine:cursorLine) + 1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4018
"/
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4019
"/        (cursorCol == soCol and:[soCol > 1]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4020
"/            ln := list at:cursorLine.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4021
"/            (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4022
"/                soCol := 1
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4023
"/            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4024
"/        ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4025
"/    ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4026
        soCol := 1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4027
"/    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4028
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4029
    (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
17675
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4030
        |sav|
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4031
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4032
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4033
         somewhere in the middle of a line
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4034
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4035
        self cursorLeft.
17675
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4036
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4037
        sav := trimBlankLines.
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4038
        trimBlankLines := false.
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4039
        [
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4040
            self deleteCharAtLine:cursorLine col:cursorCol.
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4041
        ] ensure:[
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4042
            trimBlankLines := sav
a260495128d3 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 17618
diff changeset
  4043
        ]
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4044
    ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4045
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4046
         at begin of line - merge with previous line;
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4047
         except for the very first line.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4048
        "
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4049
        (cursorLine == 1) ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4050
            lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4051
            lineNrAboveCursor < cursorLine ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4052
                (lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4053
                    "/ we are beyond the end of the text.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4054
                    "/ move the cursor to the previous line.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4055
                    self cursorLine:lineNrAboveCursor col:1.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4056
                ] ifFalse:[
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4057
                    self mergeLine:lineNrAboveCursor removeBlanks:false.
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4058
                ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4059
            ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4060
        ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4061
    ].
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4062
    wasOn ifTrue:[ self showCursor ]
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4063
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4064
    "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
  4065
    "Modified: / 06-01-2012 / 12:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18849
ebf4d59ded39 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 18796
diff changeset
  4066
    "Modified (comment): / 26-06-2019 / 23:18:36 / Claus Gittinger"
10971
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4067
!
aee24a2ac4fd Patch for #deleteCharBeforeCursor, should be moved to TextEditView
vrany
parents: 10970
diff changeset
  4068
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4069
getNewOriginText
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4070
    |i size pole pom text helperText|
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4071
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4072
    i := 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4073
    pole := list.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4074
    size := list size.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4075
    text:=''.
10877
1ed55c34722d changed:
Claus Gittinger <cg@exept.de>
parents: 10844
diff changeset
  4076
    emptyLines isNil ifTrue:[emptyLines := #()].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4077
    [ i <= size ] whileTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4078
        pom := emptyLines indexOf:i.
19122
3c948e229a60 #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 19098
diff changeset
  4079
        (pom == 0) ifFalse:[
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4080
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4081
            (helperText = '') ifFalse:[
19122
3c948e229a60 #TUNING by exept
Claus Gittinger <cg@exept.de>
parents: 19098
diff changeset
  4082
                (helperText isNil) ifTrue:[helperText:=''].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4083
                helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4084
                text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4085
            ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4086
        ] ifTrue:[
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4087
            helperText := pole at:i.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4088
            (helperText isNil)ifTrue:[helperText:=''].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4089
            helperText:=helperText,Character cr.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4090
            text := text asString , helperText asString.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4091
        ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4092
    i:=i+1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4093
    ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4094
^text
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4095
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4096
    "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4097
    "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
  4098
    "Modified: / 18-11-2011 / 14:58:22 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4099
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4100
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4101
!CodeView2::TextView methodsFor:'editing-basic'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4102
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4103
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
  4104
    "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
  4105
10731
5904065850c6 Fixed notification in #basicDeleteChars...
vrany
parents: 10728
diff changeset
  4106
    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
  4107
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4108
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4109
    "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
  4110
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4111
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4112
basicDeleteFromLine:startLineNr toLine:endLineNr 
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4113
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4114
    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
  4115
    self notifyLinesDeletedFrom:startLineNr to:endLineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4116
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4117
    "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
  4118
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4119
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4120
basicDeleteLineWithoutRedraw:lineNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4121
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4122
    super basicDeleteLineWithoutRedraw:lineNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4123
    self notifyLinesDeletedFrom: lineNr to: lineNr.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4124
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4125
    "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
  4126
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4127
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4128
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
  4129
    "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
  4130
     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
  4131
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4132
    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
  4133
    self notifyLinesModifiedFrom: lineNr to: lineNr.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4134
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4135
    "Created: / 16-09-2011 / 15:14:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18537
a5998a6acd1e #QUALITY by cg
Claus Gittinger <cg@exept.de>
parents: 18522
diff changeset
  4136
    "Modified (format): / 11-12-2018 / 11:54:14 / Claus Gittinger"
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4137
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4138
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4139
basicMergeLine:lineNr removeBlanks:removeBlanks
17501
60c0aff2ee87 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17464
diff changeset
  4140
    "merge line lineNr with line lineNr+1"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4141
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4142
    super basicMergeLine:lineNr removeBlanks:removeBlanks.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4143
    self notifyLinesDeletedFrom: lineNr + 1 to: lineNr + 1.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4144
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4145
    "Created: / 28-06-2011 / 09:13:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17501
60c0aff2ee87 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17464
diff changeset
  4146
    "Modified (comment): / 25-04-2017 / 12:34:30 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4147
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4148
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4149
basicSplitLine:lineNr before:colNr
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4150
10728
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4151
    super basicSplitLine:lineNr before:colNr.
463a51112b1d Possibly redraw-bug fix
vrany
parents: 10723
diff changeset
  4152
    self notifyLinesInsertedFrom: lineNr +1 to: lineNr + 1.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4153
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4154
    "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
  4155
!
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4156
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4157
basicWithoutRedrawInsertLines:lines from:start to:end before:lineNr
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4158
    super basicWithoutRedrawInsertLines:lines from:start to:end before:lineNr.
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4159
    self updateReallyModified.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4160
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4161
    "Modified: / 22-08-2018 / 10:15:58 / Claus Gittinger"
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4162
!
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4163
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4164
basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4165
    super basicWithoutRedrawInsertStringWithoutCRs:aString atLine:lineNr col:colNr.
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4166
    self updateReallyModified.
19017
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  4167
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  4168
    self assert:(aString includes:Character cr) not.
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  4169
    "/ no - there was no cr inserted
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  4170
    "/ codeView linesInsertedFrom:lineNr to:lineNr.
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4171
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4172
    "Modified: / 22-08-2018 / 09:27:20 / Claus Gittinger"
14439
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4173
!
6d02fc4b8ca0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14369
diff changeset
  4174
10977
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4175
insertLines:someText from:start to:end before:lineNr
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4176
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4177
    "/JV@2011-12-20: HACK, the super implementation should
19017
7cd4e774a02c #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 18988
diff changeset
  4178
    "/ don't use leftIndent...when pasting. Following is a workaround"
14959
b92ba3696c7f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14927
diff changeset
  4179
    self withAutoIndent:false do:[
12787
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  4180
        super insertLines:someText from:start to:end before:lineNr.
80349f0b6041 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12783
diff changeset
  4181
    ]
10977
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4182
a484c4cad7e0 fix in paste in autoIndent mode
vrany
parents: 10973
diff changeset
  4183
    "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
  4184
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4185
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4186
!CodeView2::TextView methodsFor:'event handling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4187
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4188
buttonMotion:button x:x y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4189
17242
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  4190
    (codeView buttonMotion:button x:x y:y in: self) ifFalse:[
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  4191
        super buttonMotion:button x:x y:y
d5090925b22c #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 17039
diff changeset
  4192
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4193
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4194
    "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
  4195
    "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
  4196
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4197
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4198
buttonPress: button x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4199
    | ctrlDown  |
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4200
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4201
    (codeView buttonPress:button x:x y:y in: self)
12870
798d611cfd62 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12869
diff changeset
  4202
        ifFalse:[super buttonPress:button x:x y:y].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4203
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4204
    ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil]) 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4205
        ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4206
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4207
        buttonPress: button
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4208
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4209
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4210
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4211
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4212
    "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
  4213
    "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
  4214
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4215
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  4216
buttonRelease: button x: x y: y
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  4217
    (codeView buttonRelease:button x:x y:y in: self)
12870
798d611cfd62 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12869
diff changeset
  4218
        ifFalse:[super buttonRelease:button x:x y:y].
12868
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  4219
!
79e40dd37b08 faster quick senders menu.
Claus Gittinger <cg@exept.de>
parents: 12797
diff changeset
  4220
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4221
exposeX:x y:y width:w height:h 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4222
    super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4223
        exposeX:x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4224
        y:y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4225
        width:w
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4226
        height:h.
13374
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  4227
4185e24179b7 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13316
diff changeset
  4228
    "/ if in diffmode...
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4229
    self redrawLines.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4230
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4231
    "Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4232
    "Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4233
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4234
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4235
keyPress:key x:x y:y
19184
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4236
    (codeView keyPress:key x:x y:y in: self) ifFalse:[
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4237
        super keyPress:key x:x y:y
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4238
    ].
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4239
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4240
    "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
  4241
    "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4242
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4243
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4244
keyRelease: key x: x y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4245
19184
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4246
    (codeView keyRelease:key x:x y:y in: self) ifFalse:[
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4247
        super keyRelease:key x:x y:y
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4248
    ].
9e5f22736f3a #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19170
diff changeset
  4249
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4250
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4251
    (key = #Control_L) ifTrue:
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4252
        [ codeView highlightClear. self redraw ].
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4253
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4254
    ^ super 
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4255
        keyRelease: key
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4256
        x: x
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4257
        y: y
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4258
    "
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4259
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4260
    "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
  4261
    "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
  4262
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4263
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4264
!CodeView2::TextView methodsFor:'initialization'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4265
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4266
initialize
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4267
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4268
    super initialize.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4269
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4270
    changedDiffText := true.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4271
    diffMode := false.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4272
    suppressNotifications := false.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4273
    reallyModifiedChannel := false asValue.
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4274
    scrollInProgress := false.
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4275
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  4276
    self enableMotionEvents.
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  4277
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4278
    "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
  4279
    "Modified: / 06-07-2011 / 17:46:31 / jv"
10630
d59bc761de55 fixed: #sendersMenu:selector:
Claus Gittinger <cg@exept.de>
parents: 10577
diff changeset
  4280
    "Modified: / 21-08-2011 / 10:09:29 / cg"
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4281
    "Modified: / 14-02-2014 / 10:31:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4282
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4283
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4284
setCodeView: aCodeView2
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4285
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4286
    codeView := aCodeView2.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4287
    codeView addDependent: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4288
    gutterView := aCodeView2 gutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4289
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4290
    "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
  4291
    "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
  4292
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4293
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4294
setGutterView: aGutterView
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4295
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4296
    self assert: gutterView isNil message:'Attempting to set gutterView twice'.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4297
    gutterView := aGutterView.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4298
    gutterView setTextView: self.
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4299
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4300
    "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
  4301
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4302
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4303
!CodeView2::TextView methodsFor:'menu & menu actions'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4304
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4305
accept
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4306
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4307
    super accept.
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4308
    reallyModifiedChannel value: false.
10785
vrany
parents: 10784
diff changeset
  4309
    listOriginal := list copy.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4310
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4311
    "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
  4312
!
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4313
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  4314
cancel
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  4315
10785
vrany
parents: 10784
diff changeset
  4316
    self list: listOriginal
10784
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  4317
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  4318
    "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
  4319
!
5a99ae3ce36a Fixes in built-in accept/cancel bar
vrany
parents: 10783
diff changeset
  4320
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4321
editMenu
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4322
11398
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4323
    ^ codeView editMenu
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4324
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4325
    "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
  4326
    "Modified (format): / 08-03-2012 / 12:30:22 / cg"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4327
!
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4328
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4329
searchVariableVisible
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4330
    "search variable option in searchbox visible?"
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4331
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4332
    ^ true
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4333
84d3987c0155 better search (for variables)
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4334
    "Created: / 08-03-2012 / 14:01:51 / cg"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4335
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4336
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4337
!CodeView2::TextView methodsFor:'notification'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4338
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4339
notifyLinesDeletedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4340
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4341
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4342
    suppressNotifications ifTrue:[^self].
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4343
    
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4344
    codeView linesDeletedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4345
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4346
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4347
    "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
  4348
    "Modified: / 06-07-2011 / 17:47:05 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4349
    "Modified: / 07-10-2011 / 19:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4350
    "Modified (format): / 22-08-2018 / 09:23:22 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4351
!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4352
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4353
notifyLinesInsertedFrom: startLine to: endLine
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4354
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4355
    self updateReallyModified.
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4356
    suppressNotifications ifTrue:[^self].
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4357
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4358
    codeView linesInsertedFrom: startLine to: endLine.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4359
    suppressNotifications := true.
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4360
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4361
    "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
  4362
    "Modified: / 06-07-2011 / 17:47:20 / jv"
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4363
    "Modified: / 07-10-2011 / 19:20:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4364
    "Modified (format): / 22-08-2018 / 09:21:08 / Claus Gittinger"
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4365
!
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4366
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4367
notifyLinesModifiedFrom: startLine to: endLine
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4368
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4369
    self updateReallyModified.
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4370
    suppressNotifications ifTrue:[^self].
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4371
    
10708
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4372
    codeView linesModifiedFrom: startLine to: endLine.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4373
    suppressNotifications := true.
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4374
dd79e944752e Fixes for syntax highlighting and code navigation. Now it should work fine debugger.
vrany
parents: 10689
diff changeset
  4375
    "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
  4376
    "Created: / 16-09-2011 / 15:12:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4377
    "Modified (format): / 22-08-2018 / 09:23:25 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4378
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4379
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4380
!CodeView2::TextView methodsFor:'private'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4381
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4382
isTextDifferentFromOriginalSource
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4383
    "check for modified code by comparing the source against
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4384
     the codeViews contents.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4385
     That's the true modified value 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4386
     (in case user undid his changes, and the displayed text is actually original)"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4387
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4388
    |different changedSource originalSource 
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4389
     lastLineNrOfChangedSource lastLineNrOfOriginalSource
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4390
     originalL changedL checkIfDifferent|
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4391
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4392
    "/ possibly call at higher prio to prevent it from being changed while we convert it (by editing)
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4393
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4394
    different := false.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4395
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4396
    "/ cg: don't do that (collecting original/changedSource); 
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4397
    "/ for huge files (>8Mb), this makes editing annoying slow (editing a trace output, for example)
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4398
"/        changedSource := list ? #().
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4399
"/        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4400
"/        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4401
"/            changedSource := changedSource removeLast.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4402
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4403
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4404
"/        originalSource := listOriginal ? #() "self model value ? ''".
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4405
"/        originalSource := originalSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4406
"/        [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4407
"/            originalSource := originalSource removeLast
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4408
"/        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4409
"/        originalSource size ~~ changedSource size ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4410
"/            modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4411
"/        ] ifFalse:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4412
"/            | i stopIndex |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4413
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4414
"/            i := 1.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4415
"/            stopIndex := originalSource size + 1.            
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4416
"/            [ modified not and:[ i < stopIndex ] ] whileTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4417
"/                | originalL changedL |
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4418
"/
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4419
"/                originalL := ((originalSource at: i) ? '') string.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4420
"/                changedL :=  ((changedSource  at: i) ? '') string.                
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4421
"/                originalL ~= changedL ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4422
"/                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4423
"/                        modified := true.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4424
"/                    ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4425
"/                ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4426
"/                i := i + 1.
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4427
"/            ]
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4428
"/        ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4429
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4430
    list size ~~ listOriginal size ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4431
        ^ true
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4432
    ].
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4433
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4434
    "/ instead, do everything without collecting a new stringcollection.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4435
    changedSource := list ? #().
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4436
    lastLineNrOfChangedSource := changedSource size.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4437
    [lastLineNrOfChangedSource > 0 and:[(changedSource at:lastLineNrOfChangedSource) isEmptyOrNil]] whileTrue:[
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4438
        lastLineNrOfChangedSource := lastLineNrOfChangedSource - 1.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4439
    ].        
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4440
    originalSource := listOriginal ? #().
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4441
    lastLineNrOfOriginalSource := originalSource size.
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4442
    [lastLineNrOfOriginalSource > 0 and:[(originalSource at:lastLineNrOfOriginalSource) isEmptyOrNil]] whileTrue:[
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4443
        lastLineNrOfOriginalSource := lastLineNrOfOriginalSource - 1.
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4444
    ].        
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4445
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4446
    lastLineNrOfOriginalSource ~~ lastLineNrOfChangedSource ifTrue:[
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4447
        ^ true.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4448
    ].
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4449
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4450
    checkIfDifferent :=
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4451
        [:lNr |
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4452
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4453
            lNr > originalSource size ifTrue:[
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4454
                originalL := ''.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4455
            ] ifFalse:[
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4456
                originalL := ((originalSource at: lNr) ? '') string.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4457
            ].
14511
f6dfead0637f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14506
diff changeset
  4458
            lNr > changedSource size ifTrue:[
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4459
                changedL := ''.
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4460
            ] ifFalse:[
14511
f6dfead0637f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14506
diff changeset
  4461
                changedL :=  ((changedSource at: lNr) ? '') string.                
14504
5b86ded001c0 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14503
diff changeset
  4462
            ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4463
            originalL ~= changedL ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4464
                originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4465
                    ^ true.
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4466
                ]
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4467
            ].
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4468
        ].
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4469
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4470
    "/ do a quick check in the cursor line. This is most likely to be different
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4471
    "/ saves comparing all the rest in 99% of cases (while typing)
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4472
    (cursorLine notNil and:[cursorLine > 0]) ifTrue:[
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4473
        checkIfDifferent value:cursorLine.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4474
        "/ search downward - in case text was pasted, a change is likely to be found there
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4475
        cursorLine+1 to:lastLineNrOfOriginalSource do:checkIfDifferent.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4476
        "/ then the rest
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4477
        1 to:cursorLine-1 do:checkIfDifferent.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4478
    ] ifFalse:[
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4479
        1 to:lastLineNrOfOriginalSource do:checkIfDifferent.
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4480
    ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4481
    ^ false
14590
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4482
45e301c7bb21 Fix in CodeView2::TextView>>isTextDifferentFromOriginalSource
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 14549
diff changeset
  4483
    "Modified: / 07-07-2014 / 11:11:57 / jv"
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4484
    "Modified: / 22-08-2018 / 10:36:19 / Claus Gittinger"
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4485
    "Modified (format): / 12-03-2019 / 15:39:24 / Claus Gittinger"
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4486
!
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4487
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4488
notifyReallyModified
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4489
    reallyModifiedChannel changed.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4490
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4491
    "Created: / 22-08-2018 / 10:23:37 / Claus Gittinger"
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4492
!
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4493
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4494
superEditMenu
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4495
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4496
    ^super editMenu
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4497
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4498
    "Created: / 14-02-2010 / 15:48:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4499
!
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4500
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4501
updateReallyModified
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4502
    "check for modified code by comparing the source against
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4503
     the codeView's contents.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4504
     That's the true modified value (in case user undid changes,
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4505
     and the displayed text is actually original)"
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4506
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4507
    |modified sensor|
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4508
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4509
    reallyModifiedChannel isNil ifTrue:[^self].
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4510
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4511
    "JV@2011-10-27: Idea is not to do anything if nobody is
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4512
     interested. Not sure if it is a good idea, thought."
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4513
    reallyModifiedChannel dependents isEmptyOrNil ifTrue:[
18348
b3cdcd31f2cf #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18347
diff changeset
  4514
        "/ Transcript showCR:'no one cares'.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4515
        ^ self
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4516
    ].
14503
9042b4647515 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14495
diff changeset
  4517
18348
b3cdcd31f2cf #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18347
diff changeset
  4518
    self isReadOnly ifTrue:[
17770
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  4519
        modified := false
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  4520
    ] ifFalse:[
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  4521
        modified := self isTextDifferentFromOriginalSource.
18347
795f40ec5892 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18346
diff changeset
  4522
        "/ Transcript showCR:modified.
18346
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4523
    ].    
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4524
    reallyModifiedChannel value == modified ifTrue:[^ self].
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4525
    
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4526
    "/ no, we should not send out change notification here,
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4527
    "/ because that might generate an invalidate (via the syntaxhighlighter),
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4528
    "/ BEFORE we do a catchExpose in a scroll operation.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4529
    "/ This invalidate would redraw something which we do not expect in the 
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4530
    "/ scrolled area and leads to double drawing of lines 
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4531
    "/ (try inserting a CR at the end of the very first line)
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4532
    "/ the code which gets affected is eg. in basicSplitLine:lineNr before:colNr
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4533
    
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4534
    "/ reallyModifiedChannel value:modified.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4535
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4536
    reallyModifiedChannel setValue:modified.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4537
    sensor := self sensor.
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4538
    (sensor hasUserEvent:#notifyReallyModified for:self) ifFalse:[
4f8e9d971ef6 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18342
diff changeset
  4539
        sensor pushUserEvent:#notifyReallyModified for:self
17770
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  4540
    ].
10781
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4541
f9ad38e58704 Added built-in accept/cancel bar.
vrany
parents: 10780
diff changeset
  4542
    "Created: / 07-10-2011 / 19:16:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10844
cbb5f5dd900a Performance fix in CodeView2::TextView>>updateReallyModified
vrany
parents: 10834
diff changeset
  4543
    "Modified: / 28-10-2011 / 09:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17770
2555e5410582 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 17767
diff changeset
  4544
    "Modified: / 19-11-2017 / 14:18:55 / cg"
18348
b3cdcd31f2cf #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18347
diff changeset
  4545
    "Modified: / 22-08-2018 / 15:34:11 / Claus Gittinger"
18669
a75316f60a29 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 18642
diff changeset
  4546
    "Modified (comment): / 12-03-2019 / 15:23:19 / Claus Gittinger"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4547
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4548
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4549
!CodeView2::TextView methodsFor:'queries'!
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4550
13625
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4551
editedClass
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4552
    |cls|
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4553
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4554
    (cls := codeView classHolder value) notNil ifTrue:[
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4555
        ^ cls
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4556
    ].
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4557
    ^ super editedClass
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4558
!
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4559
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4560
editedMethod
19170
f8a815750f0f #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19145
diff changeset
  4561
    |mthd|
f8a815750f0f #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19145
diff changeset
  4562
f8a815750f0f #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19145
diff changeset
  4563
    (mthd := codeView methodHolder value) notNil ifTrue:[
f8a815750f0f #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 19145
diff changeset
  4564
        ^ mthd
13625
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4565
    ].
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4566
    ^ super editedMethod
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4567
!
33f926cd64ff class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13587
diff changeset
  4568
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4569
supportsSyntaxElements
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4570
    "syntax elements are a byproduct of the syntax highlighter;
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4571
     it is a list of elements, which chain together same-named variables
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4572
     and parts of a keyword message's selector.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4573
     These allow for quick forward/backward navigation to the next/prev. occurrence
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4574
     of a variable. Be aware that the implementation is buggy, in that it does not
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4575
     deal correctly with same-named blockvars of different blocks"
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4576
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4577
    ^ true
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4578
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4579
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4580
syntaxElementAtPosition:position
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4581
    "is there is a syntax element at position?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4582
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4583
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4584
    |syntaxElements el|
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4585
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4586
    (syntaxElements := codeView syntaxElements) isEmptyOrNil ifTrue:[^ nil].
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4587
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4588
    el := syntaxElements detect:[:el | position between:el start and:el stop] ifNone:nil.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4589
    el isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4590
    ^ el.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4591
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4592
    "Created: / 08-03-2012 / 14:21:52 / cg"
18342
5a5b35dd776d #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18190
diff changeset
  4593
    "Modified: / 22-08-2018 / 08:13:04 / Claus Gittinger"
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4594
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4595
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4596
syntaxElementForSelectedVariable
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4597
    "is there is a syntax element for a variable under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4598
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4599
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4600
    |element startPosition endPosition|
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4601
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4602
    self selectionAsString isEmptyOrNil ifTrue:[
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4603
        "/ ^ nil.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4604
        element := self syntaxElementForVariableUnderCursor.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4605
    ] ifFalse:[
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4606
        startPosition := self characterPositionOfLine:selectionStartLine col:selectionStartCol.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4607
        endPosition := self characterPositionOfLine:selectionEndLine col:selectionEndCol.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4608
        element := self syntaxElementAtPosition:startPosition.
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4609
    ].
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4610
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4611
    (element start = startPosition and:[element stop = endPosition]) ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4612
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4613
    element isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4614
    element isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4615
    ^ element
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4616
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4617
    "Created: / 08-03-2012 / 14:21:15 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4618
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4619
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4620
syntaxElementForSelectorUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4621
    "is there is a syntax element for a message selector under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4622
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4623
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4624
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4625
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4626
    elementUnderCursor := self syntaxElementUnderCursor.
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4627
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4628
    elementUnderCursor isSelector ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4629
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4630
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4631
    "Created: / 08-03-2012 / 12:44:03 / cg"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4632
!
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4633
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4634
syntaxElementForVariableUnderCursor
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4635
    "is there is a syntax element for a variable under the cursor?
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4636
     If so, return the element; otherwise, return nil"
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4637
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4638
    |elementUnderCursor |
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4639
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4640
    elementUnderCursor := self syntaxElementUnderCursor.
12980
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4641
    elementUnderCursor isNil ifTrue:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4642
    elementUnderCursor isVariableOrSelf ifFalse:[^ nil].
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4643
    ^ elementUnderCursor.
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4644
78f5bc887da1 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 12968
diff changeset
  4645
    "Created: / 08-03-2012 / 12:44:03 / cg"
14506
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4646
!
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4647
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4648
syntaxElementUnderCursor
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4649
    "is there is a syntax element under the cursor?
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4650
     If so, return the element; otherwise, return nil"
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4651
1a4bcb9cf4fb class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 14504
diff changeset
  4652
    ^ self syntaxElementAtPosition:(self characterPositionOfCursor).
11903
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4653
! !
5b027fc44ff8 +supportsSyntaxElements query
Claus Gittinger <cg@exept.de>
parents: 11769
diff changeset
  4654
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4655
!CodeView2::TextView methodsFor:'scrolling'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4656
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4657
basicScrollTo:anOrigin redraw:doRedraw
13942
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4658
    | savedScrollIProgress |
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4659
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4660
    savedScrollIProgress := scrollInProgress. 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4661
    scrollInProgress := true.
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4662
    [
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4663
        super scrollTo:anOrigin redraw:doRedraw
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4664
    ] ensure:[ 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4665
        scrollInProgress := savedScrollIProgress. 
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4666
    ].
30541c144f9f class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 13936
diff changeset
  4667
    "Modified: / 14-02-2014 / 10:12:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13813
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4668
!
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4669
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4670
scrollTo:anOrigin redraw:doRedraw
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4671
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4672
    codeView scrollTo:anOrigin redraw:doRedraw in: self.
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4673
    self basicScrollTo:anOrigin redraw:doRedraw
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4674
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4675
    "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4676
    "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
576b071baeea merged in jv's chenges
Claus Gittinger <cg@exept.de>
parents: 13625
diff changeset
  4677
    "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4678
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4679
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4680
!CodeView2::TextView methodsFor:'undo & again'!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4681
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4682
nonUndoableDo: aBlock
18927
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4683
    |sav|
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4684
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4685
    sav := suppressNotifications.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4686
    [
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4687
        super nonUndoableDo: aBlock.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4688
    ] ensure:[
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4689
        suppressNotifications := sav.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4690
    ]
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4691
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4692
    "Created: / 06-07-2011 / 17:48:27 / jv"
18927
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4693
    "Modified: / 17-07-2019 / 07:18:01 / Claus Gittinger"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4694
!
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4695
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4696
undoableDo: aBlock info: into
18927
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4697
    |sav|
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4698
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4699
    sav := suppressNotifications.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4700
    [
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4701
        super undoableDo:aBlock info:into.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4702
    ] ensure:[    
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4703
        suppressNotifications := sav.
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4704
    ].
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4705
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4706
    "Created: / 06-07-2011 / 17:48:49 / jv"
18927
cd61d99e3156 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 18849
diff changeset
  4707
    "Modified (format): / 17-07-2019 / 07:35:16 / Claus Gittinger"
10224
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4708
! !
eb799692952b More improvements in BreakpointService
vrany
parents: 10072
diff changeset
  4709
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4710
!CodeView2 class methodsFor:'documentation'!
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4711
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4712
version
15718
e6317c6a1b66 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15643
diff changeset
  4713
    ^ '$Header$'
10293
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4714
!
7dec857f35f6 added: #debugMenu
Claus Gittinger <cg@exept.de>
parents: 10290
diff changeset
  4715
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4716
version_CVS
15718
e6317c6a1b66 class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 15643
diff changeset
  4717
    ^ '$Header$'
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4718
! !
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4719
12347
21f8dcbabcbc class: Tools::CodeView2
Claus Gittinger <cg@exept.de>
parents: 11988
diff changeset
  4720
9985
76318fc4fb70 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  4721
CodeView2 initialize!