extensions.st
branchjv
changeset 16845 4fe165efc72c
parent 16828 3be43a489ae3
parent 16837 338852b221c5
child 16848 d4200cb12374
--- a/extensions.st	Thu Sep 08 06:46:12 2016 +0200
+++ b/extensions.st	Sat Sep 10 06:51:05 2016 +0200
@@ -889,6 +889,26 @@
     ^ atts
 ! !
 
+!FileStream methodsFor:'inspecting'!
+
+inspectorExtraMenuOperations
+    "extra operation-menu entries to be shown in an inspector.
+     Answers a collection of pairs contining aString and action aBlock.
+     aString is the label of the menu item.
+     aBlock is evaluated when the menu item is selected.
+     To be redefined in objects which think that it makes sense to offer
+     often used operations in an inspector.
+     See SerialPort as an example."
+
+    |superItems|
+
+    superItems := super inspectorExtraMenuOperations.
+    ^ superItems , 
+            {
+                { 'Close File' . [self close] }
+            }.
+! !
+
 !Filename methodsFor:'debugging'!
 
 inspector2TabContentsView
@@ -1642,6 +1662,29 @@
 
 ! !
 
+!NonPositionableExternalStream methodsFor:'inspecting'!
+
+inspectorExtraMenuOperations
+    "extra operation-menu entries to be shown in an inspector.
+     Answers a collection of pairs contining aString and action aBlock.
+     aString is the label of the menu item.
+     aBlock is evaluated when the menu item is selected.
+     To be redefined in objects which think that it makes sense to offer
+     often used operations in an inspector.
+     See SerialPort as an example."
+
+    |superItems|
+    
+    superItems := super inspectorExtraMenuOperations.
+    (self == Stdin or:[self == Stdout or:[self == Stderr]]) ifTrue:[        
+        ^ superItems
+    ].
+    ^ superItems , 
+            {
+                { 'Close Stream' . [self close] }
+            }.
+! !
+
 !Notification class methodsFor:'misc ui support'!
 
 iconInBrowserSymbol