����, 12 ��������. 2019 ��. �� 13:42, Tim Mackinnon <tim@testit.works>:
Is there any documentation on Calypso�� ��application contexts? I am trying to add a menu item to a package tag (the bit underneath a package - which I often call a sub-package).
Only class comments are available for Calypso. Also there are a
Commander booklet which describes contexts and ClassAnnotation
github readme (together with class comments).
��
I���ve specified:
^CmdContextMenuActivation
�� �� �� �� �� �� �� �� byItemOf: ClyQueryMenuGroup for: RPackage asCalypsoItemContext
The #for: argument of command activations is a context where command should be available. Context describes condition where given command (its activation strategy) should be visible for users.
In your example "RPackage asCalypsoItemContext" is an instance of ClyBrowserItemContext which matches any selected package in the browser (when a kind of RPackage is selected).
And that's why you do not see it on selected tag because the tag is not a package.
But that puts my menu on the package and not the tag��
- and if I use the inspect extra menu in calypso, I get what looks to be something that could help me determine what I want but I���m struggling to understand what ClyTaggedClassGroup does, and what a context is all about.
Inspect command opens inspector of actually selected object which is an instance of ClyTaggedClassGroup in that case (try inspect selected method and you will get a CompiledMethod).
Children of package in browser are instances of ClyClassGroup and subclasses. So they are not raw tags. If you need a command for a tag you should add a command for ClyTaggedClassGroup items:
Look for example at SycPromotePackageFromTagCommand class>>#fullBrowserMenuActivation which is defined this way.