Tools__NewSystemBrowser.st
changeset 12006 d2433575969c
parent 11993 017f2d47ebaf
child 12038 5d7a7fca1314
--- a/Tools__NewSystemBrowser.st	Sat Nov 03 15:22:14 2012 +0100
+++ b/Tools__NewSystemBrowser.st	Sat Nov 03 15:41:29 2012 +0100
@@ -17757,7 +17757,7 @@
 !
 
 infoLabelHolder
-    "the current buffers infoLabel (info field)"
+    "the current buffer's infoLabel (info field at the bottom)"
 
     ^ self navigationState infoLabelHolder
 !
@@ -18354,8 +18354,9 @@
 !
 
 selectedClasses
+    "bad name- it's a holder, baby"
+
     ^ self navigationState selectedClasses
-
 !
 
 selectedClassesValue
@@ -36387,6 +36388,7 @@
 
      "/ stop if some argument has a particular value 
      "/     (context argAt:1) = ''hello'' 
+     "/     (context argAt:1) isString and:[ (context argAt:1) startsWith:''foo'']
      "/     (context argAt:1) = 1234 
      "/     (context argAt:1) = (context argAt:2) 
 
@@ -37228,9 +37230,9 @@
     settingsList := 
         #(
             #('Editor'                  #'AbstractSettingsApplication::EditSettingsAppl'                )
-            #('Code Editor 2'           #'Tools::CodeView2SettingsAppl'                                 )
-            #('Syntax Color'            #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
-            #('Code Format'             #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
+            #('Editor/Code Editor 2'    #'Tools::CodeView2SettingsAppl'                                 )
+            #('Editor/Syntax Color'     #'AbstractSettingsApplication::SyntaxColorSettingsAppl'         )
+            #('Editor/Code Format'      #'AbstractSettingsApplication::SourceCodeFormatSettingsAppl'    )
             #('System Browser'          #'AbstractSettingsApplication::SystemBrowserSettingsAppl'       )
             #('Compiler'                #'AbstractSettingsApplication::GeneralCompilerSettingsAppl'     )
             #('Compiler/ByteCode'       #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl'    )
@@ -42878,7 +42880,7 @@
 !
 
 selectorMenuBackToPrevious
-    "show the methods previous version in the codeView (to be accepted)"
+    "show the method's previous version in the codeView (to be accepted)"
 
     |m previousCode|
 
@@ -48279,65 +48281,71 @@
 operationsMenu
     <resource: #programMenu >
 
-        | manager item menu undoCountMenuItem lRedo lUndo
-          undoListMenu|
-
-        (self canUseRefactoringSupport) ifFalse:[
-            ^
-             #(#Menu
-                #(
-                 #(#MenuItem
-                    #label: 'Load Refactoring and Undo Features'
-                    #translateLabel: true
-                    #showBusyCursorWhilePerforming: true
-                    #value: #doLoadRefactoringSupport
-                  )
-                 )
-                nil
-                nil
+    | manager item menu undoCountMenuItem cleanChangesForClassItem
+      lRedo lUndo undoListMenu|
+
+    (self canUseRefactoringSupport) ifFalse:[
+        ^
+         #(#Menu
+            #(
+             #(#MenuItem
+                #label: 'Load Refactoring and Undo Features'
+                #translateLabel: true
+                #showBusyCursorWhilePerforming: true
+                #value: #doLoadRefactoringSupport
               )
-        ].
-
-        manager := RefactoryChangeManager instance.
-        menu := Menu new.
-
-        lUndo := (manager hasUndoableOperations
-                ifTrue: [resources string:'Undo: %1' with:(manager undoChange name contractTo:100)]
-                ifFalse: [resources string:'Undo']).
-
-        item := MenuItem labeled:lUndo.
+             )
+            nil
+            nil
+          )
+    ].
+
+    manager := RefactoryChangeManager instance.
+    menu := Menu new.
+
+    lUndo := (manager hasUndoableOperations
+            ifTrue: [resources string:'Undo: %1' with:(manager undoChange name contractTo:100)]
+            ifFalse: [resources string:'Undo']).
+
+    item := MenuItem labeled:lUndo.
+    item showBusyCursorWhilePerforming:true.
+    item itemValue:[ self operationsMenuUndo ].
+    manager hasUndoableOperations ifFalse: [item disable].
+    menu addItem:item.
+
+    lRedo := (manager hasRedoableOperations
+            ifTrue: [resources string:'Redo: %1' with:(manager redoChange name contractTo:100)]
+            ifFalse: [resources string:'Redo']).
+
+    item := MenuItem labeled:lRedo.
+    item showBusyCursorWhilePerforming:true.
+    item itemValue:[ self operationsMenuRedo].
+    manager hasRedoableOperations ifFalse: [item disable].
+    menu addItem:item.
+
+    undoListMenu := Menu new.
+    manager undoableOperations reverseDo:[:eachUndoChange |
+        item := MenuItem labeled:(eachUndoChange name contractTo:100).
         item showBusyCursorWhilePerforming:true.
-        item itemValue:[ self operationsMenuUndo ].
-        manager hasUndoableOperations ifFalse: [item disable].
-        menu addItem:item.
-
-        lRedo := (manager hasRedoableOperations
-                ifTrue: [resources string:'Redo: %1' with:(manager redoChange name contractTo:100)]
-                ifFalse: [resources string:'Redo']).
-
-        item := MenuItem labeled:lRedo.
-        item showBusyCursorWhilePerforming:true.
-        item itemValue:[ self operationsMenuRedo].
-        manager hasRedoableOperations ifFalse: [item disable].
-        menu addItem:item.
-
-        undoListMenu := Menu new.
-        manager undoableOperations reverseDo:[:eachUndoChange |
-            item := MenuItem labeled:(eachUndoChange name contractTo:100).
-            item showBusyCursorWhilePerforming:true.
-            item itemValue:[ self operationsMenuUndo:eachUndoChange ].
-            undoListMenu addItem:item.
-        ].
-        item := MenuItem labeled:(resources string:'Undo Recent').
-        item submenu:undoListMenu.
-        item enabled:manager hasUndoableOperations.
-        menu addItem:item.
-
-        undoCountMenuItem := (MenuItem labeled: (resources string:'Set Undo Count...'))
-                                itemValue: [self setUndoCount];
-                                yourself.
-        menu addItemGroup: (Array with: undoCountMenuItem).
-        ^menu
+        item itemValue:[ self operationsMenuUndo:eachUndoChange ].
+        undoListMenu addItem:item.
+    ].
+    item := MenuItem labeled:(resources string:'Undo Recent').
+    item submenu:undoListMenu.
+    item enabled:manager hasUndoableOperations.
+    menu addItem:item.
+
+    undoCountMenuItem := (MenuItem labeled: (resources string:'Set Undo Count...'))
+                            itemValue: [self setUndoCount];
+                            yourself.
+    menu addItemGroup: (Array with: undoCountMenuItem).
+
+    cleanChangesForClassItem := (MenuItem labeled: (resources string:'Remove Class from ChangeSet...'))
+                            itemValue: [self classMenuCleanUpChangeSet];
+                            enabled: self hasClassSelectedHolder;
+                            yourself.
+    menu addItemGroup: (Array with: cleanChangesForClassItem).
+    ^menu
 
     "Modified: / 09-09-2012 / 13:21:02 / cg"
 !
@@ -53838,9 +53846,12 @@
 !
 
 showInfo:msg
+    self navigationState showingParseError:false.
     self infoLabelHolder value:msg.
 
-    "Created: / 15.11.2001 / 18:01:23 / cg"
+    "
+     WindowGroup activeApplication showInfo: 'Hello'
+    "
 !
 
 showMethodInfo
@@ -54321,6 +54332,8 @@
 
     |dontDoIt oldCodeList highlighterClass prio currentMethod methodsClass codeView|
 
+    "/ sigh: the codeView2 has its own idea of how to do this.
+    "/ for now, duplicate code; will be cleaned up asap.
     (UserPreferences current useCodeView2In: #Browser) ifTrue:[^self].
 
     dontDoIt := (currentMethod := self theSingleSelectedMethod) isNil.
@@ -54376,6 +54389,7 @@
                         cls := Smalltalk at:cls name
                     ].
                 ].
+                "check after every lengthy operation if modified by user in the meantime..."
                 codeView modified ifFalse:[
                     oldCodeList := codeView list copy.
                     codeView modified ifFalse:[
@@ -54384,7 +54398,7 @@
                             codeView modified ifFalse:[
                                 Screen currentScreenQuerySignal answer:device
                                 do:[
-                                    Parser::ParseError handle:[:ex |
+                                    Parser parseErrorSignal handle:[:ex |
                                         |errMsg|
 
                                         errMsg := ex description asStringCollection first asString.
@@ -54393,6 +54407,7 @@
                                         "/ Transcript showCR:'ParseError: ', ex description.
     "/ self halt.
                                         self showInfo:(errMsg colorizeAllWith:Color red).
+                                        self navigationState showingParseError:true.
                                         newCode := nil.
                                     ] do:[
                                         |codeAspect|
@@ -54468,7 +54483,7 @@
 
     codeView := self codeView.
     codeView modified ifTrue:[
-        "/ new input arrived in the meantime
+        "/ new user input arrived in the meantime
 
         ^ self
     ].
@@ -54484,6 +54499,11 @@
 
         ^ self
     ].
+
+    self navigationState showingParseError ifTrue:[
+        self showInfo:''.       "/ to erase any previous syntax error
+    ].
+
     firstShown := codeView firstLineShown.
     lastShown := codeView lastLineShown.
     replaceAction := [:lNr :line |
@@ -55682,18 +55702,18 @@
 codeModified
     "invoked when the user edits the text shown in the codeView"
 
-    |navigationState|
+    |navigationState codeView|
 
     navigationState := self navigationState.
 
-    self codeView modified ifTrue:[
+    (codeView := self codeView) modified ifTrue:[
         navigationState realModifiedState:true.
 
-        self codeView isCodeView2 ifFalse:[
+        codeView isCodeView2 ifFalse:[
             self startSyntaxHighlightProcess.
         ].
-        self navigationState realModifiedState:true.
-        self codeView modifiedChannel setValue:false.
+        navigationState realModifiedState:true.
+        codeView modifiedChannel setValue:false.
     ].
     self enqueueDelayedCheckReallyModified.
     self updateBufferLabel.
@@ -57928,11 +57948,11 @@
 !NewSystemBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1816 2012-11-01 16:12:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1817 2012-11-03 14:41:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1816 2012-11-01 16:12:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NewSystemBrowser.st,v 1.1817 2012-11-03 14:41:29 cg Exp $'
 !
 
 version_SVN