Skip to content

Instantly share code, notes, and snippets.

@estebanlm
Last active October 20, 2021 16:07
Show Gist options
  • Save estebanlm/9a15ce0f3c1eef61af5062ccf51d1605 to your computer and use it in GitHub Desktop.
Save estebanlm/9a15ce0f3c1eef61af5062ccf51d1605 to your computer and use it in GitHub Desktop.
Example StInspector complex extension with activation
Collection >> tabInspectorList: builder [
<inspectorPresentationOrder: 90 title: 'Tab View'>
^ StCollectionExampleInspection on: self
]
Class {
#name : #StCollectionExampleInspection,
#superclass : #StInspection,
#instVars : [
'notebook',
'unorderedList',
'orderedList'
],
#category : #'NewTools-Inspector-View'
}
{ #category : #testing }
StCollectionExampleInspection >> hasOutputActivationPort [
^ true
]
{ #category : #initialization }
StCollectionExampleInspection >> initializePresenters [
self layout: (SpBoxLayout newTopToBottom
add: (notebook := self newNotebook);
yourself).
orderedList := self newList.
unorderedList := self newList.
notebook
addPage: (SpNotebookPage
title: 'Raw'
icon: (self iconNamed: #nautilusIcon)
provider: [ unorderedList items: self model; yourself ]);
addPage: (SpNotebookPage
title: 'Sorted'
icon: (self iconNamed: #nautilusIcon)
provider: [ orderedList items: self model asSortedCollection ])
]
{ #category : #ports }
StCollectionExampleInspection >> outputActivationPort [
^ unorderedList outputActivationPort,
orderedList outputActivationPort
]
@estebanlm
Copy link
Author

mmm... that example misses two methods:

StCollectionExampleInspection >> activateOnSingleClick [

    unorderedList activateOnSingleClick.
    orderedList activateOnSingleClick
]

StCollectionExampleInspection >> activateOnDoubleClick [

    unorderedList activateOnDoubleClick.
    orderedList activateOnDoubleClick
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment