Tools__NewSystemBrowserCodeView.st
branchjv
changeset 12401 4714b9640528
parent 12292 ecc23f7c8dde
parent 12104 ef5283010b5f
child 12406 1fbd331e4489
equal deleted inserted replaced
12330:235b77901045 12401:4714b9640528
    34  be provided or otherwise made available to, or used by, any
    34  be provided or otherwise made available to, or used by, any
    35  other person.  No title to or ownership of the software is
    35  other person.  No title to or ownership of the software is
    36  hereby transferred.
    36  hereby transferred.
    37 "
    37 "
    38 ! !
    38 ! !
       
    39 
    39 
    40 
    40 !NewSystemBrowserCodeView class methodsFor:'initialization'!
    41 !NewSystemBrowserCodeView class methodsFor:'initialization'!
    41 
    42 
    42 initialize
    43 initialize
    43     "
    44     "
    55     "Created: / 25-12-2007 / 19:58:53 / janfrog"
    56     "Created: / 25-12-2007 / 19:58:53 / janfrog"
    56     "Modified: / 27-02-2008 / 12:16:10 / janfrog"
    57     "Modified: / 27-02-2008 / 12:16:10 / janfrog"
    57     "Modified: / 15-04-2010 / 16:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    58     "Modified: / 15-04-2010 / 16:40:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    58     "Modified (comment): / 01-07-2011 / 16:21:38 / cg"
    59     "Modified (comment): / 01-07-2011 / 16:21:38 / cg"
    59 ! !
    60 ! !
       
    61 
    60 
    62 
    61 !NewSystemBrowserCodeView class methodsFor:'menu specs'!
    63 !NewSystemBrowserCodeView class methodsFor:'menu specs'!
    62 
    64 
    63 editMenuSpec
    65 editMenuSpec
    64     "This resource specification was automatically generated
    66     "This resource specification was automatically generated
   189         nil
   191         nil
   190       )
   192       )
   191 
   193 
   192     "Modified: / 18-10-2008 / 18:50:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
   194     "Modified: / 18-10-2008 / 18:50:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
   193 ! !
   195 ! !
       
   196 
   194 
   197 
   195 !NewSystemBrowserCodeView methodsFor:'accessing'!
   198 !NewSystemBrowserCodeView methodsFor:'accessing'!
   196 
   199 
   197 browser
   200 browser
   198     ^ browser ? menuHolder
   201     ^ browser ? menuHolder
   287     "Created: / 26-12-2007 / 11:12:26 / janfrog"
   290     "Created: / 26-12-2007 / 11:12:26 / janfrog"
   288     "Modified: / 19-02-2008 / 09:16:11 / janfrog"
   291     "Modified: / 19-02-2008 / 09:16:11 / janfrog"
   289     "Modified: / 04-08-2011 / 19:05:43 / cg"
   292     "Modified: / 04-08-2011 / 19:05:43 / cg"
   290 ! !
   293 ! !
   291 
   294 
       
   295 
   292 !NewSystemBrowserCodeView methodsFor:'accessing-contents'!
   296 !NewSystemBrowserCodeView methodsFor:'accessing-contents'!
   293 
   297 
   294 list: anObject
   298 list: anObject
   295 
   299 
   296     super list: anObject.
   300     super list: anObject.
   297     self updateParseTree.
   301     self updateParseTree.
   298 
   302 
   299     "Created: / 25-12-2007 / 10:05:17 / janfrog"
   303     "Created: / 25-12-2007 / 10:05:17 / janfrog"
   300 ! !
   304 ! !
   301 
   305 
       
   306 
   302 !NewSystemBrowserCodeView methodsFor:'change & update'!
   307 !NewSystemBrowserCodeView methodsFor:'change & update'!
   303 
   308 
   304 updateParseTree
   309 updateParseTree
   305 
   310 
   306     self startParsingProcess
   311     self startParsingProcess
   307     "/Transcript showCR:'Updating parse tree'
   312     "/Transcript showCR:'Updating parse tree'
   308 
   313 
   309     "Created: / 25-12-2007 / 10:05:49 / janfrog"
   314     "Created: / 25-12-2007 / 10:05:49 / janfrog"
   310     "Modified: / 25-12-2007 / 21:29:28 / janfrog"
   315     "Modified: / 25-12-2007 / 21:29:28 / janfrog"
   311 ! !
   316 ! !
       
   317 
   312 
   318 
   313 !NewSystemBrowserCodeView methodsFor:'event handling'!
   319 !NewSystemBrowserCodeView methodsFor:'event handling'!
   314 
   320 
   315 buttonMotion:button x:x y:y 
   321 buttonMotion:button x:x y:y 
   316     (button == 0 and:[ self sensor ctrlDown ]) 
   322     (button == 0 and:[ self sensor ctrlDown ]) 
   357 
   363 
   358     "Created: / 18-02-2008 / 17:18:22 / janfrog"
   364     "Created: / 18-02-2008 / 17:18:22 / janfrog"
   359 !
   365 !
   360 
   366 
   361 keyPress:key x:x y:y 
   367 keyPress:key x:x y:y 
       
   368     <resource: #keyboard (#Control_L 
       
   369                           #Tab #Return #BackSpace #Delete
       
   370                           #GoBack)>
       
   371 
   362     (x notNil and:[ y notNil ]) ifTrue:[
   372     (x notNil and:[ y notNil ]) ifTrue:[
   363         key = #'Control_L' ifTrue:[
   373         key = #'Control_L' ifTrue:[
   364             self
   374             self
   365                 highlightNodeAtX:x y:y;
   375                 highlightNodeAtX:x y:y;
   366                 redraw
   376                 redraw
   367         ].
   377         ].
   368          "key = #Alt_L ifTrue: [self highlightParseTreeNodeAtX: x y: y; redraw]"
   378          "key = #Alt_L ifTrue: [self highlightParseTreeNodeAtX: x y: y; redraw]"
   369     ].
   379     ].
   370 
   380 
   371     (#( #Tab #Return #BackSpace ) includes:key) ifTrue:[
   381     (#( #Tab #Return #BackSpace #Delete) includes:key) ifTrue:[
   372         self startParsingProcess
   382         self startParsingProcess
   373     ].
   383     ].
   374 
   384 
   375     key == #GoBack ifTrue:[self goBack].
   385     key == #GoBack ifTrue:[self goBack].
   376     
   386     
   396         y: y
   406         y: y
   397 
   407 
   398     "Created: / 25-12-2007 / 23:15:15 / janfrog"
   408     "Created: / 25-12-2007 / 23:15:15 / janfrog"
   399     "Modified: / 19-02-2008 / 09:16:11 / janfrog"
   409     "Modified: / 19-02-2008 / 09:16:11 / janfrog"
   400 ! !
   410 ! !
       
   411 
   401 
   412 
   402 !NewSystemBrowserCodeView methodsFor:'menu'!
   413 !NewSystemBrowserCodeView methodsFor:'menu'!
   403 
   414 
   404 browseClassesMenu: classes 
   415 browseClassesMenu: classes 
   405     | menu|
   416     | menu|
   540     "Created: / 18-02-2008 / 21:10:46 / janfrog"
   551     "Created: / 18-02-2008 / 21:10:46 / janfrog"
   541     "Modified: / 21-02-2008 / 09:40:09 / janfrog"
   552     "Modified: / 21-02-2008 / 09:40:09 / janfrog"
   542     "Modified: / 09-09-2012 / 13:24:19 / cg"
   553     "Modified: / 09-09-2012 / 13:24:19 / cg"
   543 ! !
   554 ! !
   544 
   555 
       
   556 
   545 !NewSystemBrowserCodeView methodsFor:'menu - actions'!
   557 !NewSystemBrowserCodeView methodsFor:'menu - actions'!
   546 
   558 
   547 accept
   559 accept
   548 
   560 
   549     super accept.
   561     super accept.
   654 
   666 
   655     "Created: / 18-02-2008 / 21:21:26 / janfrog"
   667     "Created: / 18-02-2008 / 21:21:26 / janfrog"
   656     "Modified: / 19-02-2008 / 09:59:11 / janfrog"
   668     "Modified: / 19-02-2008 / 09:59:11 / janfrog"
   657 ! !
   669 ! !
   658 
   670 
       
   671 
   659 !NewSystemBrowserCodeView methodsFor:'menu - double dispatch'!
   672 !NewSystemBrowserCodeView methodsFor:'menu - double dispatch'!
   660 
   673 
   661 blueButtonMenuForMessageNode:messageNode 
   674 blueButtonMenuForMessageNode:messageNode 
   662     ^ self messageNodeContextMenu:messageNode
   675     ^ self messageNodeContextMenu:messageNode
   663 
   676 
   735 
   748 
   736     "Created: / 18-02-2008 / 19:08:50 / janfrog"
   749     "Created: / 18-02-2008 / 19:08:50 / janfrog"
   737     "Modified: / 18-02-2008 / 21:05:56 / janfrog"
   750     "Modified: / 18-02-2008 / 21:05:56 / janfrog"
   738 ! !
   751 ! !
   739 
   752 
       
   753 
   740 !NewSystemBrowserCodeView methodsFor:'private'!
   754 !NewSystemBrowserCodeView methodsFor:'private'!
   741 
   755 
   742 implementorsOf: selector
   756 implementorsOf: selector
   743 
   757 
   744     selector ifNil:[^#()].
   758     selector ifNil:[^#()].
   757         in: Smalltalk allClasses
   771         in: Smalltalk allClasses
   758         ignoreCase: false
   772         ignoreCase: false
   759 
   773 
   760     "Created: / 26-12-2007 / 11:37:22 / janfrog"
   774     "Created: / 26-12-2007 / 11:37:22 / janfrog"
   761 ! !
   775 ! !
       
   776 
   762 
   777 
   763 !NewSystemBrowserCodeView methodsFor:'private - highlighting'!
   778 !NewSystemBrowserCodeView methodsFor:'private - highlighting'!
   764 
   779 
   765 highlightClear
   780 highlightClear
   766     self list ifNil:[ ^ self ].
   781     self list ifNil:[ ^ self ].
   896     "Created: / 25-12-2007 / 22:57:23 / janfrog"
   911     "Created: / 25-12-2007 / 22:57:23 / janfrog"
   897     "Modified: / 26-12-2007 / 11:16:14 / janfrog"
   912     "Modified: / 26-12-2007 / 11:16:14 / janfrog"
   898     "Modified: / 01-09-2009 / 22:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   913     "Modified: / 01-09-2009 / 22:29:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   899 ! !
   914 ! !
   900 
   915 
       
   916 
   901 !NewSystemBrowserCodeView methodsFor:'private - highlighting - nodes'!
   917 !NewSystemBrowserCodeView methodsFor:'private - highlighting - nodes'!
   902 
   918 
   903 highlightLiteralNode: node
   919 highlightLiteralNode: node
   904 
   920 
   905     node value isSymbol ifTrue:
   921     node value isSymbol ifTrue:
   922     ^ self highlightFrom: node start to: node stop
   938     ^ self highlightFrom: node start to: node stop
   923 
   939 
   924     "Created: / 25-12-2007 / 23:45:42 / janfrog"
   940     "Created: / 25-12-2007 / 23:45:42 / janfrog"
   925     "Modified: / 18-02-2008 / 20:51:51 / janfrog"
   941     "Modified: / 18-02-2008 / 20:51:51 / janfrog"
   926 ! !
   942 ! !
       
   943 
   927 
   944 
   928 !NewSystemBrowserCodeView methodsFor:'private - parsing'!
   945 !NewSystemBrowserCodeView methodsFor:'private - parsing'!
   929 
   946 
   930 parseTree
   947 parseTree
   931 
   948 
   999     ]
  1016     ]
  1000 
  1017 
  1001     "Created: / 25-12-2007 / 21:16:03 / janfrog"
  1018     "Created: / 25-12-2007 / 21:16:03 / janfrog"
  1002 ! !
  1019 ! !
  1003 
  1020 
       
  1021 
  1004 !NewSystemBrowserCodeView methodsFor:'private - testing'!
  1022 !NewSystemBrowserCodeView methodsFor:'private - testing'!
  1005 
  1023 
  1006 isInstanceVariableNode: node
  1024 isInstanceVariableNode: node
  1007 
  1025 
  1008 
  1026 
  1020     ^false
  1038     ^false
  1021 
  1039 
  1022     "Created: / 21-02-2008 / 09:32:33 / janfrog"
  1040     "Created: / 21-02-2008 / 09:32:33 / janfrog"
  1023 ! !
  1041 ! !
  1024 
  1042 
       
  1043 
  1025 !NewSystemBrowserCodeView class methodsFor:'documentation'!
  1044 !NewSystemBrowserCodeView class methodsFor:'documentation'!
  1026 
  1045 
  1027 version_CVS
  1046 version_CVS
  1028     ^ '§Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowserCodeView.st,v 1.11 2012/09/09 19:17:44 cg Exp §'
  1047     ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowserCodeView.st,v 1.12 2013-01-17 10:35:08 cg Exp $'
  1029 !
  1048 !
  1030 
  1049 
  1031 version_SVN
  1050 version_SVN
  1032     ^ '$Id: Tools__NewSystemBrowserCodeView.st 8054 2012-09-13 09:15:20Z vranyj1 $'
  1051     ^ '§Id: Tools__NewSystemBrowserCodeView.st 7486 2009-10-26 22:06:24Z vranyj1 §'
  1033 ! !
  1052 ! !
       
  1053 
  1034 
  1054 
  1035 NewSystemBrowserCodeView initialize!
  1055 NewSystemBrowserCodeView initialize!