Reintroduced PO>>subject.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 20 Jun 2014 13:56:46 +0100
changeset 346 88c1d211f9be
parent 345 3623c9cde340
child 347 d76d7d8d17a3
Reintroduced PO>>subject. This method is usefull when writing generic code (such as the one in search dialogs). However, PO>>subject is now considered 'private' and should be used with care. It's name is not very intention revealing and it is not clear what it really returns. Don't use it in non-generic code that does care what's the return value.
SmallSense__AbstractSearchDialog.st
SmallSense__ClassPO.st
SmallSense__ClassSearchDialog.st
SmallSense__ConstantPO.st
SmallSense__MethodPO.st
SmallSense__MethodSearchDialog.st
SmallSense__PO.st
SmallSense__PackagePO.st
SmallSense__PackageSearchDialog.st
SmallSense__TokenPatternParser.st
SmallSense__VariablePO.st
smallsense.rc
--- a/SmallSense__AbstractSearchDialog.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__AbstractSearchDialog.st	Fri Jun 20 13:56:46 2014 +0100
@@ -507,17 +507,12 @@
 updateAcceptedValue
     "Dialog has been accepted (OK pressed). Update accepted value"
 
-"/    Template:
-"/ 
-"/    matchingObjectsMultiselect ifTrue:[
-"/        acceptedValue := matchingObjectsSelectionHolder value collect:[:e|e halt].
-"/    ] ifFalse:[ 
-"/        acceptedValue := matchingObjectsSelectionHolder value halt.
-"/    ].  
-
-    ^ self subclassResponsibility
+    acceptedValue := matchingObjectsMultiselect 
+        ifTrue:[ matchingObjectsSelectionHolder value collect:[:e|e subject] ]
+        ifFalse:[ matchingObjectsSelectionHolder value subject ]
 
     "Created: / 19-06-2014 / 11:57:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 20-06-2014 / 13:50:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 updateMatchingLabelToNormal
--- a/SmallSense__ClassPO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__ClassPO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -73,8 +73,6 @@
     "Created: / 20-05-2014 / 11:29:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-
-
 showPrefix
     ^ showPrefix
 !
@@ -117,9 +115,18 @@
 
     "Created: / 03-10-2013 / 16:42:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
     "Modified: / 20-05-2014 / 11:41:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
+! !
+
+!ClassPO methodsFor:'accessing-private'!
 
- !
+subject
+    "Return the real object for which the receiver
+     is a presentor."
+
+    ^ klass
+
+    "Created: / 20-06-2014 / 11:10:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
 
 !ClassPO methodsFor:'converting'!
 
@@ -134,12 +141,6 @@
     "Modified: / 26-08-2013 / 10:27:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-!ClassPO methodsFor:'displaying'!
-
-
-
- !
-
 !ClassPO methodsFor:'initialization'!
 
 initialize
@@ -178,3 +179,4 @@
 version_SVN
     ^ '$Id: SmallSense__ClassPO.st,v 1.2 2014/02/12 14:49:29 sr Exp $'
 ! !
+
--- a/SmallSense__ClassSearchDialog.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__ClassSearchDialog.st	Fri Jun 20 13:56:46 2014 +0100
@@ -167,18 +167,6 @@
     "Created: / 27-04-2014 / 23:45:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-updateAcceptedValue
-    "Dialog has been accepted (OK pressed). Update accepted value"
-
-    matchingObjectsMultiselect ifTrue:[
-        acceptedValue := matchingObjectsSelectionHolder value collect:[:e|e klass].
-    ] ifFalse:[ 
-        acceptedValue := matchingObjectsSelectionHolder value klass.
-    ].
-
-    "Created: / 19-06-2014 / 11:59:15 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 updateMatchingObjectsIgnorePattern
     "/ There's a lot of classes, do not display them all but
     "/ rather display only recent selections.
--- a/SmallSense__ConstantPO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__ConstantPO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -29,6 +29,19 @@
     "Created: / 20-05-2014 / 11:32:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!ConstantPO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+     
+     For internal usage only."
+
+    ^ self shouldNotImplement
+
+    "Created: / 20-06-2014 / 11:10:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !ConstantPO methodsFor:'testing'!
 
 isSmallSenseConstantPO
--- a/SmallSense__MethodPO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__MethodPO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -104,6 +104,22 @@
     "Modified: / 20-05-2014 / 10:29:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!MethodPO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+     
+     For internal usage only."
+
+    classes size ~~ 1 ifTrue:[ 
+        self error: 'Multiple classes'
+    ].
+    ^ classes anElement compiledMethodAt: selector
+
+    "Created: / 20-06-2014 / 11:11:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !MethodPO methodsFor:'initialization'!
 
 initializeWithClass: aClass selector: aSymbol
--- a/SmallSense__MethodSearchDialog.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__MethodSearchDialog.st	Fri Jun 20 13:56:46 2014 +0100
@@ -74,18 +74,6 @@
 
 !MethodSearchDialog methodsFor:'change & update'!
 
-updateAcceptedValue
-    "Dialog has been accepted (OK pressed). Update accepted value"
-
-    matchingObjectsMultiselect ifTrue:[
-        acceptedValue := matchingObjectsSelectionHolder value collect:[:e|e selector].
-    ] ifFalse:[ 
-        acceptedValue := matchingObjectsSelectionHolder value selector.
-    ].
-
-    "Created: / 19-06-2014 / 12:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 updateMatchingObjectsIgnorePattern
     "/ There's a lot of method, do not display them all but
     "/ rather display only recent selections.                   
--- a/SmallSense__PO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__PO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -179,14 +179,6 @@
     "Modified: / 20-05-2014 / 11:32:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
-subject
-    <resource: #obsolete>
-
-    self error: 'Should no longer be sent'.
-
-    "Modified: / 20-05-2014 / 10:16:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
-
 subject:anObject
     <resource: #obsolete>
 
@@ -195,6 +187,19 @@
     "Modified: / 20-05-2014 / 10:16:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!PO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+
+     For internal usage only."
+
+    ^ self subclassResponsibility
+
+    "Modified: / 20-06-2014 / 11:09:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !PO methodsFor:'completion'!
 
 insert
--- a/SmallSense__PackagePO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__PackagePO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -45,6 +45,19 @@
     "Created: / 06-05-2014 / 00:05:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!PackagePO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+     
+     For internal usage only."
+
+    ^ package
+
+    "Created: / 20-06-2014 / 11:11:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !PackagePO methodsFor:'initialization'!
 
 initializeWithPackage: aStringOrSymbol
--- a/SmallSense__PackageSearchDialog.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__PackageSearchDialog.st	Fri Jun 20 13:56:46 2014 +0100
@@ -9,20 +9,6 @@
 	category:'SmallSense-Core-Interface-Search'
 !
 
-!PackageSearchDialog methodsFor:'change & update'!
-
-updateAcceptedValue
-    "Dialog has been accepted (OK pressed). Update accepted value"
-
-    matchingObjectsMultiselect ifTrue:[
-        acceptedValue := matchingObjectsSelectionHolder value collect:[:e|e name].
-    ] ifFalse:[ 
-        acceptedValue := matchingObjectsSelectionHolder value name.
-    ].
-
-    "Created: / 19-06-2014 / 12:00:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-! !
-
 !PackageSearchDialog methodsFor:'queries'!
 
 canSelect:selection
--- a/SmallSense__TokenPatternParser.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__TokenPatternParser.st	Fri Jun 20 13:56:46 2014 +0100
@@ -135,3 +135,10 @@
     "Modified: / 09-05-2014 / 16:35:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
+!TokenPatternParser class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+! !
+
--- a/SmallSense__VariablePO.st	Thu Jun 19 15:19:22 2014 +0100
+++ b/SmallSense__VariablePO.st	Fri Jun 20 13:56:46 2014 +0100
@@ -85,6 +85,19 @@
     type := something.
 ! !
 
+!VariablePO methodsFor:'accessing-private'!
+
+subject
+    "Return the real object for which the receiver
+     is a presentor.
+     
+     For internal usage only."
+
+    ^ name
+
+    "Created: / 20-06-2014 / 11:11:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
 !VariablePO methodsFor:'displaying'!
 
 displayLabel:aLabel h:lH on:aGC x:x y:y h:h
--- a/smallsense.rc	Thu Jun 19 15:19:22 2014 +0100
+++ b/smallsense.rc	Fri Jun 20 13:56:46 2014 +0100
@@ -25,7 +25,7 @@
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.4.0\0"
-      VALUE "ProductDate", "Thu, 19 Jun 2014 12:14:56 GMT\0"
+      VALUE "ProductDate", "Fri, 20 Jun 2014 12:53:25 GMT\0"
     END
 
   END