class: Tools::NewSystemBrowser
authorClaus Gittinger <cg@exept.de>
Sun, 25 Aug 2013 18:47:28 +0200
changeset 13364 1643706fa245
parent 13363 4cc837ad3854
child 13365 58156ff25996
class: Tools::NewSystemBrowser added: #toggleLearnMode comment/format in: #askForMethodCategory:title:okLabel:list:recentList:initialAnswer: changed: #acceptMethod:inClass:language:check: #doAcceptClassDefinition:fullClass:usingCompiler: #editModeInfoLabelMenu
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Sun Aug 25 18:36:09 2013 +0200
+++ b/Tools__NewSystemBrowser.st	Sun Aug 25 18:47:28 2013 +0200
@@ -9107,6 +9107,14 @@
             itemValue: editModeInsertAndSelect
             translateLabel: true
           )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
+            label: 'Learn Macro'
+            itemValue: toggleLearnMode
+            translateLabel: true
+          )
          )
         nil
         nil
@@ -37978,6 +37986,10 @@
 
     "Modified: / 06-07-2011 / 12:38:07 / cg"
     "Created: / 15-10-2011 / 12:02:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+toggleLearnMode
+    self codeView toggleLearnMode
 ! !
 
 !NewSystemBrowser methodsFor:'menu actions-project'!
@@ -52144,13 +52156,13 @@
         initialAnswer:initialText
 !
 
-askForMethodCategory:title title:boxTitle okLabel:okLabel list:someCategories recentList:recentListOrNil initialAnswer:initialText
+askForMethodCategory:question title:boxTitle okLabel:okLabel list:someCategories recentList:recentListOrNil initialAnswer:initialText
     "convenient helper method: setup a box asking for a method category"
 
     |box retVal shownCategories allMethodCategories|
 
     box := self
-            listBoxTitle:title
+            listBoxTitle:question
             okText:okLabel
             list:someCategories.
     box label:boxTitle.
@@ -56624,6 +56636,7 @@
     newSelector := self selectorOfMethodFromCode:code in:cls.
     existingMethod := cls compiledMethodAt:newSelector ifAbsent:[].
     cat := self protocolToAcceptMethod:newSelector class:cls.
+    cat isNil ifTrue:[^ false].
 
     AbortOperationRequest catch:[
         (Class methodRedefinitionNotification) handle:[:ex |
@@ -56814,9 +56827,12 @@
                                 change := InteractiveAddMethodChange compile:code in:cls classified:cat.
                                 change controller:codeView.
                                 "/ change named:('Accept method ' , newSelector ? '???').
-
-                                RefactoryChangeManager performChange: change.
-                                rslt := cls compiledMethodAt:newSelector.
+                                Parser parseErrorSignal handle:[:ex |
+                                    rslt := nil
+                                ] do:[
+                                    RefactoryChangeManager performChange: change.
+                                    rslt := cls compiledMethodAt:newSelector.
+                                ]
                             ] ifFalse:[
                                 rslt := language compilerClass
                                     compile:code
@@ -57189,8 +57205,12 @@
                                 (rslt class implements:#documentation) ifFalse:[
                                     comment := (parser comments collect:[:c | c string]) asStringCollection asString.
                                     (comment includesString:'no comment') ifFalse:[ 
-                                        (comment includesString:'the empty string arguments by true values') ifFalse:[ 
-                                            rslt class compile:'documentation\"' withCRs,comment,'"' classified:'documentation'.
+                                        (comment includesString:'the above text has been extracted') ifFalse:[ 
+                                            (comment includesString:'the empty string arguments by true values') ifFalse:[ 
+                                                rslt class 
+                                                    compile:'documentation\"' withCRs,comment,'"' 
+                                                    classified:'documentation'.
+                                            ]
                                         ]
                                     ]
                                 ].
@@ -58851,15 +58871,15 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1959 2013-08-22 13:54:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1960 2013-08-25 16:47:28 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1959 2013-08-22 13:54:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1960 2013-08-25 16:47:28 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: Tools__NewSystemBrowser.st,v 1.1959 2013-08-22 13:54:34 cg Exp $'
+    ^ '$Id: Tools__NewSystemBrowser.st,v 1.1960 2013-08-25 16:47:28 cg Exp $'
 ! !