-
Notifications
You must be signed in to change notification settings - Fork 5
How to extend Algernon
Patrick R edited this page Jan 7, 2022
·
3 revisions
- Create a subclass of ALGType to create a new category in your results and therefore also a new kind
- If needed, add a new icon for it into the ALGIconFactory (class side)
Actions are always defined for a specific ALGType.
- In your ALGType add a new createActionXXX method
- In this method specify the target as an argument and specify the constants shown below
- In your ALGType add your new action creation method to createListOfAlgeractions
ALGAction
withName: 'ACTION_NAME'
rank: A_NUMBER "the higher the further at the top"
target: TARGET_ARGUMENT
selector: THE_SYMBOL_TO_CALL_ON_YOUR_TARGET
args: ARRAY_OF_ARGUMENTS_FOR_THAT_SELECTOR_TO_CALL
Execute the following two lines to update the run-time state:
ALGItemProvider initializeItems.
ALGInstallation someInstance cleanup.
createActionExploreFor: aClass
^ ALGAction
withName: 'explore instances'
rank: 6
target: aClass
selector: #allInstancesDo:
args: (OrderedCollection with: [ :instance | instance explore ])
createActionBrowseNewFor: aCategory
^ ALGAction
withName: 'browse (new)'
rank: 5
target: self
selector: #openInNewBrowser:
args: (OrderedCollection with: aCategory)