Tools__CodeView2.st
branchjv
changeset 13170 c9b815af5777
parent 12819 0ce340e972c4
parent 12870 798d611cfd62
child 13173 e9da2324940d
equal deleted inserted replaced
12819:0ce340e972c4 13170:c9b815af5777
     1 "
     1 "
     2  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
     2  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
     3               All Rights Reserved
     3 	      All Rights Reserved
     4 
     4 
     5 Permission is hereby granted, free of charge, to any person
     5 Permission is hereby granted, free of charge, to any person
     6 obtaining a copy of this software and associated documentation
     6 obtaining a copy of this software and associated documentation
     7 files (the 'Software'), to deal in the Software without
     7 files (the 'Software'), to deal in the Software without
     8 restriction, including without limitation the rights to use,
     8 restriction, including without limitation the rights to use,
    62 !CodeView2 class methodsFor:'documentation'!
    62 !CodeView2 class methodsFor:'documentation'!
    63 
    63 
    64 copyright
    64 copyright
    65 "
    65 "
    66  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
    66  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
    67               All Rights Reserved
    67 	      All Rights Reserved
    68 
    68 
    69 Permission is hereby granted, free of charge, to any person
    69 Permission is hereby granted, free of charge, to any person
    70 obtaining a copy of this software and associated documentation
    70 obtaining a copy of this software and associated documentation
    71 files (the 'Software'), to deal in the Software without
    71 files (the 'Software'), to deal in the Software without
    72 restriction, including without limitation the rights to use,
    72 restriction, including without limitation the rights to use,
   130 
   130 
   131     | window codeView |
   131     | window codeView |
   132 
   132 
   133 
   133 
   134     window := StandardSystemView new.
   134     window := StandardSystemView new.
   135     window extent: 300 @ 300.              
   135     window extent: 300 @ 300.
   136     window label: 'CodeView2 example1'.
   136     window label: 'CodeView2 example1'.
   137 
   137 
   138     codeView := Tools::CodeView2 in: window.
   138     codeView := Tools::CodeView2 in: window.
   139     codeView
   139     codeView
   140         origin: 0.1 @ 0.1
   140 	origin: 0.1 @ 0.1
   141         corner: 0.9 @ 0.9.
   141 	corner: 0.9 @ 0.9.
   142 
   142 
   143 
   143 
   144     window open.
   144     window open.
   145 
   145 
   146     "Created: / 02-09-2009 / 21:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   146     "Created: / 02-09-2009 / 21:48:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   160      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
   160      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
   161     "
   161     "
   162 
   162 
   163     <resource: #menu>
   163     <resource: #menu>
   164 
   164 
   165     ^ 
   165     ^
   166      #(Menu
   166      #(Menu
   167               (
   167 	      (
   168                (MenuItem
   168 	       (MenuItem
   169                   label: 'Inspect '
   169 		  label: 'Inspect '
   170                   itemValue: inspectView
   170 		  itemValue: inspectView
   171                   translateLabel: true
   171 		  translateLabel: true
   172                 )
   172 		)
   173                (MenuItem
   173 	       (MenuItem
   174                   label: 'Inspect Syntax Elements'
   174 		  label: 'Inspect Syntax Elements'
   175                   itemValue: inspectSyntaxElements
   175 		  itemValue: inspectSyntaxElements
   176                   translateLabel: true
   176 		  translateLabel: true
   177                 )
   177 		)
   178                (MenuItem
   178 	       (MenuItem
   179                   label: 'Inspect Selected Selector'
   179 		  label: 'Inspect Selected Selector'
   180                   itemValue: inspectSelectedSelector
   180 		  itemValue: inspectSelectedSelector
   181                   translateLabel: true
   181 		  translateLabel: true
   182                 )
   182 		)
   183                )
   183 	       )
   184               nil
   184 	      nil
   185               nil
   185 	      nil
   186             )
   186 	    )
   187 
   187 
   188     "Created: / 08-07-2011 / 13:36:02 / cg"
   188     "Created: / 08-07-2011 / 13:36:02 / cg"
   189 !
   189 !
   190 
   190 
   191 editMenu
   191 editMenu
   199      MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
   199      MenuEditor new openOnClass:Tools::CodeView2 andSelector:#editMenu
   200      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
   200      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu)) startUp
   201     "
   201     "
   202 
   202 
   203     UserPreferences current eclipseStyleMenus ifTrue:[
   203     UserPreferences current eclipseStyleMenus ifTrue:[
   204         ^ self editMenu_eclipseStyle
   204 	^ self editMenu_eclipseStyle
   205     ].
   205     ].
   206     ^ self editMenu_stxStyle
   206     ^ self editMenu_stxStyle
   207 
   207 
   208     "Modified: / 08-07-2011 / 13:23:35 / cg"
   208     "Modified: / 08-07-2011 / 13:23:35 / cg"
   209 !
   209 !
   221      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
   221      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_eclipseStyle)) startUp
   222     "
   222     "
   223 
   223 
   224     <resource: #menu>
   224     <resource: #menu>
   225 
   225 
   226     ^ 
   226     ^
   227      #(Menu
   227      #(Menu
   228         (
   228 	(
   229          (MenuItem
   229 	 (MenuItem
   230             label: 'Implementors...'
   230 	    label: 'Implementors...'
   231             itemValue: browseImplementorsOfIt
   231 	    itemValue: browseImplementorsOfIt
   232             translateLabel: true
   232 	    translateLabel: true
   233             submenuChannel: implementorsMenu
   233 	    submenuChannel: implementorsMenu
   234             shortcutKey: ImplementorsOfIt
   234 	    shortcutKey: ImplementorsOfIt
   235           )
   235 	  )
   236          (MenuItem
   236 	 (MenuItem
   237             label: 'Senders...'
   237 	    label: 'Senders...'
   238             itemValue: browseSendersOfIt
   238 	    itemValue: browseSendersOfIt
   239             translateLabel: true
   239 	    translateLabel: true
   240             submenuChannel: sendersMenu
   240 	    submenuChannel: sendersMenu
   241             shortcutKey: SendersOfIt
   241 	    shortcutKey: SendersOfIt
   242           )
   242 	  )
   243          (MenuItem
   243 	 (MenuItem
   244             label: 'Refactor'
   244 	    label: 'Refactor'
   245             nameKey: refactor
   245 	    nameKey: refactor
   246             translateLabel: true
   246 	    translateLabel: true
   247             isVisible: false
   247 	    isVisible: false
   248             shortcutKey: Shift
   248 	    shortcutKey: Shift
   249           )
   249 	  )
   250          (MenuItem
   250 	 (MenuItem
   251             label: '-'
   251 	    label: '-'
   252           )
   252 	  )
   253          (MenuItem
   253 	 (MenuItem
   254             label: 'Accept'
   254 	    label: 'Accept'
   255             itemValue: accept
   255 	    itemValue: accept
   256             translateLabel: true
   256 	    translateLabel: true
   257             shortcutKey: Accept
   257 	    shortcutKey: Accept
   258           )
   258 	  )
   259          (MenuItem
   259 	 (MenuItem
   260             label: '-'
   260 	    label: '-'
   261           )
   261 	  )
   262          (MenuItem
   262 	 (MenuItem
   263             label: 'Cut'
   263 	    label: 'Cut'
   264             itemValue: cut
   264 	    itemValue: cut
   265             translateLabel: true
   265 	    translateLabel: true
   266             shortcutKey: Cut
   266 	    shortcutKey: Cut
   267           )
   267 	  )
   268          (MenuItem
   268 	 (MenuItem
   269             label: 'Copy'
   269 	    label: 'Copy'
   270             itemValue: copySelection
   270 	    itemValue: copySelection
   271             translateLabel: true
   271 	    translateLabel: true
   272             shortcutKey: Copy
   272 	    shortcutKey: Copy
   273           )
   273 	  )
   274          (MenuItem
   274 	 (MenuItem
   275             label: 'Paste'
   275 	    label: 'Paste'
   276             itemValue: pasteOrReplace
   276 	    itemValue: pasteOrReplace
   277             translateLabel: true
   277 	    translateLabel: true
   278             shortcutKey: Paste
   278 	    shortcutKey: Paste
   279           )
   279 	  )
   280          (MenuItem
   280 	 (MenuItem
   281             label: '-'
   281 	    label: '-'
   282           )
   282 	  )
   283          (MenuItem
   283 	 (MenuItem
   284             label: 'Undo'
   284 	    label: 'Undo'
   285             itemValue: undo
   285 	    itemValue: undo
   286             translateLabel: true
   286 	    translateLabel: true
   287             shortcutKey: Undo
   287 	    shortcutKey: Undo
   288           )
   288 	  )
   289          (MenuItem
   289 	 (MenuItem
   290             label: '-'
   290 	    label: '-'
   291           )
   291 	  )
   292          (MenuItem
   292 	 (MenuItem
   293             label: 'Do it'
   293 	    label: 'Do it'
   294             itemValue: doIt
   294 	    itemValue: doIt
   295             translateLabel: true
   295 	    translateLabel: true
   296             shortcutKey: DoIt
   296 	    shortcutKey: DoIt
   297           )
   297 	  )
   298          (MenuItem
   298 	 (MenuItem
   299             label: 'Print it'
   299 	    label: 'Print it'
   300             itemValue: printIt
   300 	    itemValue: printIt
   301             translateLabel: true
   301 	    translateLabel: true
   302             shortcutKey: PrintIt
   302 	    shortcutKey: PrintIt
   303           )
   303 	  )
   304          (MenuItem
   304 	 (MenuItem
   305             label: 'Inspect it'
   305 	    label: 'Inspect it'
   306             itemValue: inspectIt
   306 	    itemValue: inspectIt
   307             translateLabel: true
   307 	    translateLabel: true
   308             shortcutKey: InspectIt
   308 	    shortcutKey: InspectIt
   309           )
   309 	  )
   310          (MenuItem
   310 	 (MenuItem
   311             label: 'Profile it'
   311 	    label: 'Profile it'
   312             itemValue: profileIt
   312 	    itemValue: profileIt
   313             translateLabel: true
   313 	    translateLabel: true
   314             shortcutKey: InspectIt
   314 	    shortcutKey: InspectIt
   315           )
   315 	  )
   316          (MenuItem
   316 	 (MenuItem
   317             label: '-'
   317 	    label: '-'
   318           )
   318 	  )
   319          (MenuItem
   319 	 (MenuItem
   320             label: 'Show Gutter'
   320 	    label: 'Show Gutter'
   321             nameKey: ShowGutter
   321 	    nameKey: ShowGutter
   322             translateLabel: true
   322 	    translateLabel: true
   323             indication: showGutterChannel
   323 	    indication: showGutterChannel
   324           )
   324 	  )
   325          (MenuItem
   325 	 (MenuItem
   326             label: 'More'
   326 	    label: 'More'
   327             nameKey: More
   327 	    nameKey: More
   328             translateLabel: true
   328 	    translateLabel: true
   329           )
   329 	  )
   330          (MenuItem
   330 	 (MenuItem
   331             label: 'Services'
   331 	    label: 'Services'
   332             translateLabel: true
   332 	    translateLabel: true
   333             submenuChannel: servicesMenu
   333 	    submenuChannel: servicesMenu
   334           )
   334 	  )
   335          (MenuItem
   335 	 (MenuItem
   336             label: 'Debug'
   336 	    label: 'Debug'
   337             translateLabel: true
   337 	    translateLabel: true
   338             submenu: 
   338 	    submenu:
   339            (Menu
   339 	   (Menu
   340               (
   340 	      (
   341                (MenuItem
   341 	       (MenuItem
   342                   label: 'Inspect '
   342 		  label: 'Inspect '
   343                   itemValue: inspectView
   343 		  itemValue: inspectView
   344                   translateLabel: true
   344 		  translateLabel: true
   345                 )
   345 		)
   346                (MenuItem
   346 	       (MenuItem
   347                   label: 'Inspect Syntax Elements'
   347 		  label: 'Inspect Syntax Elements'
   348                   itemValue: inspectSyntaxElements
   348 		  itemValue: inspectSyntaxElements
   349                   translateLabel: true
   349 		  translateLabel: true
   350                 )
   350 		)
   351                (MenuItem
   351 	       (MenuItem
   352                   label: 'Inspect Selected Selector'
   352 		  label: 'Inspect Selected Selector'
   353                   itemValue: inspectSelectedSelector
   353 		  itemValue: inspectSelectedSelector
   354                   translateLabel: true
   354 		  translateLabel: true
   355                 )
   355 		)
   356                )
   356 	       )
   357               nil
   357 	      nil
   358               nil
   358 	      nil
   359             )
   359 	    )
   360           )
   360 	  )
   361          )
   361 	 )
   362         nil
   362 	nil
   363         nil
   363 	nil
   364       )
   364       )
   365 
   365 
   366     "Modified: / 08-03-2012 / 12:36:18 / cg"
   366     "Modified: / 08-03-2012 / 12:36:18 / cg"
   367 !
   367 !
   368 
   368 
   379      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
   379      (Menu new fromLiteralArrayEncoding:(Tools::CodeView2 editMenu_stxStyle)) startUp
   380     "
   380     "
   381 
   381 
   382     <resource: #menu>
   382     <resource: #menu>
   383 
   383 
   384     ^ 
   384     ^
   385      #(Menu
   385      #(Menu
   386         (
   386 	(
   387          (MenuItem
   387 	 (MenuItem
   388             label: 'Undo'
   388 	    label: 'Undo'
   389             itemValue: undo
   389 	    itemValue: undo
   390             translateLabel: true
   390 	    translateLabel: true
   391             shortcutKey: Undo
   391 	    shortcutKey: Undo
   392           )
   392 	  )
   393          (MenuItem
   393 	 (MenuItem
   394             label: 'Again'
   394 	    label: 'Again'
   395             itemValue: again
   395 	    itemValue: again
   396             translateLabel: true
   396 	    translateLabel: true
   397             shortcutKey: Again
   397 	    shortcutKey: Again
   398           )
   398 	  )
   399          (MenuItem
   399 	 (MenuItem
   400             label: '-'
   400 	    label: '-'
   401           )
   401 	  )
   402          (MenuItem
   402 	 (MenuItem
   403             label: 'Cut'
   403 	    label: 'Cut'
   404             itemValue: cut
   404 	    itemValue: cut
   405             translateLabel: true
   405 	    translateLabel: true
   406             shortcutKey: Cut
   406 	    shortcutKey: Cut
   407           )
   407 	  )
   408          (MenuItem
   408 	 (MenuItem
   409             label: 'Copy'
   409 	    label: 'Copy'
   410             itemValue: copySelection
   410 	    itemValue: copySelection
   411             translateLabel: true
   411 	    translateLabel: true
   412             shortcutKey: Copy
   412 	    shortcutKey: Copy
   413           )
   413 	  )
   414          (MenuItem
   414 	 (MenuItem
   415             label: 'Paste'
   415 	    label: 'Paste'
   416             itemValue: pasteOrReplace
   416 	    itemValue: pasteOrReplace
   417             translateLabel: true
   417 	    translateLabel: true
   418             shortcutKey: Paste
   418 	    shortcutKey: Paste
   419           )
   419 	  )
   420          (MenuItem
   420 	 (MenuItem
   421             label: '-'
   421 	    label: '-'
   422           )
   422 	  )
   423          (MenuItem
   423 	 (MenuItem
   424             label: 'DoIt'
   424 	    label: 'DoIt'
   425             itemValue: doIt
   425 	    itemValue: doIt
   426             translateLabel: true
   426 	    translateLabel: true
   427             shortcutKey: DoIt
   427 	    shortcutKey: DoIt
   428           )
   428 	  )
   429          (MenuItem
   429 	 (MenuItem
   430             label: 'PrintIt'
   430 	    label: 'PrintIt'
   431             itemValue: printIt
   431 	    itemValue: printIt
   432             translateLabel: true
   432 	    translateLabel: true
   433             shortcutKey: PrintIt
   433 	    shortcutKey: PrintIt
   434           )
   434 	  )
   435          (MenuItem
   435 	 (MenuItem
   436             label: 'InspectIt'
   436 	    label: 'InspectIt'
   437             itemValue: inspectIt
   437 	    itemValue: inspectIt
   438             translateLabel: true
   438 	    translateLabel: true
   439             shortcutKey: InspectIt
   439 	    shortcutKey: InspectIt
   440           )
   440 	  )
   441          (MenuItem
   441 	 (MenuItem
   442             label: '-'
   442 	    label: '-'
   443           )
   443 	  )
   444          (MenuItem
   444 	 (MenuItem
   445             label: 'Accept'
   445 	    label: 'Accept'
   446             itemValue: accept
   446 	    itemValue: accept
   447             translateLabel: true
   447 	    translateLabel: true
   448             shortcutKey: Accept
   448 	    shortcutKey: Accept
   449           )
   449 	  )
   450          (MenuItem
   450 	 (MenuItem
   451             label: '-'
   451 	    label: '-'
   452             isVisible: false
   452 	    isVisible: false
   453           )
   453 	  )
   454          (MenuItem
   454 	 (MenuItem
   455             label: 'Refactor'
   455 	    label: 'Refactor'
   456             nameKey: refactor
   456 	    nameKey: refactor
   457             translateLabel: true
   457 	    translateLabel: true
   458             isVisible: false
   458 	    isVisible: false
   459             shortcutKey: Shift
   459 	    shortcutKey: Shift
   460           )
   460 	  )
   461          (MenuItem
   461 	 (MenuItem
   462             label: 'Services'
   462 	    label: 'Services'
   463             translateLabel: true
   463 	    translateLabel: true
   464             isVisible: false
   464 	    isVisible: false
   465             submenuChannel: servicesMenu
   465 	    submenuChannel: servicesMenu
   466           )
   466 	  )
   467          (MenuItem
   467 	 (MenuItem
   468             label: '='
   468 	    label: '='
   469           )
   469 	  )
   470          (MenuItem
   470 	 (MenuItem
   471             label: 'More'
   471 	    label: 'More'
   472             nameKey: More
   472 	    nameKey: More
   473             translateLabel: true
   473 	    translateLabel: true
   474             shortcutKey: Ctrl
   474 	    shortcutKey: Ctrl
   475           )
   475 	  )
   476          )
   476 	 )
   477         nil
   477 	nil
   478         nil
   478 	nil
   479       )
   479       )
   480 
   480 
   481     "Modified: / 02-03-2012 / 19:53:19 / cg"
   481     "Modified: / 02-03-2012 / 19:53:19 / cg"
   482 ! !
   482 ! !
   483 
   483 
   499 !
   499 !
   500 
   500 
   501 breakpoints
   501 breakpoints
   502 
   502 
   503     services do:[:each|
   503     services do:[:each|
   504         (each isKindOf: BreakpointService) ifTrue:[
   504 	(each isKindOf: BreakpointService) ifTrue:[
   505             ^each breakpoints
   505 	    ^each breakpoints
   506         ]
   506 	]
   507     ].
   507     ].
   508     ^ nil
   508     ^ nil
   509 
   509 
   510     "Created: / 06-07-2011 / 18:05:35 / jv"
   510     "Created: / 06-07-2011 / 18:05:35 / jv"
   511     "Modified: / 06-10-2011 / 14:13:53 / cg"
   511     "Modified: / 06-10-2011 / 14:13:53 / cg"
   523 
   523 
   524     codeAspect ifNotNil:[^codeAspect].
   524     codeAspect ifNotNil:[^codeAspect].
   525     methodHolder value ifNotNil:[^SyntaxHighlighter codeAspectMethod].
   525     methodHolder value ifNotNil:[^SyntaxHighlighter codeAspectMethod].
   526 
   526 
   527     ^((app := self topView application) notNil and:[app respondsTo: #codeAspect])
   527     ^((app := self topView application) notNil and:[app respondsTo: #codeAspect])
   528         ifTrue:[app codeAspect]
   528 	ifTrue:[app codeAspect]
   529         ifFalse:[(SyntaxHighlighter codeAspectExpression)]
   529 	ifFalse:[(SyntaxHighlighter codeAspectExpression)]
   530 
   530 
   531     "Modified: / 27-07-2011 / 13:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   531     "Modified: / 27-07-2011 / 13:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   532     "Modified: / 27-07-2012 / 22:22:27 / cg"
   532     "Modified: / 27-07-2012 / 22:22:27 / cg"
   533 !
   533 !
   534 
   534 
   535 codeAspect:aSymbol
   535 codeAspect:aSymbol
   536     self assert: ({  SyntaxHighlighter codeAspectClassDefinition .
   536     self assert: ({  SyntaxHighlighter codeAspectClassDefinition .
   537                     SyntaxHighlighter codeAspectExpression .
   537 		    SyntaxHighlighter codeAspectExpression .
   538                     SyntaxHighlighter codeAspectMethod } includes:aSymbol ).
   538 		    SyntaxHighlighter codeAspectMethod } includes:aSymbol ).
   539 
   539 
   540     codeAspect ~~ aSymbol ifTrue:[
   540     codeAspect ~~ aSymbol ifTrue:[
   541         codeAspect := aSymbol.
   541 	codeAspect := aSymbol.
   542         self update: #codeAspect with: codeAspect from: self.
   542 	self update: #codeAspect with: codeAspect from: self.
   543     ]
   543     ]
   544 
   544 
   545     "Modified: / 27-07-2012 / 22:32:19 / cg"
   545     "Modified: / 27-07-2012 / 22:32:19 / cg"
   546     "Modified: / 15-04-2013 / 23:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   546     "Modified: / 15-04-2013 / 23:02:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   547 !
   547 !
   633 !
   633 !
   634 
   634 
   635 mode: aSymbol
   635 mode: aSymbol
   636     "is this the same as codeAspect ?"
   636     "is this the same as codeAspect ?"
   637 
   637 
   638     self assert: (#(expression method) includes: aSymbol).    
   638     self assert: (#(expression method) includes: aSymbol).
   639     
   639 
   640     ^self modeHolder value: aSymbol
   640     ^self modeHolder value: aSymbol
   641 
   641 
   642     "Created: / 13-06-2011 / 10:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   642     "Created: / 13-06-2011 / 10:50:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   643     "Modified: / 15-06-2011 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   643     "Modified: / 15-06-2011 / 16:37:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   644     "Modified (comment): / 27-07-2012 / 22:19:49 / cg"
   644     "Modified (comment): / 27-07-2012 / 22:19:49 / cg"
   654 model: aValueModel
   654 model: aValueModel
   655 
   655 
   656     |oldValue newValue|
   656     |oldValue newValue|
   657 
   657 
   658     textView model notNil ifTrue:[
   658     textView model notNil ifTrue:[
   659         oldValue := textView model value.
   659 	oldValue := textView model value.
   660         textView model removeDependent:self.
   660 	textView model removeDependent:self.
   661     ].
   661     ].
   662     textView model: aValueModel.
   662     textView model: aValueModel.
   663     textView model notNil ifTrue:[
   663     textView model notNil ifTrue:[
   664         textView model addDependent:self.
   664 	textView model addDependent:self.
   665     ].
   665     ].
   666     newValue := textView model value.
   666     newValue := textView model value.
   667     oldValue ~~ newValue ifTrue:[
   667     oldValue ~~ newValue ifTrue:[
   668         self update:#value with:newValue from:textView model.
   668 	self update:#value with:newValue from:textView model.
   669     ].
   669     ].
   670 
   670 
   671     "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   671     "Modified: / 17-03-2012 / 16:11:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   672 !
   672 !
   673 
   673 
   728 !
   728 !
   729 
   729 
   730 synchronizeWith: aCodeView
   730 synchronizeWith: aCodeView
   731 
   731 
   732     self assert: aCodeView ~= self.
   732     self assert: aCodeView ~= self.
   733     (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].    
   733     (synchronizedCodeViews includes: aCodeView) ifTrue:[^self].
   734     synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
   734     synchronizedCodeViews := synchronizedCodeViews copyWith: aCodeView.
   735 
   735 
   736     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   736     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   737     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   737     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   738 !
   738 !
   739 
   739 
   740 unsynchronizeWith: aCodeView
   740 unsynchronizeWith: aCodeView
   741 
   741 
   742     self assert: aCodeView ~= self.
   742     self assert: aCodeView ~= self.
   743     (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].    
   743     (synchronizedCodeViews includes: aCodeView) ifFalse:[^self].
   744     synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
   744     synchronizedCodeViews := synchronizedCodeViews copyWithout: aCodeView.
   745 
   745 
   746     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   746     "Created: / 06-04-2010 / 14:13:14 / Jakub <zelenja7@fel.cvut.cz>"
   747     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   747     "Modified: / 23-06-2010 / 17:01:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   748     "Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   748     "Created: / 19-03-2012 / 14:25:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   807 
   807 
   808 !CodeView2 methodsFor:'aspects'!
   808 !CodeView2 methodsFor:'aspects'!
   809 
   809 
   810 browserHolder
   810 browserHolder
   811     browserHolder isNil ifTrue:[
   811     browserHolder isNil ifTrue:[
   812         browserHolder := ValueHolder new
   812 	browserHolder := ValueHolder new
   813     ].
   813     ].
   814     ^browserHolder
   814     ^browserHolder
   815 
   815 
   816     "Modified: / 14-02-2010 / 19:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   816     "Modified: / 14-02-2010 / 19:27:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   817     "Modified: / 18-11-2011 / 14:58:15 / cg"
   817     "Modified: / 18-11-2011 / 14:58:15 / cg"
   823 
   823 
   824 classHolder
   824 classHolder
   825     "return/create the 'classHolder' value holder (automatically generated)"
   825     "return/create the 'classHolder' value holder (automatically generated)"
   826 
   826 
   827     classHolder isNil ifTrue:[
   827     classHolder isNil ifTrue:[
   828         classHolder := ValueHolder with: nil.
   828 	classHolder := ValueHolder with: nil.
   829         classHolder addDependent:self.
   829 	classHolder addDependent:self.
   830     ].
   830     ].
   831     ^ classHolder
   831     ^ classHolder
   832 
   832 
   833     "Modified: / 27-07-2011 / 13:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   833     "Modified: / 27-07-2011 / 13:15:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   834 !
   834 !
   837     "set the 'classHolder' value holder (automatically generated)"
   837     "set the 'classHolder' value holder (automatically generated)"
   838 
   838 
   839     |old oldValue newValue|
   839     |old oldValue newValue|
   840 
   840 
   841     classHolder notNil ifTrue:[
   841     classHolder notNil ifTrue:[
   842         oldValue := classHolder value.
   842 	oldValue := classHolder value.
   843         classHolder removeDependent:self.
   843 	classHolder removeDependent:self.
   844     ].
   844     ].
   845     classHolder := aValueModel.
   845     classHolder := aValueModel.
   846     classHolder notNil ifTrue:[
   846     classHolder notNil ifTrue:[
   847         classHolder addDependent:self.
   847 	classHolder addDependent:self.
   848     ].
   848     ].
   849     old := methodHolder.
   849     old := methodHolder.
   850     newValue := classHolder value.
   850     newValue := classHolder value.
   851     oldValue ~~ newValue ifTrue:[
   851     oldValue ~~ newValue ifTrue:[
   852         self update:#value with:newValue from:classHolder.
   852 	self update:#value with:newValue from:classHolder.
   853     ].
   853     ].
   854 
   854 
   855     self changed: #classHolder with: old -> classHolder
   855     self changed: #classHolder with: old -> classHolder
   856 
   856 
   857     "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   857     "Modified: / 17-06-2011 / 12:56:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   859 
   859 
   860 currentBlockNodeHolder
   860 currentBlockNodeHolder
   861     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
   861     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
   862 
   862 
   863     currentBlockNodeHolder isNil ifTrue:[
   863     currentBlockNodeHolder isNil ifTrue:[
   864         currentBlockNodeHolder := ValueHolder new.
   864 	currentBlockNodeHolder := ValueHolder new.
   865     ].
   865     ].
   866     ^ currentBlockNodeHolder
   866     ^ currentBlockNodeHolder
   867 !
   867 !
   868 
   868 
   869 currentBlockNodeHolder:something
   869 currentBlockNodeHolder:something
   874 
   874 
   875 currentParseNodeHolder
   875 currentParseNodeHolder
   876     "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
   876     "return/create the 'currentParseNodeHolder' value holder (automatically generated)"
   877 
   877 
   878     currentParseNodeHolder isNil ifTrue:[
   878     currentParseNodeHolder isNil ifTrue:[
   879         currentParseNodeHolder := ValueHolder new.
   879 	currentParseNodeHolder := ValueHolder new.
   880     ].
   880     ].
   881     ^ currentParseNodeHolder
   881     ^ currentParseNodeHolder
   882 !
   882 !
   883 
   883 
   884 currentParseNodeHolder:something
   884 currentParseNodeHolder:something
   890     "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   890     "Modified: / 16-02-2012 / 23:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   891 !
   891 !
   892 
   892 
   893 languageHolder
   893 languageHolder
   894     languageHolder isNil ifTrue:[
   894     languageHolder isNil ifTrue:[
   895         "/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
   895 	"/ cg: I dont like the smalltalk default here, because everyone who is not showing ST-code (expecco, filebrowser etc.)
   896         "/ has to explicitely clear the valueholder. I guess, it is better for the few
   896 	"/ has to explicitely clear the valueholder. I guess, it is better for the few
   897         "/ others to explicitely set it, if they do not provide syntaxHighlighter per method
   897 	"/ others to explicitely set it, if they do not provide syntaxHighlighter per method
   898         "/ or class.
   898 	"/ or class.
   899         languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
   899 	languageHolder := ValueHolder with: nil "SmalltalkLanguage instance".
   900         languageHolder addDependent:self.
   900 	languageHolder addDependent:self.
   901     ].
   901     ].
   902     ^ languageHolder
   902     ^ languageHolder
   903 
   903 
   904     "Modified: / 19-07-2012 / 16:51:04 / cg"
   904     "Modified: / 19-07-2012 / 16:51:04 / cg"
   905 !
   905 !
   908     "set the 'languageHolder' value holder (automatically generated)"
   908     "set the 'languageHolder' value holder (automatically generated)"
   909 
   909 
   910     |old oldValue newValue|
   910     |old oldValue newValue|
   911 
   911 
   912     languageHolder notNil ifTrue:[
   912     languageHolder notNil ifTrue:[
   913         oldValue := languageHolder value.
   913 	oldValue := languageHolder value.
   914         languageHolder removeDependent:self.
   914 	languageHolder removeDependent:self.
   915     ].
   915     ].
   916     languageHolder := aValueModel.
   916     languageHolder := aValueModel.
   917     languageHolder notNil ifTrue:[
   917     languageHolder notNil ifTrue:[
   918         languageHolder addDependent:self.
   918 	languageHolder addDependent:self.
   919     ].
   919     ].
   920     old := languageHolder.
   920     old := languageHolder.
   921     newValue := languageHolder value.
   921     newValue := languageHolder value.
   922     oldValue ~~ newValue ifTrue:[
   922     oldValue ~~ newValue ifTrue:[
   923         self update:#value with:newValue from:languageHolder.
   923 	self update:#value with:newValue from:languageHolder.
   924     ].
   924     ].
   925 
   925 
   926     self changed: #languageHolder with: old -> languageHolder
   926     self changed: #languageHolder with: old -> languageHolder
   927 
   927 
   928     "Modified: / 17-06-2011 / 12:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   928     "Modified: / 17-06-2011 / 12:56:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   931 
   931 
   932 methodHolder
   932 methodHolder
   933     "return/create the 'methodHolder' value holder (automatically generated)"
   933     "return/create the 'methodHolder' value holder (automatically generated)"
   934 
   934 
   935     methodHolder isNil ifTrue:[
   935     methodHolder isNil ifTrue:[
   936         methodHolder := ValueHolder new.
   936 	methodHolder := ValueHolder new.
   937         methodHolder addDependent:self.
   937 	methodHolder addDependent:self.
   938     ].
   938     ].
   939     ^ methodHolder
   939     ^ methodHolder
   940 !
   940 !
   941 
   941 
   942 methodHolder:aValueModel
   942 methodHolder:aValueModel
   943     "set the 'methodHolder' value holder (automatically generated)"
   943     "set the 'methodHolder' value holder (automatically generated)"
   944 
   944 
   945     |old oldValue newValue|
   945     |old oldValue newValue|
   946 
   946 
   947     methodHolder notNil ifTrue:[
   947     methodHolder notNil ifTrue:[
   948         oldValue := methodHolder value.
   948 	oldValue := methodHolder value.
   949         methodHolder removeDependent:self.
   949 	methodHolder removeDependent:self.
   950     ].
   950     ].
   951     old := methodHolder.
   951     old := methodHolder.
   952     methodHolder := aValueModel.
   952     methodHolder := aValueModel.
   953     methodHolder notNil ifTrue:[
   953     methodHolder notNil ifTrue:[
   954         methodHolder addDependent:self.
   954 	methodHolder addDependent:self.
   955     ].
   955     ].
   956     newValue := methodHolder value.
   956     newValue := methodHolder value.
   957     oldValue ~~ newValue ifTrue:[
   957     oldValue ~~ newValue ifTrue:[
   958         self update:#value with:newValue from:methodHolder.
   958 	self update:#value with:newValue from:methodHolder.
   959     ].
   959     ].
   960 
   960 
   961     self changed: #methodHolder with: old -> methodHolder
   961     self changed: #methodHolder with: old -> methodHolder
   962 
   962 
   963     "Modified: / 17-06-2011 / 12:55:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   963     "Modified: / 17-06-2011 / 12:55:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   966 modeHolder
   966 modeHolder
   967     "return/create the 'modeHolder' value holder (automatically generated)"
   967     "return/create the 'modeHolder' value holder (automatically generated)"
   968 
   968 
   969     "is this the codeAspect?"
   969     "is this the codeAspect?"
   970     modeHolder isNil ifTrue:[
   970     modeHolder isNil ifTrue:[
   971         modeHolder := #expression asValue.
   971 	modeHolder := #expression asValue.
   972         modeHolder addDependent:self.
   972 	modeHolder addDependent:self.
   973     ].
   973     ].
   974     ^ modeHolder
   974     ^ modeHolder
   975 
   975 
   976     "Modified: / 13-06-2011 / 10:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   976     "Modified: / 13-06-2011 / 10:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   977     "Modified (comment): / 27-07-2012 / 22:22:19 / cg"
   977     "Modified (comment): / 27-07-2012 / 22:22:19 / cg"
   981     "set the 'modeHolder' value holder (automatically generated)"
   981     "set the 'modeHolder' value holder (automatically generated)"
   982 
   982 
   983     |oldValue newValue|
   983     |oldValue newValue|
   984 
   984 
   985     modeHolder notNil ifTrue:[
   985     modeHolder notNil ifTrue:[
   986         oldValue := modeHolder value.
   986 	oldValue := modeHolder value.
   987         modeHolder removeDependent:self.
   987 	modeHolder removeDependent:self.
   988     ].
   988     ].
   989     modeHolder := something.
   989     modeHolder := something.
   990     modeHolder notNil ifTrue:[
   990     modeHolder notNil ifTrue:[
   991         modeHolder addDependent:self.
   991 	modeHolder addDependent:self.
   992     ].
   992     ].
   993     newValue := modeHolder value.
   993     newValue := modeHolder value.
   994     oldValue ~~ newValue ifTrue:[
   994     oldValue ~~ newValue ifTrue:[
   995         self update:#value with:newValue from:modeHolder.
   995 	self update:#value with:newValue from:modeHolder.
   996     ].
   996     ].
   997 
   997 
   998     self changed: #modeHolder with: modeHolder
   998     self changed: #modeHolder with: modeHolder
   999 
   999 
  1000     "Modified: / 17-06-2011 / 12:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1000     "Modified: / 17-06-2011 / 12:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1003 !CodeView2 methodsFor:'change & update'!
  1003 !CodeView2 methodsFor:'change & update'!
  1004 
  1004 
  1005 update:aspect with:param from:sender
  1005 update:aspect with:param from:sender
  1006 
  1006 
  1007     sender == modeHolder ifTrue:[
  1007     sender == modeHolder ifTrue:[
  1008         codeAspect := modeHolder value
  1008 	codeAspect := modeHolder value
  1009     ].
  1009     ].
  1010 
  1010 
  1011     sender == showGutterChannel ifTrue: [
  1011     sender == showGutterChannel ifTrue: [
  1012         self updateGutterVisibility.
  1012 	self updateGutterVisibility.
  1013         ^self.
  1013 	^self.
  1014     ].
  1014     ].
  1015 
  1015 
  1016     services do:[:each | 
  1016     services do:[:each |
  1017         each isEnabled ifTrue:[
  1017 	each isEnabled ifTrue:[
  1018             each update:aspect with:param from:sender 
  1018 	    each update:aspect with:param from:sender
  1019         ]
  1019 	]
  1020     ].
  1020     ].
  1021 
  1021 
  1022     super update:aspect with:param from:sender
  1022     super update:aspect with:param from:sender
  1023 
  1023 
  1024     "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>"
  1024     "Modified: / 07-07-2011 / 12:07:04 / Jan Vrany <jan.vrant@fit.cvut,cz>"
  1026     "Modified: / 26-07-2012 / 19:25:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1026     "Modified: / 26-07-2012 / 19:25:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1027 !
  1027 !
  1028 
  1028 
  1029 updateGutterVisibility
  1029 updateGutterVisibility
  1030 
  1030 
  1031     self showGutterChannel value ifTrue:[        
  1031     self showGutterChannel value ifTrue:[
  1032         textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
  1032 	textViewScroller origin:(gutterView width @ 0.0) corner:(1.0 @ 1.0).
  1033         gutterView beVisible.
  1033 	gutterView beVisible.
  1034     ] ifFalse:[
  1034     ] ifFalse:[
  1035         textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
  1035 	textViewScroller origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
  1036         gutterView beInvisible.
  1036 	gutterView beInvisible.
  1037     ]
  1037     ]
  1038 
  1038 
  1039     "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1039     "Created: / 23-06-2010 / 19:05:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1040 ! !
  1040 ! !
  1041 
  1041 
  1133 !
  1133 !
  1134 
  1134 
  1135 browseMethod: method label: label
  1135 browseMethod: method label: label
  1136 
  1136 
  1137     self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method].
  1137     self browser isNil ifTrue: [^NewSystemBrowser openInMethod:method].
  1138     (UserPreferences current alwaysOpenNewTabWhenCtrlClick 
  1138     (UserPreferences current alwaysOpenNewTabWhenCtrlClick
  1139         or:[self browser navigationState modified])  
  1139 	or:[self browser navigationState modified])
  1140         ifTrue:
  1140 	ifTrue:
  1141             [self browser 
  1141 	    [self browser
  1142                 spawnFullBrowserInClass: method mclass 
  1142 		spawnFullBrowserInClass: method mclass
  1143                 selector:method selector 
  1143 		selector:method selector
  1144                 in:#newBuffer]
  1144 		in:#newBuffer]
  1145         ifFalse:
  1145 	ifFalse:
  1146             [self browser 
  1146 	    [self browser
  1147                 switchToClass: method containingClass 
  1147 		switchToClass: method containingClass
  1148                 selector: method selector].
  1148 		selector: method selector].
  1149 
  1149 
  1150     "Modified: / 19-02-2008 / 10:15:17 / janfrog"
  1150     "Modified: / 19-02-2008 / 10:15:17 / janfrog"
  1151     "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1151     "Created: / 19-10-2008 / 08:16:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1152     "Modified: / 25-07-2010 / 13:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1152     "Modified: / 25-07-2010 / 13:34:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1153     "Modified: / 18-11-2011 / 14:58:12 / cg"
  1153     "Modified: / 18-11-2011 / 14:58:12 / cg"
  1154 !
  1154 !
  1155 
  1155 
  1156 browseMethods: methods label: label
  1156 browseMethods: methods label: label
  1157 
  1157 
  1158     methods size = 1 ifTrue:
  1158     methods size = 1 ifTrue:
  1159         [^self browseMethod: methods anyOne label: label].
  1159 	[^self browseMethod: methods anyOne label: label].
  1160 
  1160 
  1161     self browser 
  1161     self browser
  1162         ifNil: [NewSystemBrowser browseMethods: methods title: label]
  1162 	ifNil: [NewSystemBrowser browseMethods: methods title: label]
  1163         ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
  1163 	ifNotNil:[self browser spawnMethodBrowserFor:methods in:#newBuffer label:label]
  1164 
  1164 
  1165     "Created: / 26-12-2007 / 11:32:04 / janfrog"
  1165     "Created: / 26-12-2007 / 11:32:04 / janfrog"
  1166     "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1166     "Modified: / 19-10-2008 / 08:17:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1167 !
  1167 !
  1168 
  1168 
  1170     | selector selectedText compilerClass na |
  1170     | selector selectedText compilerClass na |
  1171 
  1171 
  1172     selectedText := givenSelectedText.
  1172     selectedText := givenSelectedText.
  1173     compilerClass := self language compilerClass.
  1173     compilerClass := self language compilerClass.
  1174     selectedText size > 0 ifTrue:[
  1174     selectedText size > 0 ifTrue:[
  1175         "/ self windowGroup withWaitCursorDo:[
  1175 	"/ self windowGroup withWaitCursorDo:[
  1176             "/ hack, for now and expecco; must ask the Parser eventually...
  1176 	    "/ hack, for now and expecco; must ask the Parser eventually...
  1177             (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
  1177 	    (compilerClass notNil and:[compilerClass includesBehavior:JavaScriptParser]) ifTrue:[
  1178                 "/ selector is in one piece anyway
  1178 		"/ selector is in one piece anyway
  1179                 (selectedText includes:$_) ifFalse:[
  1179 		(selectedText includes:$_) ifFalse:[
  1180                     "/ zero or one args - sigh (need to parse more to figure this out)
  1180 		    "/ zero or one args - sigh (need to parse more to figure this out)
  1181                     selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
  1181 		    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:1.
  1182                     selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
  1182 		    selectedText := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:0.
  1183                 ] ifTrue:[
  1183 		] ifTrue:[
  1184                     "/ count _#s plus one arg - sigh
  1184 		    "/ count _#s plus one arg - sigh
  1185                     na := (selectedText occurrencesOf:$_) + 1. 
  1185 		    na := (selectedText occurrencesOf:$_) + 1.
  1186                     selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
  1186 		    selector := JavaScriptParser basicNew translatedSmalltalkSelectorFor:selectedText numArgs:na
  1187                 ].
  1187 		].
  1188             ] ifFalse:[
  1188 	    ] ifFalse:[
  1189                 selector := SystemBrowser extractSelectorFrom:selectedText.
  1189 		selector := SystemBrowser extractSelectorFrom:selectedText.
  1190             ].
  1190 	    ].
  1191         "/ ]
  1191 	"/ ]
  1192     ].
  1192     ].
  1193     ^Array with: selector with: selectedText
  1193     ^Array with: selector with: selectedText
  1194 
  1194 
  1195     "Created: / 30-06-2011 / 19:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1195     "Created: / 30-06-2011 / 19:49:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1196     "Modified: / 05-03-2012 / 09:04:12 / cg"
  1196     "Modified: / 05-03-2012 / 09:04:12 / cg"
  1198 
  1198 
  1199 implementorsOf: selector
  1199 implementorsOf: selector
  1200 
  1200 
  1201     selector isNil ifTrue:[^#()].
  1201     selector isNil ifTrue:[^#()].
  1202     ^SystemBrowser
  1202     ^SystemBrowser
  1203         findImplementorsOf: selector
  1203 	findImplementorsOf: selector
  1204         in: Smalltalk allClasses
  1204 	in: Smalltalk allClasses
  1205         ignoreCase: false
  1205 	ignoreCase: false
  1206 
  1206 
  1207     "Created: / 26-12-2007 / 11:37:11 / janfrog"
  1207     "Created: / 26-12-2007 / 11:37:11 / janfrog"
  1208     "Modified: / 18-11-2011 / 14:58:17 / cg"
  1208     "Modified: / 18-11-2011 / 14:58:17 / cg"
  1209 !
  1209 !
  1210 
  1210 
  1211 sendersOf: selector
  1211 sendersOf: selector
       
  1212     |senderBlock|
  1212 
  1213 
  1213     selector isNil ifTrue:[^#()].
  1214     selector isNil ifTrue:[^#()].
  1214     ^SystemBrowser
  1215 
  1215         findSendersOf: selector
  1216     "/ not exact, but much faster (looks for symbol only, does not parse code for real send)
  1216         in: Smalltalk allClasses
  1217     senderBlock := SystemBrowser searchBlockForSymbol:selector.
  1217         ignoreCase: false
  1218     senderBlock == false ifTrue:[ ^ #() ].
       
  1219 
       
  1220     ^ SystemBrowser
       
  1221 	allMethodsIn:Smalltalk allClasses
       
  1222 	where:senderBlock.
       
  1223 
       
  1224     "/ exact, but much slower
       
  1225 "/    ^SystemBrowser
       
  1226 "/        findSendersOf: selector
       
  1227 "/        in: Smalltalk allClasses
       
  1228 "/        ignoreCase: false
  1218 
  1229 
  1219     "Created: / 26-12-2007 / 11:37:22 / janfrog"
  1230     "Created: / 26-12-2007 / 11:37:22 / janfrog"
  1220     "Modified: / 30-06-2011 / 19:32:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1231     "Modified: / 30-06-2011 / 19:32:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1221     "Modified: / 18-11-2011 / 14:58:19 / cg"
  1232     "Modified: / 18-11-2011 / 14:58:19 / cg"
  1222 ! !
  1233 ! !
  1223 
  1234 
  1224 !CodeView2 methodsFor:'delegation'!
  1235 !CodeView2 methodsFor:'delegation'!
  1225 
  1236 
  1226 doesNotUnderstand: aMessage
  1237 doesNotUnderstand: aMessage
  1227 
  1238 
  1228     ((textView respondsTo: aMessage selector) 
  1239     ((textView respondsTo: aMessage selector)
  1229     and:[(TraceSelectors includes:aMessage selector) not])
  1240     and:[(TraceSelectors includes:aMessage selector) not])
  1230         ifTrue:[^aMessage sendTo: textView].
  1241 	ifTrue:[^aMessage sendTo: textView].
  1231     ^super doesNotUnderstand: aMessage
  1242     ^super doesNotUnderstand: aMessage
  1232 
  1243 
  1233     "Created: / 13-02-2010 / 23:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1244     "Created: / 13-02-2010 / 23:27:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1234     "Modified: / 14-02-2010 / 09:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1245     "Modified: / 14-02-2010 / 09:53:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1235 !
  1246 !
  1244 !CodeView2 methodsFor:'delegation - events'!
  1255 !CodeView2 methodsFor:'delegation - events'!
  1245 
  1256 
  1246 buttonMotion: button x:x y:y in: view
  1257 buttonMotion: button x:x y:y in: view
  1247     "Delegates events to services. Answers true iff at least
  1258     "Delegates events to services. Answers true iff at least
  1248      one service handler method returns true. In that case,
  1259      one service handler method returns true. In that case,
  1249      the event is is NOT passed to the rest of services AND it is NOT
  1260      the event is is NOT processes by the view."
  1250      processes by the view."
  1261 
  1251 
  1262     ^ services
  1252     services do:[:service|
  1263 	contains:[:service |
  1253         service isEnabled ifTrue:[
  1264 	    service isEnabled and:[ ((service buttonMotion: button x:x y:y in: view) == true) ]
  1254             (service buttonMotion: button x:x y:y in: view) == true ifTrue:[
  1265 	].
  1255                 ^true
  1266 
  1256             ].
  1267     "Modified: / 07-03-2010 / 13:53:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1257         ].
       
  1258     ].
       
  1259     ^ false
       
  1260 
       
  1261     "Modified: / 06-10-2011 / 14:13:57 / cg"
  1268     "Modified: / 06-10-2011 / 14:13:57 / cg"
  1262     "Modified: / 31-01-2012 / 12:21:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1263 !
  1269 !
  1264 
  1270 
  1265 buttonPress: button x:x y:y in: view
  1271 buttonPress: button x:x y:y in: view
  1266     "Delegates events to services. Answers true iff at least
  1272     "Delegates events to services. Answers true iff at least
  1267      one service handler method returns true. In that case,
  1273      one service handler method returns true. In that case,
  1268      the event is is NOT passed to the rest of services AND it is NOT
  1274      the event is is NOT processes by the view."
  1269      processes by the view."
  1275 
  1270 
  1276     ^ services
  1271     services do:[:service|
  1277 	contains:[:service |
  1272         (service isEnabled and:[(service buttonPress: button x:x y:y in: view) == true]) ifTrue:[
  1278 	    service isEnabled and:[ ((service buttonPress: button x:x y:y in: view) == true) ]
  1273             ^true
  1279 	].
  1274         ]
  1280 
  1275     ].
  1281     "Modified: / 07-03-2010 / 13:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1276     ^false
       
  1277 
       
  1278     "Modified: / 06-10-2011 / 14:14:00 / cg"
  1282     "Modified: / 06-10-2011 / 14:14:00 / cg"
  1279     "Modified (format): / 05-03-2012 / 08:56:02 / cg"
  1283     "Modified (format): / 05-03-2012 / 08:56:02 / cg"
  1280     "Modified: / 04-04-2012 / 12:42:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1281 !
  1284 !
  1282 
  1285 
  1283 keyPress: key x:x y:y in: view
  1286 keyPress: key x:x y:y in: view
  1284     "Delegates events to services. Answers true iff at least
  1287     "Delegates events to services. Answers true iff at least
  1285      one service handler method returns true. In that case,
  1288      one service handler method returns true. In that case,
  1286      the event is is NOT passed to the rest of services AND it is NOT
  1289      the event is is NOT processes by the view."
  1287      processes by the view."
  1290 
  1288 
  1291     ^ services
  1289     services do:[:service|
  1292 	contains:[:service |
  1290         service isEnabled ifTrue:[
  1293 	    service isEnabled and:[ ((service keyPress: key x:x y:y in: view) == true) ]
  1291             (service keyPress: key x:x y:y in: view) == true ifTrue:[
  1294 	].
  1292                 ^true
  1295 
  1293             ].
  1296     "Modified: / 07-03-2010 / 13:54:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1294         ].
       
  1295     ].
       
  1296     ^ false
       
  1297 
       
  1298     "Modified: / 06-10-2011 / 14:14:11 / cg"
  1297     "Modified: / 06-10-2011 / 14:14:11 / cg"
  1299     "Modified: / 31-01-2012 / 12:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1300 !
  1298 !
  1301 
  1299 
  1302 keyRelease: key x:x y:y in: view
  1300 keyRelease: key x:x y:y in: view
  1303     "Delegates events to services. Answers true iff at least
  1301     "Delegates events to services. Answers true iff at least
  1304      one service handler method returns true. In that case,
  1302      one service handler method returns true. In that case,
  1305      the event is is NOT passed to the rest of services AND it is NOT
  1303      the event is is NOT processes by the view."
  1306      processes by the view."
  1304 
  1307 
  1305     ^ services
  1308     services do:[:service|
  1306 	contains:[:service |
  1309         service isEnabled ifTrue:[
  1307 	    service isEnabled and:[ ((service keyRelease: key x:x y:y in: view) == true) ]
  1310             (service keyRelease: key x:x y:y in: view) == true ifTrue:[
  1308 	].
  1311                 ^true
  1309 
  1312             ].
  1310     "Modified: / 07-03-2010 / 13:54:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1313         ].
       
  1314     ].
       
  1315     ^ false
       
  1316 
       
  1317     "Modified: / 06-10-2011 / 14:14:13 / cg"
  1311     "Modified: / 06-10-2011 / 14:14:13 / cg"
  1318     "Modified: / 31-01-2012 / 12:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
  1319 !
  1312 !
  1320 
  1313 
  1321 scrollTo:origin redraw:doRedraw in: view
  1314 scrollTo:origin redraw:doRedraw in: view
  1322     view == textView ifTrue: [
  1315     view == textView ifTrue: [
  1323         "/my text view scrolled...
  1316 	"/my text view scrolled...
  1324         synchronizedCodeViews do:[:codeView|
  1317 	synchronizedCodeViews do:[:codeView|
  1325             codeView scrollTo:origin redraw:doRedraw in: view.
  1318 	    codeView scrollTo:origin redraw:doRedraw in: view.
  1326         ]
  1319 	]
  1327     ] ifFalse: [
  1320     ] ifFalse: [
  1328         "/other code view scrolls and I'm notified about that
  1321 	"/other code view scrolls and I'm notified about that
  1329         textView basicScrollTo:origin redraw:doRedraw.
  1322 	textView basicScrollTo:origin redraw:doRedraw.
  1330     ]
  1323     ]
  1331 
  1324 
  1332     "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
  1325     "Created: / 06-04-2010 / 14:02:39 / Jakub <zelenja7@fel.cvut.cz>"
  1333     "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1326     "Created: / 19-03-2012 / 17:05:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1334 ! !
  1327 ! !
  1338 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1331 drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1339     "See the comment in
  1332     "See the comment in
  1340      CodeViewService>>drawLine:in:atX..."
  1333      CodeViewService>>drawLine:in:atX..."
  1341 
  1334 
  1342     services do:[:each|
  1335     services do:[:each|
  1343         each drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1336 	each drawLine:lineNo in: view atX:x y:y width: w height:h from:startCol to:endColOrNil with:fg and:bg
  1344     ]
  1337     ]
  1345 
  1338 
  1346     "Created: / 17-06-2011 / 13:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1339     "Created: / 17-06-2011 / 13:50:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1347     "Modified: / 06-10-2011 / 14:14:04 / cg"
  1340     "Modified: / 06-10-2011 / 14:14:04 / cg"
  1348 !
  1341 !
  1368     "Modified: / 07-03-2010 / 14:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1361     "Modified: / 07-03-2010 / 14:46:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1369 ! !
  1362 ! !
  1370 
  1363 
  1371 !CodeView2 methodsFor:'delegation-events'!
  1364 !CodeView2 methodsFor:'delegation-events'!
  1372 
  1365 
       
  1366 buttonRelease: button x:x y:y in: view
       
  1367     "Delegates events to services. Answers true iff at least
       
  1368      one service handler method returns true. In that case,
       
  1369      the event is is NOT processes by the view."
       
  1370 
       
  1371     ^ services
       
  1372 	contains:[:service |
       
  1373 	    service isEnabled and:[ ((service buttonRelease: button x:x y:y in: view) == true) ]
       
  1374 	].
       
  1375 !
       
  1376 
  1373 linesDeletedFrom: start to: end
  1377 linesDeletedFrom: start to: end
  1374 
  1378 
  1375     services do: [:each |
  1379     services do: [:each |
  1376         each isEnabled ifTrue: [
  1380 	each isEnabled ifTrue: [
  1377             each linesDeletedFrom: start to: end
  1381 	    each linesDeletedFrom: start to: end
  1378         ]
  1382 	]
  1379     ].
  1383     ].
  1380 
  1384 
  1381     "Created: / 06-07-2011 / 17:12:54 / jv"
  1385     "Created: / 06-07-2011 / 17:12:54 / jv"
  1382     "Modified: / 06-10-2011 / 14:14:16 / cg"
  1386     "Modified: / 06-10-2011 / 14:14:16 / cg"
  1383     "Modified: / 07-10-2011 / 19:14:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1387     "Modified: / 07-10-2011 / 19:14:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1384 !
  1388 !
  1385 
  1389 
  1386 linesInsertedFrom: start to: end
  1390 linesInsertedFrom: start to: end
  1387 
  1391 
  1388     services do: [:each |
  1392     services do: [:each |
  1389         each isEnabled ifTrue: [
  1393 	each isEnabled ifTrue: [
  1390             each linesInsertedFrom: start to: end
  1394 	    each linesInsertedFrom: start to: end
  1391         ]
  1395 	]
  1392     ].
  1396     ].
  1393 
  1397 
  1394     "Created: / 06-07-2011 / 17:12:48 / jv"
  1398     "Created: / 06-07-2011 / 17:12:48 / jv"
  1395     "Modified: / 06-10-2011 / 14:14:20 / cg"
  1399     "Modified: / 06-10-2011 / 14:14:20 / cg"
  1396 !
  1400 !
  1397 
  1401 
  1398 linesModifiedFrom: start to: end
  1402 linesModifiedFrom: start to: end
  1399 
  1403 
  1400     services do: [:each |
  1404     services do: [:each |
  1401         each isEnabled ifTrue: [
  1405 	each isEnabled ifTrue: [
  1402             each linesModifiedFrom: start to: end
  1406 	    each linesModifiedFrom: start to: end
  1403         ]
  1407 	]
  1404     ].
  1408     ].
  1405 
  1409 
  1406     "Created: / 06-07-2011 / 17:12:58 / jv"
  1410     "Created: / 06-07-2011 / 17:12:58 / jv"
  1407     "Modified: / 06-10-2011 / 14:13:44 / cg"
  1411     "Modified: / 06-10-2011 / 14:13:44 / cg"
  1408 ! !
  1412 !
       
  1413 
       
  1414 
       
  1415 
       
  1416  !
  1409 
  1417 
  1410 !CodeView2 methodsFor:'diff mode'!
  1418 !CodeView2 methodsFor:'diff mode'!
  1411 
  1419 
  1412 recomputeDiff:view 
  1420 recomputeDiff:view
  1413     |t1 t2 pom diffHelper view2|
  1421     |t1 t2 pom diffHelper view2|
  1414 
  1422 
  1415     t1 := view getNewOriginText.
  1423     t1 := view getNewOriginText.
  1416     synchronizedCodeViews do:[:codeView | 
  1424     synchronizedCodeViews do:[:codeView |
  1417         view2 := codeView
  1425 	view2 := codeView
  1418     ].
  1426     ].
  1419     view changedDiffText:false.
  1427     view changedDiffText:false.
  1420     view2 changedDiffText:false.
  1428     view2 changedDiffText:false.
  1421     t2 := view2 getNewOriginText.
  1429     t2 := view2 getNewOriginText.
  1422     pom := DiffCodeView2 new.
  1430     pom := DiffCodeView2 new.
  1423     (view == textView) ifTrue:[
  1431     (view == textView) ifTrue:[
  1424         diffHelper := pom computeDiffDataForText1:t1 text2:t2.
  1432 	diffHelper := pom computeDiffDataForText1:t1 text2:t2.
  1425         (view) contents:(diffHelper text1).
  1433 	(view) contents:(diffHelper text1).
  1426         (view) deletedLines:(diffHelper deleted).
  1434 	(view) deletedLines:(diffHelper deleted).
  1427         (view) changedLines:(diffHelper changed).
  1435 	(view) changedLines:(diffHelper changed).
  1428         (view) originDiffText:t1.
  1436 	(view) originDiffText:t1.
  1429         (view) emptyLines:(diffHelper inserted).
  1437 	(view) emptyLines:(diffHelper inserted).
  1430         (view) changedLines:(diffHelper changed).
  1438 	(view) changedLines:(diffHelper changed).
  1431         (view2) contents:(diffHelper text2).
  1439 	(view2) contents:(diffHelper text2).
  1432         (view2) insertedLines:(diffHelper inserted).
  1440 	(view2) insertedLines:(diffHelper inserted).
  1433         (view2) changedLines:(diffHelper changed).
  1441 	(view2) changedLines:(diffHelper changed).
  1434         (view2) originDiffText:t2.
  1442 	(view2) originDiffText:t2.
  1435         (view2) emptyLines:(diffHelper deleted).
  1443 	(view2) emptyLines:(diffHelper deleted).
  1436     ].
  1444     ].
  1437 
  1445 
  1438     "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
  1446     "Modified: / 22-06-2010 / 23:35:41 / Jakub <zelenja7@fel.cvut.cz>"
  1439     "Modified: / 23-06-2010 / 17:25:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1447     "Modified: / 23-06-2010 / 17:25:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1440 ! !
  1448 ! !
  1442 !CodeView2 methodsFor:'initialization'!
  1450 !CodeView2 methodsFor:'initialization'!
  1443 
  1451 
  1444 initialize
  1452 initialize
  1445     "Invoked when a new instance is created."
  1453     "Invoked when a new instance is created."
  1446     "Call super initialize"
  1454     "Call super initialize"
  1447     
  1455 
  1448     super initialize.
  1456     super initialize.
  1449      "Now set up some visual properties"
  1457      "Now set up some visual properties"
  1450     self level:-1.
  1458     self level:-1.
  1451      "Now initialize sub-views"
  1459      "Now initialize sub-views"
  1452     showGutterChannel := ValueHolder with: true.
  1460     showGutterChannel := ValueHolder with: true.
  1453     showGutterChannel addDependent: self.     
  1461     showGutterChannel addDependent: self.
  1454     "/ toDo: I don't like two options in the settings;
  1462     "/ toDo: I don't like two options in the settings;
  1455     "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)).
  1463     "/ showAcceptCancelBarChannel := (ValueHolder with: (UserPreferences current showAcceptCancelBarInBrowser)).
  1456     showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel).
  1464     showAcceptCancelBarChannel := ValueHolder with: (UserPreferences current codeView2ShowAcceptCancel).
  1457 
  1465 
  1458     "/ these views must be created first, as they refer to each other's channels in their
  1466     "/ these views must be created first, as they refer to each other's channels in their
  1462     textView := textViewScroller scrolledView.
  1470     textView := textViewScroller scrolledView.
  1463 
  1471 
  1464     self initializeGutterView.
  1472     self initializeGutterView.
  1465     self initializeTextView.
  1473     self initializeTextView.
  1466     textView setCodeView:self.
  1474     textView setCodeView:self.
  1467     modifiedChannel := ValueHolder with:false.    
  1475     modifiedChannel := ValueHolder with:false.
  1468     diffMode := false.
  1476     diffMode := false.
  1469     synchronizedCodeViews := #().
  1477     synchronizedCodeViews := #().
  1470     currentParseNodeHolder := ValueHolder new.
  1478     currentParseNodeHolder := ValueHolder new.
  1471     currentBlockNodeHolder := ValueHolder new.
  1479     currentBlockNodeHolder := ValueHolder new.
  1472 
  1480 
  1494     | serviceClasses |
  1502     | serviceClasses |
  1495 
  1503 
  1496     "/ only do it, if the services have not yet been defined by the user of this view
  1504     "/ only do it, if the services have not yet been defined by the user of this view
  1497     "/ (FileBrowser does not want Smalltalk-specific services)
  1505     "/ (FileBrowser does not want Smalltalk-specific services)
  1498     servicesFromClient ifFalse:[
  1506     servicesFromClient ifFalse:[
  1499         serviceClasses := CodeViewService availableServices 
  1507 	serviceClasses := CodeViewService availableServices
  1500             sort:[:a :b|
  1508 	    sort:[:a :b|
  1501                 a priority = b priority 
  1509 		a priority = b priority
  1502                     ifTrue:[a name < b name]
  1510 		    ifTrue:[a name < b name]
  1503                     ifFalse:[a priority > b priority]].
  1511 		    ifFalse:[a priority > b priority]].
  1504         serviceClasses do:[:cls|
  1512 	serviceClasses do:[:cls|
  1505             self registerService: cls new
  1513 	    self registerService: cls new
  1506         ].
  1514 	].
  1507     ].
  1515     ].
  1508 
  1516 
  1509     "Modified: / 06-10-2011 / 14:16:01 / cg"
  1517     "Modified: / 06-10-2011 / 14:16:01 / cg"
  1510     "Modified: / 01-02-2012 / 10:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1518     "Modified: / 01-02-2012 / 10:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1511 !
  1519 !
  1512 
  1520 
  1513 initializeTextView
  1521 initializeTextView
  1514     "Initialize textView. gutterView has to be already initialized!!"
  1522     "Initialize textView. gutterView has to be already initialized!!"
  1515 
  1523 
  1516     textViewScroller
  1524     textViewScroller
  1517         origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
  1525 	origin: ((self showGutter ifTrue:[gutterView width] ifFalse:[0.0]) @ 0.0)
  1518         corner: 1.0@1.0;
  1526 	corner: 1.0@1.0;
  1519         level: 0.
  1527 	level: 0.
  1520     textView level: 0.
  1528     textView level: 0.
  1521 
  1529 
  1522     textView modifiedChannel addDependent: self.
  1530     textView modifiedChannel addDependent: self.
  1523 
  1531 
  1524     "Created: / 02-09-2009 / 21:36:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1532     "Created: / 02-09-2009 / 21:36:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1638 
  1646 
  1639     superEditMenu := textView superEditMenu.
  1647     superEditMenu := textView superEditMenu.
  1640     moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
  1648     moreMenu := superEditMenu subMenuAt: superEditMenu numberOfItems.
  1641 
  1649 
  1642     textView sensor ctrlDown ifTrue:[
  1650     textView sensor ctrlDown ifTrue:[
  1643         ^superEditMenu
  1651 	^superEditMenu
  1644     ].
  1652     ].
  1645 
  1653 
  1646     editMenu := self class editMenu decodeAsLiteralArray.
  1654     editMenu := self class editMenu decodeAsLiteralArray.
  1647     moreMenuItem := editMenu menuItemLabeled: 'More'.
  1655     moreMenuItem := editMenu menuItemLabeled: 'More'.
  1648     moreMenuItem submenu: moreMenu asMenu.
  1656     moreMenuItem submenu: moreMenu asMenu.
  1660 
  1668 
  1661     | selectorAndSelectedText selector selectedText  implementors |
  1669     | selectorAndSelectedText selector selectedText  implementors |
  1662 
  1670 
  1663     selectedText := textView selectionAsString.
  1671     selectedText := textView selectionAsString.
  1664     selectedText size > 0 ifTrue:[
  1672     selectedText size > 0 ifTrue:[
  1665         "/ self windowGroup withWaitCursorDo:[
  1673 	"/ self windowGroup withWaitCursorDo:[
  1666             selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
  1674 	    selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
  1667             selector := selectorAndSelectedText first.
  1675 	    selector := selectorAndSelectedText first.
  1668             selectedText := selectorAndSelectedText second.
  1676 	    selectedText := selectorAndSelectedText second.
  1669 
  1677 
  1670             (selector notNil and:[selector = selectedText]) ifTrue:[
  1678 	    (selector notNil and:[selector = selectedText]) ifTrue:[
  1671                 implementors := (SystemBrowser 
  1679 		implementors := (SystemBrowser
  1672                                     findImplementorsOf:selectedText "Any: (Array with:selectedText)" 
  1680 				    findImplementorsOf:selectedText "Any: (Array with:selectedText)"
  1673                                     in:(Smalltalk allClasses) 
  1681 				    in:(Smalltalk allClasses)
  1674                                     ignoreCase:false)
  1682 				    ignoreCase:false)
  1675 
  1683 
  1676             ] ifFalse:[
  1684 	    ] ifFalse:[
  1677                 implementors := (SystemBrowser 
  1685 		implementors := (SystemBrowser
  1678                                     findImplementorsOfAny:(Array with:selectedText with: selector) 
  1686 				    findImplementorsOfAny:(Array with:selectedText with: selector)
  1679                                     in:(Smalltalk allClasses) 
  1687 				    in:(Smalltalk allClasses)
  1680                                     ignoreCase:false)
  1688 				    ignoreCase:false)
  1681             ].
  1689 	    ].
  1682         "/ ] 
  1690 	"/ ]
  1683     ] ifFalse:[
  1691     ] ifFalse:[
  1684         implementors := #().
  1692 	implementors := #().
  1685     ].
  1693     ].
  1686 
  1694 
  1687     ^self implementorsMenu: implementors selector: (selector ? selectedText)
  1695     ^self implementorsMenu: implementors selector: (selector ? selectedText)
  1688 
  1696 
  1689     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1697     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1690     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1698     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1691     "Modified: / 05-03-2012 / 09:02:43 / cg"
  1699     "Modified: / 05-03-2012 / 09:02:43 / cg"
  1692 !
  1700 !
  1693 
  1701 
  1694 implementorsMenu: implementors selector: selector  
  1702 implementorsMenu: implementors selector: selector
  1695     | menu|
  1703     | menu|
  1696 
  1704 
  1697     menu := Menu new.
  1705     menu := Menu new.
  1698     implementors isEmptyOrNil ifTrue:[
  1706     implementors isEmptyOrNil ifTrue:[
  1699         menu addItem:(MenuItem label:'No implementors found') disable
  1707 	menu addItem:(MenuItem label:'No implementors found') disable
  1700     ] ifFalse:[
  1708     ] ifFalse:[
  1701         menu addItem:(MenuItem 
  1709 	menu addItem:(MenuItem
  1702                     label:(selector storeString , (' (all implementors) ') asText allItalic)
  1710 		    label:(selector storeString , (' (all implementors) ') asText allItalic)
  1703                     value:[
  1711 		    value:[
  1704                         self browseMethods:implementors
  1712 			self browseMethods:implementors
  1705                             label:'Implementors of ' , selector storeString
  1713 			    label:'Implementors of ' , selector storeString
  1706                     ]).
  1714 		    ]).
  1707 
  1715 
  1708         menu addSeparator.
  1716 	menu addSeparator.
  1709         (implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
  1717 	(implementors asOrderedCollection sort:[:a :b | a mclass name < b mclass name])
  1710         "implementors" do:[:mth | 
  1718 	"implementors" do:[:mth |
  1711             menu 
  1719 	    menu
  1712                 addItem:(MenuItem label:(selector storeString 
  1720 		addItem:(MenuItem label:(selector storeString
  1713                                 , (' in ' , mth containingClass name asText allBold))
  1721 				, (' in ' , mth containingClass name asText allBold))
  1714                         value:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
  1722 			value:[ self browseMethod:mth label: 'Implementor of ' , selector storeString  ])
  1715         ]
  1723 	]
  1716     ].
  1724     ].
  1717     ^ menu
  1725     ^ menu
  1718 
  1726 
  1719     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1727     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1720     "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1728     "Created: / 14-02-2010 / 19:39:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1725 
  1733 
  1726     | selectorAndSelectedText selector selectedText  senders |
  1734     | selectorAndSelectedText selector selectedText  senders |
  1727 
  1735 
  1728     selectedText := textView selectionAsString.
  1736     selectedText := textView selectionAsString.
  1729     selectedText size > 0 ifTrue:[
  1737     selectedText size > 0 ifTrue:[
  1730         "/ self windowGroup withWaitCursorDo:[
  1738 	"/ self windowGroup withWaitCursorDo:[
  1731             selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
  1739 	    selectorAndSelectedText := self extractSelectorAndSelectedTextFrom:  selectedText.
  1732             selector := selectorAndSelectedText first.
  1740 	    selector := selectorAndSelectedText first.
  1733             selectedText := selectorAndSelectedText second.
  1741 	    selectedText := selectorAndSelectedText second.
  1734 
  1742 
  1735             (selector notNil and:[selector = selectedText]) ifTrue:[
  1743 	    (selector notNil and:[selector = selectedText]) ifTrue:[
  1736                 senders := (SystemBrowser 
  1744 		senders := (SystemBrowser
  1737                                 findSendersOf:selectedText "Any:(Array with:selectedText)" 
  1745 				findSendersOf:selectedText "Any:(Array with:selectedText)"
  1738                                 in:(Smalltalk allClasses) 
  1746 				in:(Smalltalk allClasses)
  1739                                 ignoreCase:false)
  1747 				ignoreCase:false)
  1740 
  1748 
  1741             ] ifFalse:[
  1749 	    ] ifFalse:[
  1742                 senders := (SystemBrowser 
  1750 		senders := (SystemBrowser
  1743                                 findSendersOfAny:(Array with:selectedText with: selector) 
  1751 				findSendersOfAny:(Array with:selectedText with: selector)
  1744                                 in:(Smalltalk allClasses) 
  1752 				in:(Smalltalk allClasses)
  1745                                 ignoreCase:false)
  1753 				ignoreCase:false)
  1746             ].
  1754 	    ].
  1747         "/ ] 
  1755 	"/ ]
  1748     ] ifFalse:[
  1756     ] ifFalse:[
  1749         senders := #().
  1757 	senders := #().
  1750     ].
  1758     ].
  1751 
  1759 
  1752     ^self sendersMenu: senders selector: (selector ? selectedText)
  1760     ^self sendersMenu: senders selector: (selector ? selectedText)
  1753 
  1761 
  1754     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1762     "Modified: / 19-10-2008 / 08:16:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1755     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1763     "Created: / 30-06-2011 / 19:28:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1756     "Modified: / 05-03-2012 / 09:02:56 / cg"
  1764     "Modified: / 05-03-2012 / 09:02:56 / cg"
  1757 !
  1765 !
  1758 
  1766 
  1759 sendersMenu: senders  selector: selector  
  1767 sendersMenu: senders  selector: selector
  1760     | menu shownSenderItems numCut sendersSorted|
  1768     | menu shownSenderItems numCut sendersSorted|
  1761 
  1769 
  1762     menu := Menu new.
  1770     menu := Menu new.
  1763     senders isEmptyOrNil ifTrue:[
  1771     senders isEmptyOrNil ifTrue:[
  1764         menu addItem:(MenuItem label:'No senders found') disable
  1772 	menu addItem:(MenuItem label:'No senders found') disable
  1765     ] ifFalse:[
  1773     ] ifFalse:[
  1766         menu addItem:(MenuItem 
  1774 	menu addItem:(MenuItem
  1767                     label:(selector storeString , (' (all senders)') asText allItalic)
  1775 		    label:(selector storeString , (' (all senders)') asText allItalic)
  1768                     value:[
  1776 		    value:[
  1769                         self browseMethods:senders
  1777 			self browseMethods:senders
  1770                             label:'Senders of ' , selector storeString
  1778 			    label:'Senders of ' , selector storeString
  1771                     ]).
  1779 		    ]).
  1772         menu addSeparator.
  1780 	menu addSeparator.
  1773         sendersSorted := senders asOrderedCollection 
  1781 	sendersSorted := senders asOrderedCollection
  1774                             sort:[:a :b | a whoString < b whoString].
  1782 			    sort:[:a :b | a whoString < b whoString].
  1775         shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
  1783 	shownSenderItems := (senders size > 20) ifTrue:[sendersSorted copyTo:20] ifFalse:[sendersSorted].
  1776         numCut := senders size - 20.
  1784 	numCut := senders size - 20.
  1777         shownSenderItems do:[:mth | 
  1785 	shownSenderItems do:[:mth |
  1778             menu 
  1786 	    menu
  1779                 addItem:(MenuItem label:(mth selector storeString 
  1787 		addItem:(MenuItem label:(mth selector storeString
  1780                                 , (' in ' , mth containingClass name asText allBold))
  1788 				, (' in ' , mth containingClass name asText allBold))
  1781                         value:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
  1789 			value:[ self browseMethod:mth label: 'Sender of ' , selector storeString ])
  1782         ].
  1790 	].
  1783         numCut > 0 ifTrue:[
  1791 	numCut > 0 ifTrue:[
  1784             menu addSeparator.
  1792 	    menu addSeparator.
  1785             menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
  1793 	    menu addItem:(MenuItem label:('... %1 more senders not shown here' bindWith:numCut)) disable
  1786         ].
  1794 	].
  1787     ].
  1795     ].
  1788     ^ menu
  1796     ^ menu
  1789 
  1797 
  1790     "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1798     "Modified: / 19-10-2008 / 08:17:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1791     "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1799     "Created: / 14-02-2010 / 19:40:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1802     item indication:(self showGutterChannel).
  1810     item indication:(self showGutterChannel).
  1803     menu addItem:item.
  1811     menu addItem:item.
  1804     menu addSeparator.
  1812     menu addSeparator.
  1805 
  1813 
  1806     anyService := false.
  1814     anyService := false.
  1807     services do:[:service | 
  1815     services do:[:service |
  1808         |item|
  1816 	|item|
  1809 
  1817 
  1810         item := MenuItem label:(resources string:service label).
  1818 	item := MenuItem label:(resources string:service label).
  1811         item indication:((AspectAdaptor forAspect:#enabled) subject:service).
  1819 	item indication:((AspectAdaptor forAspect:#enabled) subject:service).
  1812         menu addItem:item.
  1820 	menu addItem:item.
  1813         anyService := true.
  1821 	anyService := true.
  1814     ].
  1822     ].
  1815 
  1823 
  1816     anyService ifTrue:[
  1824     anyService ifTrue:[
  1817         menu addSeparator.
  1825 	menu addSeparator.
  1818     ].
  1826     ].
  1819 
  1827 
  1820     item := MenuItem label:(resources string:'Debug').
  1828     item := MenuItem label:(resources string:'Debug').
  1821     item submenuChannel:[ self class debugMenu ].
  1829     item submenuChannel:[ self class debugMenu ].
  1822     menu addItem:item.
  1830     menu addItem:item.
  1828 ! !
  1836 ! !
  1829 
  1837 
  1830 !CodeView2 methodsFor:'private'!
  1838 !CodeView2 methodsFor:'private'!
  1831 
  1839 
  1832 codeCompletion
  1840 codeCompletion
  1833     |cls 
  1841     |cls
  1834 "/     crsrPos interval node checkedNode
  1842 "/     crsrPos interval node checkedNode
  1835 "/     char start stop selectorSoFar matchingSelectors
  1843 "/     char start stop selectorSoFar matchingSelectors
  1836     |
  1844     |
  1837 
  1845 
  1838 
  1846 
  1839     cls := self classHolder value.
  1847     cls := self classHolder value.
  1840     cls isNil ifTrue:[
  1848     cls isNil ifTrue:[
  1841         self showInfo:'No class'.
  1849 	self showInfo:'No class'.
  1842         ^ self.
  1850 	^ self.
  1843     ].
  1851     ].
  1844     UserInformation handle:[:ex |
  1852     UserInformation handle:[:ex |
  1845         self showInfo:(ex messageText).
  1853 	self showInfo:(ex messageText).
  1846         ex proceed.
  1854 	ex proceed.
  1847     ] do:[
  1855     ] do:[
  1848         self withWaitCursorDo:[
  1856 	self withWaitCursorDo:[
  1849             DoWhatIMeanSupport codeCompletionForClass:cls codeView:self.
  1857 	    DoWhatIMeanSupport codeCompletionForClass:cls codeView:self.
  1850         ]
  1858 	]
  1851     ].
  1859     ].
  1852     ^ self.
  1860     ^ self.
  1853 
  1861 
  1854 "/
  1862 "/
  1855 "/    interval := self selectedInterval.
  1863 "/    interval := self selectedInterval.
  1909 
  1917 
  1910     textView modified ifTrue:[^true].
  1918     textView modified ifTrue:[^true].
  1911 
  1919 
  1912     "/ higher prio to prevent it from being changed while we convert it (by editing)
  1920     "/ higher prio to prevent it from being changed while we convert it (by editing)
  1913     Processor activeProcess
  1921     Processor activeProcess
  1914         withHigherPriorityDo:[
  1922 	withHigherPriorityDo:[
  1915             changedSource := textView contentsAsString asStringCollection.
  1923 	    changedSource := textView contentsAsString asStringCollection.
  1916         ].
  1924 	].
  1917     changedSource := changedSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
  1925     changedSource := changedSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
  1918     changedSource := changedSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
  1926     changedSource := changedSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
  1919     [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
  1927     [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
  1920         changedSource := changedSource copyButLast:1
  1928 	changedSource := changedSource copyButLast:1
  1921     ].
  1929     ].
  1922     changedSource := changedSource asString.
  1930     changedSource := changedSource asString.
  1923 
  1931 
  1924         originalSource := textView model value ? ''.
  1932 	originalSource := textView model value ? ''.
  1925 
  1933 
  1926         originalSource := originalSource asStringCollection.
  1934 	originalSource := originalSource asStringCollection.
  1927         originalSource := originalSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
  1935 	originalSource := originalSource collect:[:line | line string withoutTrailingSeparators withTabsExpanded].
  1928         originalSource := originalSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
  1936 	originalSource := originalSource collect:[:line | line isEmpty ifTrue:[nil] ifFalse:[line]].
  1929         [originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
  1937 	[originalSource size > 0 and:[originalSource last isNil]] whileTrue:[
  1930             originalSource := originalSource copyButLast:1
  1938 	    originalSource := originalSource copyButLast:1
  1931         ].
  1939 	].
  1932 
  1940 
  1933         s1 := originalSource asString.
  1941 	s1 := originalSource asString.
  1934         s2 := changedSource asString.
  1942 	s2 := changedSource asString.
  1935         modified := (s1 ~= s2).
  1943 	modified := (s1 ~= s2).
  1936 
  1944 
  1937     ^ modified
  1945     ^ modified
  1938 
  1946 
  1939     "Created: / 06-02-2010 / 19:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1947     "Created: / 06-02-2010 / 19:59:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1940     "Modified (format): / 05-06-2012 / 23:55:02 / cg"
  1948     "Modified (format): / 05-06-2012 / 23:55:02 / cg"
  1942 
  1950 
  1943 showInfo: message
  1951 showInfo: message
  1944 
  1952 
  1945     | app |
  1953     | app |
  1946     (app := self topView application) ifNotNil:
  1954     (app := self topView application) ifNotNil:
  1947         [(app respondsTo: #showInfo:) ifTrue:
  1955 	[(app respondsTo: #showInfo:) ifTrue:
  1948             [app showInfo: message]].
  1956 	    [app showInfo: message]].
  1949 
  1957 
  1950     "Modified: / 13-02-2010 / 23:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1958     "Modified: / 13-02-2010 / 23:25:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1951 ! !
  1959 ! !
  1952 
  1960 
  1953 !CodeView2 methodsFor:'private-accessing'!
  1961 !CodeView2 methodsFor:'private-accessing'!
  1964 !
  1972 !
  1965 
  1973 
  1966 syntaxElementSelection:anElement
  1974 syntaxElementSelection:anElement
  1967     syntaxElementSelection := anElement.
  1975     syntaxElementSelection := anElement.
  1968     anElement isNil ifTrue:[
  1976     anElement isNil ifTrue:[
  1969         currentParseNodeHolder value: nil.
  1977 	currentParseNodeHolder value: nil.
  1970         currentBlockNodeHolder value: nil.
  1978 	currentBlockNodeHolder value: nil.
  1971     ] ifFalse:[
  1979     ] ifFalse:[
  1972         currentParseNodeHolder value: anElement node.
  1980 	currentParseNodeHolder value: anElement node.
  1973         currentBlockNodeHolder value: anElement node enclosingBlock.
  1981 	currentBlockNodeHolder value: anElement node enclosingBlock.
  1974     ]
  1982     ]
  1975 
  1983 
  1976     "Modified: / 16-02-2012 / 23:06:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1984     "Modified: / 16-02-2012 / 23:06:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  1977 !
  1985 !
  1978 
  1986 
  2001 !CodeView2 methodsFor:'realization'!
  2009 !CodeView2 methodsFor:'realization'!
  2002 
  2010 
  2003 postRealize
  2011 postRealize
  2004 
  2012 
  2005     services do:[:service|
  2013     services do:[:service|
  2006         service viewRealized.
  2014 	service viewRealized.
  2007     ]
  2015     ]
  2008 
  2016 
  2009     "Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2017     "Created: / 23-01-2012 / 10:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2010 ! !
  2018 ! !
  2011 
  2019 
  2075     ^(self height * 0.6) ceiling.
  2083     ^(self height * 0.6) ceiling.
  2076 
  2084 
  2077     "Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2085     "Created: / 07-10-2011 / 19:53:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2078 !
  2086 !
  2079 
  2087 
  2080 cancelButtonBottom  
  2088 cancelButtonBottom
  2081 
  2089 
  2082     ^(self height * 0.8) ceiling.
  2090     ^(self height * 0.8) ceiling.
  2083 
  2091 
  2084     "Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2092     "Created: / 07-10-2011 / 19:54:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2085 !
  2093 !
  2086 
  2094 
  2087 padding
  2095 padding
  2088 
  2096 
  2089     ^self paddingLeft + self paddingRight 
  2097     ^self paddingLeft + self paddingRight
  2090         + self usedWidthForAcceptCancel    
  2098 	+ self usedWidthForAcceptCancel
  2091         + (widthAnnotations ? 0) 
  2099 	+ (widthAnnotations ? 0)
  2092         + (widthDiffInfo ? 0)
  2100 	+ (widthDiffInfo ? 0)
  2093 
  2101 
  2094     "Created: / 14-02-2010 / 22:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2102     "Created: / 14-02-2010 / 22:28:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2095     "Modified: / 07-10-2011 / 19:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2103     "Modified: / 07-10-2011 / 19:01:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2096     "Modified (format): / 07-10-2011 / 20:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2104     "Modified (format): / 07-10-2011 / 20:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2097 !
  2105 !
  2118     explicitExtent ifNotNil:[^explicitExtent].
  2126     explicitExtent ifNotNil:[^explicitExtent].
  2119     preferredExtent ifNotNil:[^preferredExtent].
  2127     preferredExtent ifNotNil:[^preferredExtent].
  2120 
  2128 
  2121     font := self font.
  2129     font := self font.
  2122     w := (font widthOf:'00') + self padding.
  2130     w := (font widthOf:'00') + self padding.
  2123     h := textView notNil 
  2131     h := textView notNil
  2124             ifTrue:[textView height] 
  2132 	    ifTrue:[textView height]
  2125             ifFalse:[font height * 12].
  2133 	    ifFalse:[font height * 12].
  2126 
  2134 
  2127     ^preferredExtent := w @ h
  2135     ^preferredExtent := w @ h
  2128 
  2136 
  2129     "Modified: / 16-06-2011 / 14:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2137     "Modified: / 16-06-2011 / 14:03:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2130     "Modified (format): / 26-03-2012 / 11:19:54 / cg"
  2138     "Modified (format): / 26-03-2012 / 11:19:54 / cg"
  2159 
  2167 
  2160 currentBlockNodeHolder
  2168 currentBlockNodeHolder
  2161     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
  2169     "return/create the 'currentBlockNodeHolder' value holder (automatically generated)"
  2162 
  2170 
  2163     currentBlockNodeHolder isNil ifTrue:[
  2171     currentBlockNodeHolder isNil ifTrue:[
  2164         currentBlockNodeHolder := ValueHolder new.
  2172 	currentBlockNodeHolder := ValueHolder new.
  2165         currentBlockNodeHolder addDependent:self.
  2173 	currentBlockNodeHolder addDependent:self.
  2166     ].
  2174     ].
  2167     ^ currentBlockNodeHolder
  2175     ^ currentBlockNodeHolder
  2168 !
  2176 !
  2169 
  2177 
  2170 currentBlockNodeHolder:something
  2178 currentBlockNodeHolder:something
  2171     "set the 'currentBlockNodeHolder' value holder (automatically generated)"
  2179     "set the 'currentBlockNodeHolder' value holder (automatically generated)"
  2172 
  2180 
  2173     |oldValue newValue|
  2181     |oldValue newValue|
  2174 
  2182 
  2175     currentBlockNodeHolder notNil ifTrue:[
  2183     currentBlockNodeHolder notNil ifTrue:[
  2176         oldValue := currentBlockNodeHolder value.
  2184 	oldValue := currentBlockNodeHolder value.
  2177         currentBlockNodeHolder removeDependent:self.
  2185 	currentBlockNodeHolder removeDependent:self.
  2178     ].
  2186     ].
  2179     currentBlockNodeHolder := something.
  2187     currentBlockNodeHolder := something.
  2180     currentBlockNodeHolder notNil ifTrue:[
  2188     currentBlockNodeHolder notNil ifTrue:[
  2181         currentBlockNodeHolder addDependent:self.
  2189 	currentBlockNodeHolder addDependent:self.
  2182     ].
  2190     ].
  2183     newValue := currentBlockNodeHolder value.
  2191     newValue := currentBlockNodeHolder value.
  2184     oldValue ~~ newValue ifTrue:[
  2192     oldValue ~~ newValue ifTrue:[
  2185         self update:#value with:newValue from:currentBlockNodeHolder.
  2193 	self update:#value with:newValue from:currentBlockNodeHolder.
  2186     ].
  2194     ].
  2187 ! !
  2195 ! !
  2188 
  2196 
  2189 !CodeView2::GutterView methodsFor:'change & update'!
  2197 !CodeView2::GutterView methodsFor:'change & update'!
  2190 
  2198 
  2191 update:something with:aParameter from:changedObject
  2199 update:something with:aParameter from:changedObject
  2192     self shown ifFalse:[^self].
  2200     self shown ifFalse:[^self].
  2193 
  2201 
  2194     (changedObject == textView) ifTrue:[
  2202     (changedObject == textView) ifTrue:[
  2195         (something == #sizeOfContents) ifTrue:[
  2203 	(something == #sizeOfContents) ifTrue:[
  2196             "/ cg: with that test, it does not update when the text becomes smaller...
  2204 	    "/ cg: with that test, it does not update when the text becomes smaller...
  2197 "/            (firstLineShown ~= textView firstLineShown 
  2205 "/            (firstLineShown ~= textView firstLineShown
  2198 "/            or:[lastLineShown ~= (textView lastLineShown - 1)]) ifTrue:[
  2206 "/            or:[lastLineShown ~= (textView lastLineShown - 1)]) ifTrue:[
  2199                 self invalidate.
  2207 		self invalidate.
  2200                 ^self.
  2208 		^self.
  2201 "/            ]
  2209 "/            ]
  2202         ].
  2210 	].
  2203     ].
  2211     ].
  2204     (changedObject == textView reallyModifiedChannel) ifTrue:[
  2212     (changedObject == textView reallyModifiedChannel) ifTrue:[
  2205         self invalidate.
  2213 	self invalidate.
  2206     ].
  2214     ].
  2207 
  2215 
  2208     changedObject == codeView currentBlockNodeHolder ifTrue:[
  2216     changedObject == codeView currentBlockNodeHolder ifTrue:[
  2209          self invalidate.
  2217 	 self invalidate.
  2210          ^ self.
  2218 	 ^ self.
  2211     ].
  2219     ].
  2212 
  2220 
  2213 
  2221 
  2214     "/ changedObject == someOfMyValueHolders ifTrue:[
  2222     "/ changedObject == someOfMyValueHolders ifTrue:[
  2215     "/     self doSomethingApropriate.
  2223     "/     self doSomethingApropriate.
  2225 
  2233 
  2226 buttonPress: btn x: x y: y
  2234 buttonPress: btn x: x y: y
  2227     |extraSafeArea|
  2235     |extraSafeArea|
  2228 
  2236 
  2229     (x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[
  2237     (x <= (self paddingLeft + self usedWidthForAcceptCancel)) ifTrue:[
  2230         textView reallyModified ifTrue:[
  2238 	textView reallyModified ifTrue:[
  2231             (y < self acceptButtonBottom) ifTrue:[
  2239 	    (y < self acceptButtonBottom) ifTrue:[
  2232                 self accept.
  2240 		self accept.
  2233                 ^self.
  2241 		^self.
  2234             ].
  2242 	    ].
  2235             (y < self cancelButtonBottom) ifTrue:[
  2243 	    (y < self cancelButtonBottom) ifTrue:[
  2236                 self cancel.
  2244 		self cancel.
  2237                 ^self.            
  2245 		^self.
  2238             ].
  2246 	    ].
  2239             self diff.
  2247 	    self diff.
  2240         ].
  2248 	].
  2241         ^self.
  2249 	^self.
  2242     ].
  2250     ].
  2243 
  2251 
  2244 false ifTrue:[
  2252 false ifTrue:[
  2245     "Do not allow clicking on line numbers..."
  2253     "Do not allow clicking on line numbers..."
  2246     extraSafeArea := "('999' widthOn:self)" 5.
  2254     extraSafeArea := "('999' widthOn:self)" 5.
  2247     x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
  2255     x < (self width - self paddingRight - widthDiffInfo - extraSafeArea) ifFalse:[^ self].
  2248 ].
  2256 ].
  2249 
  2257 
  2250     ((x > (self paddingLeft + self usedWidthForAcceptCancel)) or:
  2258     ((x > (self paddingLeft + self usedWidthForAcceptCancel)) or:
  2251         [x < (self width - self paddingRight - widthDiffInfo)]
  2259 	[x < (self width - self paddingRight - widthDiffInfo)]
  2252     ) ifTrue:[
  2260     ) ifTrue:[
  2253         (codeView buttonPress: btn x:x y:y in: self) ifFalse:[
  2261 	(codeView buttonPress: btn x:x y:y in: self) ifFalse:[
  2254             super buttonPress: btn x: x y: y
  2262 	    super buttonPress: btn x: x y: y
  2255         ]
  2263 	]
  2256     ] ifFalse:[
  2264     ] ifFalse:[
  2257         super buttonPress: btn x: x y: y
  2265 	super buttonPress: btn x: x y: y
  2258     ]
  2266     ]
  2259 
  2267 
  2260     "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2268     "Created: / 17-06-2011 / 13:02:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2261     "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
  2269     "Modified (comment): / 18-05-2012 / 10:56:54 / cg"
  2262 ! !
  2270 ! !
  2351 redrawAcceptCancelBarX: x y: y width:w height:h
  2359 redrawAcceptCancelBarX: x y: y width:w height:h
  2352 
  2360 
  2353     | rw acceptBottom cancelBottom |
  2361     | rw acceptBottom cancelBottom |
  2354 
  2362 
  2355     x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
  2363     x > ((self paddingLeft) + (widthAcceptCancel ? 0)) ifTrue:[
  2356         ^self.
  2364 	^self.
  2357     ].
  2365     ].
  2358     rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
  2366     rw := ((x + w) min: (self paddingLeft + (widthAcceptCancel ? 0))) - x.
  2359     
  2367 
  2360 
  2368 
  2361     textView reallyModified ifFalse:[
  2369     textView reallyModified ifFalse:[
  2362         self fillRectangleX:x y:y width:rw height:h color: self viewBackground
  2370 	self fillRectangleX:x y:y width:rw height:h color: self viewBackground
  2363     ] ifTrue:[
  2371     ] ifTrue:[
  2364         acceptBottom := self acceptButtonBottom.
  2372 	acceptBottom := self acceptButtonBottom.
  2365         cancelBottom := self cancelButtonBottom.
  2373 	cancelBottom := self cancelButtonBottom.
  2366         y < acceptBottom ifTrue:[
  2374 	y < acceptBottom ifTrue:[
  2367             self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
  2375 	    self fillRectangleX:x y:y width:rw height: ((y + h) min: acceptBottom) color: acceptColor.
  2368         ].
  2376 	].
  2369         (y < cancelBottom) ifTrue:[
  2377 	(y < cancelBottom) ifTrue:[
  2370             self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
  2378 	    self fillRectangleX:x y: acceptBottom + 1width:rw height: ((y + h) min: cancelBottom) - acceptBottom - 1color: cancelColor.
  2371         ].  
  2379 	].
  2372         (y + h >= cancelBottom) ifTrue:[
  2380 	(y + h >= cancelBottom) ifTrue:[
  2373             self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
  2381 	    self fillRectangleX:x y: cancelBottom + 1 width:rw height: (y + h) - cancelBottom - 1 color: diffColor.
  2374         ]
  2382 	]
  2375     
  2383 
  2376     ]
  2384     ]
  2377 
  2385 
  2378     "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2386     "Created: / 07-10-2011 / 19:44:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2379 !
  2387 !
  2380 
  2388 
  2381 redrawBackgroundX:x y:y width:w height:h
  2389 redrawBackgroundX:x y:y width:w height:h
  2382     "redraws gutter background"
  2390     "redraws gutter background"
  2383 
  2391 
  2384     "background is filled with background color"
  2392     "background is filled with background color"
  2385     self 
  2393     self
  2386         fillRectangleX:x
  2394 	fillRectangleX:x
  2387         y:y
  2395 	y:y
  2388         width:w
  2396 	width:w
  2389         height:h
  2397 	height:h
  2390         color: self viewBackground "backgroundPaint". 
  2398 	color: self viewBackground "backgroundPaint".
  2391 
  2399 
  2392     "separator line is drawn with foreground color"
  2400     "separator line is drawn with foreground color"
  2393     self 
  2401     self
  2394         displayLineFromX:(self width - 2)
  2402 	displayLineFromX:(self width - 2)
  2395         y:y
  2403 	y:y
  2396         toX:(self width - 2)
  2404 	toX:(self width - 2)
  2397         y:(y+h).
  2405 	y:(y+h).
  2398 
  2406 
  2399     "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
  2407     "Created: / 14-12-2009 / 13:15:53 / Jindra <a>"
  2400     "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
  2408     "Modified: / 14-12-2009 / 15:09:54 / Jindra <a>"
  2401     "Modified: / 17-08-2011 / 15:12:47 / cg"
  2409     "Modified: / 17-08-2011 / 15:12:47 / cg"
  2402     "Modified (comment): / 07-10-2011 / 19:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2410     "Modified (comment): / 07-10-2011 / 19:37:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2403 !
  2411 !
  2404 
  2412 
  2405 redrawLine:line 
  2413 redrawLine:line
  2406 
  2414 
  2407     ^self redrawLine:line cleared: false.
  2415     ^self redrawLine:line cleared: false.
  2408 
  2416 
  2409     "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2417     "Modified: / 17-06-2011 / 14:12:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2410 !
  2418 !
  2411 
  2419 
  2412 redrawLine:line cleared: cleared
  2420 redrawLine:line cleared: cleared
  2413     "redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor"
  2421     "redraws specified line. Returns width of drawn object. Color of drawn objects should be taken from lineFont, lineColor"
  2414     
  2422 
  2415     |lineString y0 yOfLine textW requiredW oldFont newFont oldColor newColor|
  2423     |lineString y0 yOfLine textW requiredW oldFont newFont oldColor newColor|
  2416 
  2424 
  2417     lineString := self displayedString:line.
  2425     lineString := self displayedString:line.
  2418     textW := (lineString widthOn:self).
  2426     textW := (lineString widthOn:self).
  2419     requiredW := textW + self padding.
  2427     requiredW := textW + self padding.
  2420 
  2428 
  2421     oldFont := self font.
  2429     oldFont := self font.
  2422     oldColor := self paint.
  2430     oldColor := self paint.
  2423     newFont := self lineFont:line.
  2431     newFont := self lineFont:line.
  2424     newFont isNil ifTrue:[ 
  2432     newFont isNil ifTrue:[
  2425         newFont := oldFont.
  2433 	newFont := oldFont.
  2426         newColor := self lineColor:line.
  2434 	newColor := self lineColor:line.
  2427         newColor notNil ifTrue:[ self paint:newColor ].
  2435 	newColor notNil ifTrue:[ self paint:newColor ].
  2428     ] ifFalse:[
  2436     ] ifFalse:[
  2429         self font:newFont. 
  2437 	self font:newFont.
  2430     ].
  2438     ].
  2431     (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[
  2439     (newFont heightOn:device) > (textView font heightOn:device) ifTrue:[
  2432         newFont := textView font.
  2440 	newFont := textView font.
  2433         self font:newFont
  2441 	self font:newFont
  2434     ].
  2442     ].
  2435 
  2443 
  2436     y0 := (textView yOfLine:line) 
  2444     y0 := (textView yOfLine:line)
  2437           + (textView font ascentOn:device)
  2445 	  + (textView font ascentOn:device)
  2438           "/ - (newFont descentOn:device)
  2446 	  "/ - (newFont descentOn:device)
  2439           + 1.
  2447 	  + 1.
  2440 
  2448 
  2441     cleared ifFalse:[
  2449     cleared ifFalse:[
  2442         self clearRectangleX:0 y:y0 - font height width: self width - 2 height: font height + font descent.
  2450 	self clearRectangleX:0 y:y0 - font height width: self width - 2 height: font height + font descent.
  2443     ].
  2451     ].
  2444 
  2452 
  2445     "Let the services to draw annotations and other stuff"
  2453     "Let the services to draw annotations and other stuff"
  2446     codeView
  2454     codeView
  2447         drawLine:line in: self 
  2455 	drawLine:line in: self
  2448         atX: self paddingLeft + self usedWidthForAcceptCancel y:y0 width: widthAnnotations height: font height
  2456 	atX: self paddingLeft + self usedWidthForAcceptCancel y:y0 width: widthAnnotations height: font height
  2449         from:nil to:nil with:self paint and: self backgroundColor.
  2457 	from:nil to:nil with:self paint and: self backgroundColor.
  2450     self 
  2458     self
  2451         displayString:lineString
  2459 	displayString:lineString
  2452         x:(self width - textW - self paddingRight - widthDiffInfo)
  2460 	x:(self width - textW - self paddingRight - widthDiffInfo)
  2453         y:y0.
  2461 	y:y0.
  2454     newFont notNil ifTrue:[
  2462     newFont notNil ifTrue:[
  2455         self font:oldFont.
  2463 	self font:oldFont.
  2456         self paint:oldColor
  2464 	self paint:oldColor
  2457     ] ifFalse:[ 
  2465     ] ifFalse:[
  2458         newColor notNil ifTrue:[ 
  2466 	newColor notNil ifTrue:[
  2459             self paint:oldColor 
  2467 	    self paint:oldColor
  2460         ]. 
  2468 	].
  2461     ].
  2469     ].
  2462 
  2470 
  2463     ^ requiredW.
  2471     ^ requiredW.
  2464 
  2472 
  2465     "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
  2473     "Modified: / 14-12-2009 / 15:30:44 / Jindra <a>"
  2468 !
  2476 !
  2469 
  2477 
  2470 redrawLinesFrom:start
  2478 redrawLinesFrom:start
  2471 
  2479 
  2472     start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
  2480     start to: (textView lastLineShown - 1 min: textView list size) do:[:line|
  2473         self redrawLine:line cleared: false.
  2481 	self redrawLine:line cleared: false.
  2474     ]
  2482     ]
  2475 
  2483 
  2476     "Created: / 06-07-2011 / 17:25:36 / jv"
  2484     "Created: / 06-07-2011 / 17:25:36 / jv"
  2477     "Modified: / 12-07-2011 / 17:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2485     "Modified: / 12-07-2011 / 17:14:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2478 !
  2486 !
  2479 
  2487 
  2480 redrawX:x y:y width:w height:h 
  2488 redrawX:x y:y width:w height:h
  2481     | requiredW currentW |
  2489     | requiredW currentW |
  2482 
  2490 
  2483     self redrawBackgroundX:x y:y width:w height:h.
  2491     self redrawBackgroundX:x y:y width:w height:h.
  2484 
  2492 
  2485     codeView showAcceptCancelBar ifTrue:[    
  2493     codeView showAcceptCancelBar ifTrue:[
  2486         self redrawAcceptCancelBarX:x y:y width:w height:h.
  2494 	self redrawAcceptCancelBarX:x y:y width:w height:h.
  2487     ].
  2495     ].
  2488 
  2496 
  2489     firstLineShown := textView firstLineShown.
  2497     firstLineShown := textView firstLineShown.
  2490     lastLineShown := textView lastLineShown - 1 min: textView list size.
  2498     lastLineShown := textView lastLineShown - 1 min: textView list size.
  2491 
  2499 
  2492     currentW := requiredW := self width.
  2500     currentW := requiredW := self width.
  2493     firstLineShown to:lastLineShown do:
  2501     firstLineShown to:lastLineShown do:
  2494         [:line | 
  2502 	[:line |
  2495         requiredW := requiredW max: (self redrawLine:line cleared: true)].
  2503 	requiredW := requiredW max: (self redrawLine:line cleared: true)].
  2496 
  2504 
  2497     (requiredW > self width) ifTrue:[
  2505     (requiredW > self width) ifTrue:[
  2498         self corner:(requiredW @ 1.0).
  2506 	self corner:(requiredW @ 1.0).
  2499         textViewScroller origin:(requiredW @ 0.0) corner:(1.0 @ 1.0).
  2507 	textViewScroller origin:(requiredW @ 0.0) corner:(1.0 @ 1.0).
  2500         self invalidate.
  2508 	self invalidate.
  2501     ].
  2509     ].
  2502 
  2510 
  2503     "Created: / 03-09-2009 / 08:22:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2511     "Created: / 03-09-2009 / 08:22:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2504     "Modified: / 14-12-2009 / 14:13:14 / Jindra <a>"
  2512     "Modified: / 14-12-2009 / 14:13:14 / Jindra <a>"
  2505     "Modified: / 10-10-2011 / 16:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2513     "Modified: / 10-10-2011 / 16:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2520 
  2528 
  2521     "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
  2529     "Created: / 26-04-2010 / 20:30:32 / Jakub <zelenja7@fel.cvut.cz>"
  2522     "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
  2530     "Modified: / 26-04-2010 / 21:48:13 / Jakub <zelenja7@fel.cvut.cz>"
  2523 !
  2531 !
  2524 
  2532 
  2525 changedLines:something 
  2533 changedLines:something
  2526     changedLines := something.
  2534     changedLines := something.
  2527 
  2535 
  2528     "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
  2536     "Created: / 26-04-2010 / 20:30:19 / Jakub <zelenja7@fel.cvut.cz>"
  2529     "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
  2537     "Modified: / 02-05-2010 / 19:13:32 / Jakub <zelenja7@fel.cvut.cz>"
  2530 !
  2538 !
  2552     ^  deletedLines
  2560     ^  deletedLines
  2553 
  2561 
  2554     "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
  2562     "Modified: / 26-04-2010 / 21:48:23 / Jakub <zelenja7@fel.cvut.cz>"
  2555 !
  2563 !
  2556 
  2564 
  2557 deletedLines:something 
  2565 deletedLines:something
  2558     deletedLines := something.
  2566     deletedLines := something.
  2559 
  2567 
  2560     "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
  2568     "Modified: / 26-04-2010 / 21:48:54 / Jakub <zelenja7@fel.cvut.cz>"
  2561     "Modified (format): / 17-07-2012 / 18:56:44 / cg"
  2569     "Modified (format): / 17-07-2012 / 18:56:44 / cg"
  2562 !
  2570 !
  2587     ^  insertedLines
  2595     ^  insertedLines
  2588 
  2596 
  2589     "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
  2597     "Modified: / 26-04-2010 / 21:48:27 / Jakub <zelenja7@fel.cvut.cz>"
  2590 !
  2598 !
  2591 
  2599 
  2592 insertedLines:something 
  2600 insertedLines:something
  2593     insertedLines := something.
  2601     insertedLines := something.
  2594 
  2602 
  2595     "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
  2603     "Modified: / 26-04-2010 / 21:48:59 / Jakub <zelenja7@fel.cvut.cz>"
  2596     "Modified (format): / 17-07-2012 / 18:56:50 / cg"
  2604     "Modified (format): / 17-07-2012 / 18:56:50 / cg"
  2597 !
  2605 !
  2711 
  2719 
  2712     |prev|
  2720     |prev|
  2713 
  2721 
  2714     prev := reallyModifiedChannel.
  2722     prev := reallyModifiedChannel.
  2715     prev notNil ifTrue:[
  2723     prev notNil ifTrue:[
  2716         gutterView notNil ifTrue:[
  2724 	gutterView notNil ifTrue:[
  2717             reallyModifiedChannel removeDependent: gutterView.
  2725 	    reallyModifiedChannel removeDependent: gutterView.
  2718         ]
  2726 	]
  2719     ].
  2727     ].
  2720     reallyModifiedChannel := aValueModel.
  2728     reallyModifiedChannel := aValueModel.
  2721     self setupChannel:aValueModel for:nil withOld:prev.
  2729     self setupChannel:aValueModel for:nil withOld:prev.
  2722     gutterView notNil ifTrue:[
  2730     gutterView notNil ifTrue:[
  2723         reallyModifiedChannel addDependent: gutterView.
  2731 	reallyModifiedChannel addDependent: gutterView.
  2724     ]
  2732     ]
  2725 
  2733 
  2726     "Created: / 07-10-2011 / 18:50:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2734     "Created: / 07-10-2011 / 18:50:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2727 ! !
  2735 ! !
  2728 
  2736 
  2729 !CodeView2::TextView methodsFor:'delegation-events'!
  2737 !CodeView2::TextView methodsFor:'delegation-events'!
  2730 
  2738 
  2731 isQuickMenuModifierPressed
  2739 isQuickMenuModifierPressed
  2732     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2740     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2733         ^ self sensor ctrlDown
  2741 	^ self sensor ctrlDown
  2734     ].
  2742     ].
  2735     ^ self sensor metaDown
  2743     ^ self sensor metaDown
  2736 !
  2744 !
  2737 
  2745 
  2738 isQuickMenuModifierReleased
  2746 isQuickMenuModifierReleased
  2739     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2747     UserPreferences current codeView2QuickSendersAndImplementorsOnControl ifTrue:[
  2740         ^ self sensor ctrlDown not
  2748 	^ self sensor ctrlDown not
  2741     ].
  2749     ].
  2742     ^ self sensor metaDown not
  2750     ^ self sensor metaDown not
  2743 ! !
  2751 ! !
  2744 
  2752 
  2745 !CodeView2::TextView methodsFor:'drawing'!
  2753 !CodeView2::TextView methodsFor:'drawing'!
  2746 
  2754 
  2747 backgroundForVisibleLine:visLineNr default:bg 
  2755 backgroundForVisibleLine:visLineNr default:bg
  2748     | lineNr |
  2756     | lineNr |
  2749 
  2757 
  2750 
  2758 
  2751     diffMode ifTrue:[
  2759     diffMode ifTrue:[
  2752         lineNr := self visibleLineToListLine:visLineNr.
  2760 	lineNr := self visibleLineToListLine:visLineNr.
  2753         (insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
  2761 	(insertedLines notEmptyOrNil and:[insertedLines includes:lineNr]) ifTrue:[
  2754             ^self colorInserted
  2762 	    ^self colorInserted
  2755         ].
  2763 	].
  2756         (changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
  2764 	(changedLines notEmptyOrNil and:[changedLines includes:lineNr]) ifTrue:[
  2757             ^self colorChanged
  2765 	    ^self colorChanged
  2758         ].
  2766 	].
  2759         (deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
  2767 	(deletedLines notEmptyOrNil and:[deletedLines includes:lineNr]) ifTrue:[
  2760             ^self colorDeleted
  2768 	    ^self colorDeleted
  2761         ].
  2769 	].
  2762     ].
  2770     ].
  2763     ^ bg
  2771     ^ bg
  2764 
  2772 
  2765     "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2773     "Modified: / 17-03-2012 / 12:22:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2766 !
  2774 !
  2767 
  2775 
  2768 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
  2776 drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg
  2769     "draw a visible line range in fg/bg"
  2777     "draw a visible line range in fg/bg"
  2770 
  2778 
  2771     diffMode ifFalse:[
  2779     diffMode ifFalse:[
  2772         super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg.
  2780 	super drawFromVisibleLine:startVisLineNr to:endVisLineNr with:fg and:bg.
  2773         ^self.
  2781 	^self.
  2774     ].
  2782     ].
  2775 
  2783 
  2776     startVisLineNr to: endVisLineNr do:[:visLineNr|
  2784     startVisLineNr to: endVisLineNr do:[:visLineNr|
  2777         self drawVisibleLine: visLineNr with:fg and:bg
  2785 	self drawVisibleLine: visLineNr with:fg and:bg
  2778     ]
  2786     ]
  2779 
  2787 
  2780     "Modified: / 15-12-1999 / 23:19:39 / cg"
  2788     "Modified: / 15-12-1999 / 23:19:39 / cg"
  2781     "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2789     "Created: / 17-03-2012 / 09:44:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2782 !
  2790 !
  2783 
  2791 
  2784 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg 
  2792 drawLine:line fromX:x inVisible:visLineNr with:fg and:bg
  2785     super 
  2793     super
  2786         drawLine:line
  2794 	drawLine:line
  2787         fromX:x
  2795 	fromX:x
  2788         inVisible:visLineNr
  2796 	inVisible:visLineNr
  2789         with:fg
  2797 	with:fg
  2790         and:(self backgroundForVisibleLine:visLineNr default:bg).
  2798 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2791 
  2799 
  2792     "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
  2800     "Created: / 05-04-2010 / 12:07:07 / Jakub <zelenja7@fel.cvut.cz>"
  2793     "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
  2801     "Modified: / 02-05-2010 / 18:46:00 / Jakub <zelenja7@fel.cvut.cz>"
  2794     "Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2802     "Modified: / 17-03-2012 / 10:05:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2795 !
  2803 !
  2796 
  2804 
  2797 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
  2805 drawLine:lineStringArg inVisible:visLineNr col:col with:fg and:bg
  2798     super 
  2806     super
  2799         drawLine:lineStringArg
  2807 	drawLine:lineStringArg
  2800         inVisible:visLineNr
  2808 	inVisible:visLineNr
  2801         col:col
  2809 	col:col
  2802         with:fg
  2810 	with:fg
  2803         and:(self backgroundForVisibleLine:visLineNr default:bg).
  2811 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2804 
  2812 
  2805     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2813     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2806     "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
  2814     "Modified: / 02-05-2010 / 18:45:56 / Jakub <zelenja7@fel.cvut.cz>"
  2807     "Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2815     "Modified: / 17-03-2012 / 10:04:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2808 !
  2816 !
  2809 
  2817 
  2810 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg 
  2818 drawLine:lineStringArg inVisible:visLineNr from:startCol to:endColOrNil with:fg and:bg
  2811     super 
  2819     super
  2812         drawLine:lineStringArg
  2820 	drawLine:lineStringArg
  2813         inVisible:visLineNr
  2821 	inVisible:visLineNr
  2814         from:startCol
  2822 	from:startCol
  2815         to:endColOrNil
  2823 	to:endColOrNil
  2816         with:fg
  2824 	with:fg
  2817         and:(self backgroundForVisibleLine:visLineNr default:bg).
  2825 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2818 
  2826 
  2819     "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
  2827     "Created: / 05-04-2010 / 11:54:54 / Jakub <zelenja7@fel.cvut.cz>"
  2820     "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
  2828     "Modified: / 02-05-2010 / 18:45:52 / Jakub <zelenja7@fel.cvut.cz>"
  2821     "Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2829     "Modified: / 17-03-2012 / 10:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2822 !
  2830 !
  2823 
  2831 
  2824 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg 
  2832 drawLine:lineString inVisible:visLineNr from:startCol with:fg and:bg
  2825     super 
  2833     super
  2826         drawLine:lineString
  2834 	drawLine:lineString
  2827         inVisible:visLineNr
  2835 	inVisible:visLineNr
  2828         from:startCol
  2836 	from:startCol
  2829         with:fg
  2837 	with:fg
  2830         and:(self backgroundForVisibleLine:visLineNr default:bg).
  2838 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2831 
  2839 
  2832     "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
  2840     "Created: / 05-04-2010 / 11:54:26 / Jakub <zelenja7@fel.cvut.cz>"
  2833     "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
  2841     "Modified: / 02-05-2010 / 18:45:48 / Jakub <zelenja7@fel.cvut.cz>"
  2834     "Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2842     "Modified: / 17-03-2012 / 10:04:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2835 !
  2843 !
  2836 
  2844 
  2837 drawVisibleLine:visLineNr with:fg and:bg 
  2845 drawVisibleLine:visLineNr with:fg and:bg
  2838     super 
  2846     super
  2839         drawVisibleLine:visLineNr
  2847 	drawVisibleLine:visLineNr
  2840         with:fg
  2848 	with:fg
  2841         and:(self backgroundForVisibleLine:visLineNr default:bg).
  2849 	and:(self backgroundForVisibleLine:visLineNr default:bg).
  2842 
  2850 
  2843     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2851     "Created: / 05-04-2010 / 11:49:42 / Jakub <zelenja7@fel.cvut.cz>"
  2844     "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
  2852     "Modified: / 02-05-2010 / 18:45:44 / Jakub <zelenja7@fel.cvut.cz>"
  2845     "Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2853     "Modified: / 17-03-2012 / 10:04:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2846 !
  2854 !
       
  2855 
       
  2856 
  2847 
  2857 
  2848 redrawLines
  2858 redrawLines
  2849     |i pom|
  2859     |i pom|
  2850 
  2860 
  2851     diffMode ifFalse:[^self].
  2861     diffMode ifFalse:[^self].
  2854 
  2864 
  2855     pom := self hasSelection.
  2865     pom := self hasSelection.
  2856     (pom) ifTrue:[ ^ self. ].
  2866     (pom) ifTrue:[ ^ self. ].
  2857     i := 1.
  2867     i := 1.
  2858     [
  2868     [
  2859         i <= (deletedLines size)
  2869 	i <= (deletedLines size)
  2860     ] whileTrue:[
  2870     ] whileTrue:[
  2861         ((deletedLines at:i) > 0) ifTrue:[
  2871 	((deletedLines at:i) > 0) ifTrue:[
  2862             super 
  2872 	    super
  2863                 drawVisibleLine:(deletedLines at:i)
  2873 		drawVisibleLine:(deletedLines at:i)
  2864                 with:fgColor
  2874 		with:fgColor
  2865                 and:self colorDeleted.
  2875 		and:self colorDeleted.
  2866         ].
  2876 	].
  2867         i := i + 1.
  2877 	i := i + 1.
  2868     ].
  2878     ].
  2869     i := 1.
  2879     i := 1.
  2870     [
  2880     [
  2871         i <= (insertedLines size)
  2881 	i <= (insertedLines size)
  2872     ] whileTrue:[
  2882     ] whileTrue:[
  2873         ((insertedLines at:i) > 0) ifTrue:[
  2883 	((insertedLines at:i) > 0) ifTrue:[
  2874             super 
  2884 	    super
  2875                 drawVisibleLine:(insertedLines at:i)
  2885 		drawVisibleLine:(insertedLines at:i)
  2876                 with:fgColor
  2886 		with:fgColor
  2877                 and:self colorInserted.
  2887 		and:self colorInserted.
  2878         ].
  2888 	].
  2879         i := i + 1.
  2889 	i := i + 1.
  2880     ].
  2890     ].
  2881     i := 1.
  2891     i := 1.
  2882     [
  2892     [
  2883         i <= (changedLines size)
  2893 	i <= (changedLines size)
  2884     ] whileTrue:[
  2894     ] whileTrue:[
  2885         ((changedLines at:i) > 0) ifTrue:[
  2895 	((changedLines at:i) > 0) ifTrue:[
  2886             super 
  2896 	    super
  2887                 drawVisibleLine:(changedLines at:i)
  2897 		drawVisibleLine:(changedLines at:i)
  2888                 with:fgColor
  2898 		with:fgColor
  2889                 and:self colorChanged.
  2899 		and:self colorChanged.
  2890         ].
  2900 	].
  2891         i := i + 1.
  2901 	i := i + 1.
  2892     ].
  2902     ].
  2893 
  2903 
  2894     "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
  2904     "Created: / 26-04-2010 / 21:04:31 / Jakub <zelenja7@fel.cvut.cz>"
  2895     "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
  2905     "Modified: / 22-06-2010 / 23:28:30 / Jakub <zelenja7@fel.cvut.cz>"
  2896     "Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2906     "Modified: / 17-03-2012 / 09:27:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2900 
  2910 
  2901 contentsChanged
  2911 contentsChanged
  2902     super contentsChanged.
  2912     super contentsChanged.
  2903     "
  2913     "
  2904     codeView diffMode ifTrue:[
  2914     codeView diffMode ifTrue:[
  2905         changedDiffText ifTrue:[
  2915 	changedDiffText ifTrue:[
  2906             codeView recomputeDiff:self.
  2916 	    codeView recomputeDiff:self.
  2907         ] ifFalse:[
  2917 	] ifFalse:[
  2908             changedDiffText := true.
  2918 	    changedDiffText := true.
  2909         ].  
  2919 	].
  2910     ]
  2920     ]
  2911     "
  2921     "
  2912 
  2922 
  2913     "Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>"
  2923     "Created: / 22-06-2010 / 23:13:24 / Jakub <zelenja7@fel.cvut.cz>"
  2914     "Modified: / 01-08-2010 / 20:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2924     "Modified: / 01-08-2010 / 20:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  2924     |soCol wasOn lineNrAboveCursor ln originalLine prevTab|
  2934     |soCol wasOn lineNrAboveCursor ln originalLine prevTab|
  2925 
  2935 
  2926     wasOn := self hideCursor.
  2936     wasOn := self hideCursor.
  2927 
  2937 
  2928     "JV@2012-01-06: Do not play with autoindent iff cursor is at the very beginning of the line"
  2938     "JV@2012-01-06: Do not play with autoindent iff cursor is at the very beginning of the line"
  2929     (autoIndent 
  2939     (autoIndent
  2930     and:[cursorCol ~~ 1
  2940     and:[cursorCol ~~ 1
  2931     and:[ (tabPositions includes:cursorCol) 
  2941     and:[ (tabPositions includes:cursorCol)
  2932     ]]) ifTrue:[
  2942     ]]) ifTrue:[
  2933         prevTab := (self prevTabBefore:cursorCol) max:1.
  2943 	prevTab := (self prevTabBefore:cursorCol) max:1.
  2934         "JV@2011-12-10: The list can be shorter than cursorLine,
  2944 	"JV@2011-12-10: The list can be shorter than cursorLine,
  2935          trailing because empty lines are not physically in the list."
  2945 	 trailing because empty lines are not physically in the list."
  2936         (list size >= cursorLine) ifTrue:[
  2946 	(list size >= cursorLine) ifTrue:[
  2937             ln := originalLine := (list at:cursorLine) ? ''.
  2947 	    ln := originalLine := (list at:cursorLine) ? ''.
  2938         ] ifFalse:[        
  2948 	] ifFalse:[
  2939             ln := originalLine := ''.
  2949 	    ln := originalLine := ''.
  2940         ].    
  2950 	].
  2941         ln size < prevTab ifTrue:[
  2951 	ln size < prevTab ifTrue:[
  2942             ln := ln , (String new:prevTab withAll:Character space).
  2952 	    ln := ln , (String new:prevTab withAll:Character space).
  2943         ].
  2953 	].
  2944         (ln copyTo:prevTab) isBlank ifTrue:[
  2954 	(ln copyTo:prevTab) isBlank ifTrue:[
  2945             (ln copyFrom:prevTab+1) isBlank ifTrue:[
  2955 	    (ln copyFrom:prevTab+1) isBlank ifTrue:[
  2946                 cursorCol > prevTab ifTrue:[
  2956 		cursorCol > prevTab ifTrue:[
  2947                     self st80EditMode ifTrue:[
  2957 		    self st80EditMode ifTrue:[
  2948                         "/ ensure that there is no conflict here: st80EditMode will
  2958 			"/ ensure that there is no conflict here: st80EditMode will
  2949                         "/ not allow a cursor position beyond the end of line,
  2959 			"/ not allow a cursor position beyond the end of line,
  2950                         "/ so avoid that cursorLine:col: will force us to the beginning of the line
  2960 			"/ so avoid that cursorLine:col: will force us to the beginning of the line
  2951                         originalLine size < prevTab ifTrue:[
  2961 			originalLine size < prevTab ifTrue:[
  2952                             self at:cursorLine put:ln
  2962 			    self at:cursorLine put:ln
  2953                         ]
  2963 			]
  2954                     ].
  2964 		    ].
  2955                     self cursorLine:cursorLine col:prevTab.
  2965 		    self cursorLine:cursorLine col:prevTab.
  2956                     wasOn ifTrue:[ self showCursor ].
  2966 		    wasOn ifTrue:[ self showCursor ].
  2957                     ^  self
  2967 		    ^  self
  2958                 ].
  2968 		].
  2959             ] ifFalse:[
  2969 	    ] ifFalse:[
  2960                 "/ (ln copyFrom:prevTab+1 to:cursorCol-1) isBlank ifTrue:[
  2970 		"/ (ln copyFrom:prevTab+1 to:cursorCol-1) isBlank ifTrue:[
  2961                     self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
  2971 		    self deleteFromLine:cursorLine col:prevTab toLine:cursorLine col:cursorCol-1.
  2962                     self cursorLine:cursorLine col:prevTab.
  2972 		    self cursorLine:cursorLine col:prevTab.
  2963                     wasOn ifTrue:[ self showCursor ].
  2973 		    wasOn ifTrue:[ self showCursor ].
  2964                     ^  self.
  2974 		    ^  self.
  2965                 "/ ]
  2975 		"/ ]
  2966             ]
  2976 	    ]
  2967         ].
  2977 	].
  2968     ].
  2978     ].
  2969 
  2979 
  2970 "/        (autoIndent
  2980 "/        (autoIndent
  2971 "/    and:[cursorCol  ~~ 1
  2981 "/    and:[cursorCol  ~~ 1
  2972 "/    and:[cursorLine <= (list size)]])
  2982 "/    and:[cursorLine <= (list size)]])
  2978 "/            (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[
  2988 "/            (ln notNil and:[(ln indexOfNonSeparatorStartingAt:1) < soCol]) ifTrue:[
  2979 "/                soCol := 1
  2989 "/                soCol := 1
  2980 "/            ]
  2990 "/            ]
  2981 "/        ]
  2991 "/        ]
  2982 "/    ] ifFalse:[
  2992 "/    ] ifFalse:[
  2983         soCol := 1.
  2993 	soCol := 1.
  2984 "/    ].
  2994 "/    ].
  2985 
  2995 
  2986     (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
  2996     (cursorCol ~~ soCol and:[cursorCol ~~ 1]) ifTrue:[
  2987         "
  2997 	"
  2988          somewhere in the middle of a line
  2998 	 somewhere in the middle of a line
  2989         "
  2999 	"
  2990         self cursorLeft.
  3000 	self cursorLeft.
  2991         self deleteCharAtLine:cursorLine col:cursorCol.
  3001 	self deleteCharAtLine:cursorLine col:cursorCol.
  2992     ] ifFalse:[
  3002     ] ifFalse:[
  2993         "
  3003 	"
  2994          at begin of line - merge with previous line;
  3004 	 at begin of line - merge with previous line;
  2995          except for the very first line.
  3005 	 except for the very first line.
  2996         "
  3006 	"
  2997         (cursorLine == 1) ifFalse:[
  3007 	(cursorLine == 1) ifFalse:[
  2998             lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
  3008 	    lineNrAboveCursor := self validateCursorLine:(cursorLine - 1).
  2999             lineNrAboveCursor < cursorLine ifTrue:[
  3009 	    lineNrAboveCursor < cursorLine ifTrue:[
  3000                 (lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
  3010 		(lineNrAboveCursor > 0 and:[lineNrAboveCursor > list size]) ifTrue:[
  3001                     "/ we are beyond the end of the text.
  3011 		    "/ we are beyond the end of the text.
  3002                     "/ move the cursor to the previous line.
  3012 		    "/ move the cursor to the previous line.
  3003                     self cursorLine:lineNrAboveCursor col:1.
  3013 		    self cursorLine:lineNrAboveCursor col:1.
  3004                 ] ifFalse:[
  3014 		] ifFalse:[
  3005                     self mergeLine:lineNrAboveCursor removeBlanks:false.
  3015 		    self mergeLine:lineNrAboveCursor removeBlanks:false.
  3006                 ]
  3016 		]
  3007             ]
  3017 	    ]
  3008         ]
  3018 	]
  3009     ].
  3019     ].
  3010     wasOn ifTrue:[ self showCursor ]
  3020     wasOn ifTrue:[ self showCursor ]
  3011 
  3021 
  3012     "Modified: / 16-01-1998 / 22:33:04 / cg"
  3022     "Modified: / 16-01-1998 / 22:33:04 / cg"
  3013     "Modified: / 06-01-2012 / 12:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3023     "Modified: / 06-01-2012 / 12:42:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3020     pole := list.
  3030     pole := list.
  3021     size := list size.
  3031     size := list size.
  3022     text:=''.
  3032     text:=''.
  3023     emptyLines isNil ifTrue:[emptyLines := #()].
  3033     emptyLines isNil ifTrue:[emptyLines := #()].
  3024     [ i <= size ] whileTrue:[
  3034     [ i <= size ] whileTrue:[
  3025         pom := emptyLines indexOf:i.
  3035 	pom := emptyLines indexOf:i.
  3026         (pom = 0) ifFalse:[
  3036 	(pom = 0) ifFalse:[
  3027             helperText := pole at:i.
  3037 	    helperText := pole at:i.
  3028             (helperText = '') ifFalse:[
  3038 	    (helperText = '') ifFalse:[
  3029                 (helperText isNil)ifTrue:[helperText:=''].
  3039 		(helperText isNil)ifTrue:[helperText:=''].
  3030                 helperText:=helperText,Character cr.
  3040 		helperText:=helperText,Character cr.
  3031                 text := text asString , helperText asString.
  3041 		text := text asString , helperText asString.
  3032             ].
  3042 	    ].
  3033         ] ifTrue:[
  3043 	] ifTrue:[
  3034             helperText := pole at:i.
  3044 	    helperText := pole at:i.
  3035             (helperText isNil)ifTrue:[helperText:=''].
  3045 	    (helperText isNil)ifTrue:[helperText:=''].
  3036             helperText:=helperText,Character cr.
  3046 	    helperText:=helperText,Character cr.
  3037             text := text asString , helperText asString.
  3047 	    text := text asString , helperText asString.
  3038         ].
  3048 	].
  3039     i:=i+1.
  3049     i:=i+1.
  3040     ].
  3050     ].
  3041 ^text
  3051 ^text
  3042 
  3052 
  3043     "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
  3053     "Created: / 22-06-2010 / 22:33:27 / Jakub <zelenja7@fel.cvut.cz>"
  3054     self notifyLinesModifiedFrom: lineNr to: lineNr.
  3064     self notifyLinesModifiedFrom: lineNr to: lineNr.
  3055 
  3065 
  3056     "Created: / 16-09-2011 / 15:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3066     "Created: / 16-09-2011 / 15:13:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3057 !
  3067 !
  3058 
  3068 
  3059 basicDeleteFromLine:startLineNr toLine:endLineNr 
  3069 basicDeleteFromLine:startLineNr toLine:endLineNr
  3060 
  3070 
  3061     super basicDeleteFromLine:startLineNr toLine:endLineNr.
  3071     super basicDeleteFromLine:startLineNr toLine:endLineNr.
  3062     self notifyLinesDeletedFrom:startLineNr to:endLineNr.
  3072     self notifyLinesDeletedFrom:startLineNr to:endLineNr.
  3063 
  3073 
  3064     "Created: / 28-06-2011 / 09:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3074     "Created: / 28-06-2011 / 09:09:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3105     | wasAutoIndent |
  3115     | wasAutoIndent |
  3106 
  3116 
  3107     wasAutoIndent := autoIndent.
  3117     wasAutoIndent := autoIndent.
  3108     autoIndent := false.
  3118     autoIndent := false.
  3109     [
  3119     [
  3110         super insertLines:someText from:start to:end before:lineNr.
  3120 	super insertLines:someText from:start to:end before:lineNr.
  3111     ] ensure:[
  3121     ] ensure:[
  3112         autoIndent := wasAutoIndent
  3122 	autoIndent := wasAutoIndent
  3113     ]
  3123     ]
  3114 
  3124 
  3115     "Created: / 20-12-2011 / 15:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3125     "Created: / 20-12-2011 / 15:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3116 ! !
  3126 ! !
  3117 
  3127 
  3118 !CodeView2::TextView methodsFor:'event handling'!
  3128 !CodeView2::TextView methodsFor:'event handling'!
  3119 
  3129 
  3120 buttonMotion:button x:x y:y
  3130 buttonMotion:button x:x y:y
  3121 
  3131 
  3122     (codeView buttonMotion:button x:x y:y in: self)
  3132     (codeView buttonMotion:button x:x y:y in: self)
  3123         ifFalse:[super buttonMotion:button x:x y:y].
  3133 	ifFalse:[super buttonMotion:button x:x y:y].
  3124 
  3134 
  3125     "Created: / 14-02-2010 / 16:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3135     "Created: / 14-02-2010 / 16:23:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3126     "Modified: / 06-03-2010 / 20:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3136     "Modified: / 06-03-2010 / 20:10:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3127 !
  3137 !
  3128 
  3138 
  3129 buttonPress: button x: x y: y
  3139 buttonPress: button x: x y: y
  3130     | ctrlDown  |
  3140     | ctrlDown  |
  3131 
  3141 
  3132     (codeView buttonPress:button x:x y:y in: self)
  3142     (codeView buttonPress:button x:x y:y in: self)
  3133         ifFalse:[super buttonPress:button x:x y:y].
  3143 	ifFalse:[super buttonPress:button x:x y:y].
  3134     "
  3144     "
  3135     ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil]) 
  3145     ((ctrlDown := self sensor ctrlDown) and: [ codeView syntaxElementSelection notNil])
  3136         ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
  3146 	ifTrue: [codeView buttonPressInTextView: button x:x y:y ctrlDown: ctrlDown].
  3137     super 
  3147     super
  3138         buttonPress: button
  3148 	buttonPress: button
  3139         x: x
  3149 	x: x
  3140         y: y
  3150 	y: y
  3141     "
  3151     "
  3142 
  3152 
  3143     "Created: / 14-02-2010 / 18:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3153     "Created: / 14-02-2010 / 18:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3144     "Modified: / 06-03-2010 / 20:37:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3154     "Modified: / 06-03-2010 / 20:37:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3145 !
  3155 !
  3146 
  3156 
  3147 exposeX:x y:y width:w height:h 
  3157 buttonRelease: button x: x y: y
  3148     super 
  3158     (codeView buttonRelease:button x:x y:y in: self)
  3149         exposeX:x
  3159 	ifFalse:[super buttonRelease:button x:x y:y].
  3150         y:y
  3160 !
  3151         width:w
  3161 
  3152         height:h.
  3162 exposeX:x y:y width:w height:h
       
  3163     super
       
  3164 	exposeX:x
       
  3165 	y:y
       
  3166 	width:w
       
  3167 	height:h.
  3153     self redrawLines.
  3168     self redrawLines.
  3154 
  3169 
  3155     "Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>"
  3170     "Created: / 05-04-2010 / 10:07:50 / Jakub <zelenja7@fel.cvut.cz>"
  3156     "Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>"
  3171     "Modified: / 02-05-2010 / 18:41:07 / Jakub <zelenja7@fel.cvut.cz>"
  3157 !
  3172 !
  3158 
  3173 
  3159 keyPress:key x:x y:y
  3174 keyPress:key x:x y:y
  3160     (codeView keyPress:key x:x y:y in: self)
  3175     (codeView keyPress:key x:x y:y in: self)
  3161         ifFalse:[super keyPress:key x:x y:y].
  3176 	ifFalse:[super keyPress:key x:x y:y].
  3162 
  3177 
  3163     "Modified: / 06-03-2010 / 20:34:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3178     "Modified: / 06-03-2010 / 20:34:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3164     "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
  3179     "Modified: / 05-04-2010 / 09:55:52 / Jakub <zelenja7@fel.cvut.cz>"
  3165 !
  3180 !
  3166 
  3181 
  3167 keyRelease: key x: x y: y
  3182 keyRelease: key x: x y: y
  3168 
  3183 
  3169     (codeView keyRelease:key x:x y:y in: self)
  3184     (codeView keyRelease:key x:x y:y in: self)
  3170         ifFalse:[super keyRelease:key x:x y:y].
  3185 	ifFalse:[super keyRelease:key x:x y:y].
  3171     "
  3186     "
  3172     (key = #Control_L) ifTrue:
  3187     (key = #Control_L) ifTrue:
  3173         [ codeView highlightClear. self redraw ].
  3188 	[ codeView highlightClear. self redraw ].
  3174 
  3189 
  3175     ^ super 
  3190     ^ super
  3176         keyRelease: key
  3191 	keyRelease: key
  3177         x: x
  3192 	x: x
  3178         y: y
  3193 	y: y
  3179     "
  3194     "
  3180 
  3195 
  3181     "Created: / 14-02-2010 / 16:38:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3196     "Created: / 14-02-2010 / 16:38:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3182     "Modified: / 06-03-2010 / 21:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3197     "Modified: / 06-03-2010 / 21:04:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3183 ! !
  3198 ! !
  3189     | lang |
  3204     | lang |
  3190     lang := codeView language.
  3205     lang := codeView language.
  3191     "Bit hacky here, should ask language some language toolbox
  3206     "Bit hacky here, should ask language some language toolbox
  3192     for formatting helper, that should do it..."
  3207     for formatting helper, that should do it..."
  3193     (lang notNil and:[lang isSmalltalk]) ifTrue:[
  3208     (lang notNil and:[lang isSmalltalk]) ifTrue:[
  3194         | line lineNo indent |
  3209 	| line lineNo indent |
  3195         lineNo := lineNr.    
  3210 	lineNo := lineNr.
  3196         [lineNo ~~ 1] whileTrue:[
  3211 	[lineNo ~~ 1] whileTrue:[
  3197             lineNo  := lineNo - 1.
  3212 	    lineNo  := lineNo - 1.
  3198             line := self listAt:lineNo.
  3213 	    line := self listAt:lineNo.
  3199 
  3214 
  3200             line notNil ifTrue:[
  3215 	    line notNil ifTrue:[
  3201                 indent := line indexOfNonSeparatorStartingAt:1.
  3216 		indent := line indexOfNonSeparatorStartingAt:1.
  3202                 "beggining od block"
  3217 		"beggining od block"
  3203                 line notEmptyOrNil ifTrue:[
  3218 		line notEmptyOrNil ifTrue:[
  3204                     line last == $[ ifTrue:[
  3219 		    line last == $[ ifTrue:[
  3205                         indent := indent + 4.
  3220 			indent := indent + 4.
  3206                     ] ifFalse:[
  3221 		    ] ifFalse:[
  3207                         "end of block args"
  3222 			"end of block args"
  3208                         (line last == $| and: [line includes: $[]) ifTrue:[
  3223 			(line last == $| and: [line includes: $[]) ifTrue:[
  3209                             indent := indent + 4.
  3224 			    indent := indent + 4.
  3210                         ]   
  3225 			]
  3211                     ].        
  3226 		    ].
  3212                 ].
  3227 		].
  3213                 indent ~~ 0 ifTrue:[
  3228 		indent ~~ 0 ifTrue:[
  3214                 ^ indent - 1
  3229 		^ indent - 1
  3215                 ]
  3230 		]
  3216             ]            
  3231 	    ]
  3217         ].
  3232 	].
  3218         ^0.
  3233 	^0.
  3219     ].
  3234     ].
  3220     ^super leftIndentForLine:lineNr
  3235     ^super leftIndentForLine:lineNr
  3221 
  3236 
  3222     "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3237     "Created: / 10-12-2011 / 11:02:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3223 ! !
  3238 ! !
  3406     "/ higher prio to prevent it from being changed while we convert it (by editing)
  3421     "/ higher prio to prevent it from being changed while we convert it (by editing)
  3407 
  3422 
  3408     modified := false.
  3423     modified := false.
  3409 
  3424 
  3410     list size ~~ listOriginal size ifTrue:[
  3425     list size ~~ listOriginal size ifTrue:[
  3411         modified := true.
  3426 	modified := true.
  3412     ] ifFalse:[
  3427     ] ifFalse:[
  3413         "/ cg: don't do that (collecting original/changedSource); 
  3428 	"/ cg: don't do that (collecting original/changedSource);
  3414         "/ for huge files (>8Mb), this makes editing annoying slow (editing a trace output, for example)
  3429 	"/ for huge files (>8Mb), this makes editing annoying slow (editing a trace output, for example)
  3415 "/        changedSource := list ? #().
  3430 "/        changedSource := list ? #().
  3416 "/        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
  3431 "/        changedSource := changedSource collect:[:line | line isEmptyOrNil ifTrue:[nil] ifFalse:[line]].
  3417 "/        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
  3432 "/        [changedSource size > 0 and:[changedSource last isNil]] whileTrue:[
  3418 "/            changedSource := changedSource removeLast.
  3433 "/            changedSource := changedSource removeLast.
  3419 "/        ].
  3434 "/        ].
  3427 "/            modified := true.
  3442 "/            modified := true.
  3428 "/        ] ifFalse:[
  3443 "/        ] ifFalse:[
  3429 "/            | i stopIndex |
  3444 "/            | i stopIndex |
  3430 "/
  3445 "/
  3431 "/            i := 1.
  3446 "/            i := 1.
  3432 "/            stopIndex := originalSource size + 1.            
  3447 "/            stopIndex := originalSource size + 1.
  3433 "/            [ modified not and:[ i < stopIndex ] ] whileTrue:[
  3448 "/            [ modified not and:[ i < stopIndex ] ] whileTrue:[
  3434 "/                | originalL changedL |
  3449 "/                | originalL changedL |
  3435 "/
  3450 "/
  3436 "/                originalL := ((originalSource at: i) ? '') string.
  3451 "/                originalL := ((originalSource at: i) ? '') string.
  3437 "/                changedL :=  ((changedSource  at: i) ? '') string.                
  3452 "/                changedL :=  ((changedSource  at: i) ? '') string.
  3438 "/                originalL ~= changedL ifTrue:[
  3453 "/                originalL ~= changedL ifTrue:[
  3439 "/                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
  3454 "/                    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
  3440 "/                        modified := true.
  3455 "/                        modified := true.
  3441 "/                    ]
  3456 "/                    ]
  3442 "/                ].
  3457 "/                ].
  3443 "/                i := i + 1.
  3458 "/                i := i + 1.
  3444 "/            ]
  3459 "/            ]
  3445 "/        ].
  3460 "/        ].
  3446         "/ instead, do everything without collecting a new stringcollection.
  3461 	"/ instead, do everything without collecting a new stringcollection.
  3447         changedSource := list ? #().
  3462 	changedSource := list ? #().
  3448         lastLineOfChangedSource := changedSource size.
  3463 	lastLineOfChangedSource := changedSource size.
  3449         [lastLineOfChangedSource > 0 and:[(changedSource at:lastLineOfChangedSource) isEmptyOrNil]] whileTrue:[
  3464 	[lastLineOfChangedSource > 0 and:[(changedSource at:lastLineOfChangedSource) isEmptyOrNil]] whileTrue:[
  3450             lastLineOfChangedSource := lastLineOfChangedSource - 1.
  3465 	    lastLineOfChangedSource := lastLineOfChangedSource - 1.
  3451         ].        
  3466 	].
  3452         originalSource := listOriginal ? #().
  3467 	originalSource := listOriginal ? #().
  3453         lastLineOfOriginalSource := originalSource size.
  3468 	lastLineOfOriginalSource := originalSource size.
  3454         [lastLineOfOriginalSource > 0 and:[(originalSource at:lastLineOfOriginalSource) isEmptyOrNil]] whileTrue:[
  3469 	[lastLineOfOriginalSource > 0 and:[(originalSource at:lastLineOfOriginalSource) isEmptyOrNil]] whileTrue:[
  3455             lastLineOfOriginalSource := lastLineOfOriginalSource - 1.
  3470 	    lastLineOfOriginalSource := lastLineOfOriginalSource - 1.
  3456         ].        
  3471 	].
  3457 
  3472 
  3458         lastLineOfOriginalSource ~~ lastLineOfChangedSource ifTrue:[
  3473 	lastLineOfOriginalSource ~~ lastLineOfChangedSource ifTrue:[
  3459             modified := true.
  3474 	    modified := true.
  3460         ] ifFalse:[
  3475 	] ifFalse:[
  3461             | i stopIndex |
  3476 	    | i stopIndex |
  3462 
  3477 
  3463             i := 1.
  3478 	    i := 1.
  3464             stopIndex := lastLineOfOriginalSource + 1.            
  3479 	    stopIndex := lastLineOfOriginalSource + 1.
  3465             [ modified not and:[ i < stopIndex ] ] whileTrue:[
  3480 	    [ modified not and:[ i < stopIndex ] ] whileTrue:[
  3466                 | originalL changedL |
  3481 		| originalL changedL |
  3467 
  3482 
  3468                 originalL := ((originalSource at: i) ? '') string.
  3483 		originalL := ((originalSource at: i) ? '') string.
  3469                 changedL :=  ((changedSource  at: i) ? '') string.                
  3484 		changedL :=  ((changedSource  at: i) ? '') string.
  3470                 originalL ~= changedL ifTrue:[
  3485 		originalL ~= changedL ifTrue:[
  3471                     originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
  3486 		    originalL withoutTrailingSeparators ~= changedL withoutTrailingSeparators ifTrue:[
  3472                         modified := true.
  3487 			modified := true.
  3473                     ]
  3488 		    ]
  3474                 ].
  3489 		].
  3475                 i := i + 1.
  3490 		i := i + 1.
  3476             ]
  3491 	    ]
  3477         ].
  3492 	].
  3478 
  3493 
  3479     ].
  3494     ].
  3480 
  3495 
  3481     reallyModifiedChannel value: modified
  3496     reallyModifiedChannel value: modified
  3482 
  3497 
  3491     ^ true
  3506     ^ true
  3492 ! !
  3507 ! !
  3493 
  3508 
  3494 !CodeView2::TextView methodsFor:'scrolling'!
  3509 !CodeView2::TextView methodsFor:'scrolling'!
  3495 
  3510 
       
  3511 
       
  3512 
  3496 basicScrollTo:anOrigin redraw:doRedraw
  3513 basicScrollTo:anOrigin redraw:doRedraw
  3497     super scrollTo:anOrigin redraw:doRedraw
  3514     super scrollTo:anOrigin redraw:doRedraw
  3498 
  3515 
  3499     "Modified: / 06-04-2010 / 14:05:40 / Jakub <zelenja7@fel.cvut.cz>"
  3516     "Modified: / 06-04-2010 / 14:05:40 / Jakub <zelenja7@fel.cvut.cz>"
  3500     "Modified: / 17-03-2012 / 10:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3517     "Modified: / 17-03-2012 / 10:06:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3501     "Created: / 19-03-2012 / 17:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3518     "Created: / 19-03-2012 / 17:01:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3502 !
  3519 !
  3503 
  3520 
       
  3521 
       
  3522 
  3504 originChanged:delta
  3523 originChanged:delta
  3505 
  3524 
  3506     super originChanged:delta.
  3525     super originChanged:delta.
  3507 
  3526 
  3508     gutterView invalidate.
  3527     gutterView invalidate.
  3509 
  3528 
  3510     "Created: / 07-12-2009 / 21:50:49 / Jindra <a>"
  3529     "Created: / 07-12-2009 / 21:50:49 / Jindra <a>"
  3511 !
  3530 !
       
  3531 
       
  3532 
  3512 
  3533 
  3513 scrollTo:anOrigin redraw:doRedraw
  3534 scrollTo:anOrigin redraw:doRedraw
  3514 
  3535 
  3515     codeView scrollTo:anOrigin redraw:doRedraw in: self.
  3536     codeView scrollTo:anOrigin redraw:doRedraw in: self.
  3516     self basicScrollTo:anOrigin redraw:doRedraw
  3537     self basicScrollTo:anOrigin redraw:doRedraw
  3517 
  3538 
  3518     "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
  3539     "Modified: / 06-04-2010 / 14:04:28 / Jakub <zelenja7@fel.cvut.cz>"
  3519     "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3540     "Modified: / 17-03-2012 / 10:06:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3520     "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3541     "Created: / 19-03-2012 / 17:05:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
  3521 ! !
  3542 !
       
  3543 
       
  3544  !
  3522 
  3545 
  3523 !CodeView2::TextView methodsFor:'undo & again'!
  3546 !CodeView2::TextView methodsFor:'undo & again'!
  3524 
  3547 
  3525 nonUndoableDo: aBlock
  3548 nonUndoableDo: aBlock
  3526 
  3549 
  3539 ! !
  3562 ! !
  3540 
  3563 
  3541 !CodeView2 class methodsFor:'documentation'!
  3564 !CodeView2 class methodsFor:'documentation'!
  3542 
  3565 
  3543 version
  3566 version
  3544     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.74 2013-05-29 17:26:31 cg Exp $'
  3567     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.77 2013-06-06 19:39:41 cg Exp $'
  3545 !
  3568 !
  3546 
  3569 
  3547 version_CVS
  3570 version_CVS
  3548     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.74 2013-05-29 17:26:31 cg Exp $'
  3571     ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.77 2013-06-06 19:39:41 cg Exp $'
  3549 !
  3572 !
  3550 
  3573 
  3551 version_HG
  3574 version_HG
  3552 
  3575 
  3553     ^ '$Changeset: <not expanded> $'
  3576     ^ '$Changeset: <not expanded> $'
  3554 !
  3577 !
  3555 
  3578 
  3556 version_SVN
  3579 version_SVN
  3557     ^ '$Id: Tools__CodeView2.st,v 1.74 2013-05-29 17:26:31 cg Exp $'
  3580     ^ '$Id: Tools__CodeView2.st,v 1.77 2013-06-06 19:39:41 cg Exp $'
  3558 ! !
  3581 ! !
  3559 
  3582 
  3560 
  3583 
  3561 CodeView2 initialize!
  3584 CodeView2 initialize!