#DOCUMENTATION by cg
class: Annotation class
comment/format in:
#HGRevision:
#ignore:rationale:
#ignore:rationale:author:
#ignoreLintRule:rationale:author:
#key:arguments:
#knownPragmas
#lint:rationale:author:
#method:key:arguments:
#resource:
#resource:values:
category of:
#for:selector:arguments:
#keyword:arguments:
#method:key:arguments:
--- a/Annotation.st Sun Jul 16 13:14:07 2017 +0200
+++ b/Annotation.st Sun Jul 16 13:36:47 2017 +0200
@@ -145,6 +145,9 @@
<inspector2Tab>
<postLoad>
<swizzle: selector>
+
+ <category: '...'>
+ GNU-smalltalk's way of defining method categories
"
! !
@@ -160,46 +163,20 @@
!Annotation class methodsFor:'instance creation'!
-for: aMethod selector: aSelector arguments: anArray
- ^self new
- setMethod: aMethod;
- setKeyword: aSelector;
- setArguments: anArray;
- yourself
-!
-
key: key arguments: arguments
-
"/ cg: do not react on all those methods inherited from Object (such as inline:)
"/ (self respondsTo: key)
(self class includesSelector:key) ifTrue: [
^ self
perform: key
withArguments: arguments
- ] ifFalse:[
- ^ Annotation::Unknown new
- key: key
- arguments: arguments
- ]
+ ].
+ ^ Annotation::Unknown new
+ key: key arguments: arguments
"Created: / 19-05-2010 / 16:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 02-07-2010 / 16:22:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 07-02-2017 / 20:27:49 / cg"
-!
-
-method:method key:key arguments:arguments
- "/ cg: do not react on all those methods inherited from Object (such as inline:)
- "/ (self respondsTo: key)
- (self class includesSelector:key) ifTrue: [
- ^ self perform: key withArguments: arguments
- ] ifFalse: [
- ^ Annotation::Unknown new method: method key: key arguments: arguments
- ]
-
- "Created: / 19-05-2010 / 16:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Modified: / 02-07-2010 / 16:22:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
- "Created: / 05-09-2011 / 04:39:17 / cg"
- "Modified: / 07-02-2017 / 20:15:55 / cg"
+ "Modified (format): / 16-07-2017 / 13:23:00 / cg"
!
nameSpace: aString
@@ -219,16 +196,23 @@
!
resource: type
-
+ "resource method - returns menu, spec or image,
+ or accesses/uses the viewStyle"
+
^Annotation::Resource new type: type value:nil
"Created: / 16-07-2010 / 11:31:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 16-07-2017 / 13:23:47 / cg"
!
resource:type values:value
+ "resource method - returns menu, spec or image,
+ or accesses/uses the viewStyle"
+
^ Annotation::Resource new type:type value:value
"Created: / 16-07-2010 / 11:31:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (comment): / 16-07-2017 / 13:23:53 / cg"
! !
!Annotation class methodsFor:'finding'!
@@ -315,7 +299,15 @@
^ (self allNamed: aSymbol in: aClass) sort: aSortBlock.
! !
-!Annotation class methodsFor:'private'!
+!Annotation class methodsFor:'instance creation - basic'!
+
+for: aMethod selector: aSelector arguments: anArray
+ ^self new
+ setMethod: aMethod;
+ setKeyword: aSelector;
+ setArguments: anArray;
+ yourself
+!
keyword: aSymbol arguments: anArray
^ self new
@@ -324,6 +316,23 @@
yourself.
!
+method:method key:key arguments:arguments
+ "/ cg: do not react on all those methods inherited from Object (such as inline:)
+ "/ (self respondsTo: key)
+ (self class includesSelector:key) ifTrue: [
+ ^ self perform: key withArguments: arguments
+ ].
+ ^ Annotation::Unknown new
+ method: method key: key arguments: arguments
+
+ "Created: / 19-05-2010 / 16:47:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified: / 02-07-2010 / 16:22:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Created: / 05-09-2011 / 04:39:17 / cg"
+ "Modified (format): / 16-07-2017 / 13:22:53 / cg"
+! !
+
+!Annotation class methodsFor:'private'!
+
withPragmasIn: aClass do: aBlock
aClass selectorsAndMethodsDo: [ :selector :method | method annotationsDo: aBlock ].