LepiterPlugins/src/LepiterPlugins/LeSnippet.extension.st

22 lines
615 B
Smalltalk

Extension { #name : #LeSnippet }
{ #category : #'*LepiterPlugins' }
LeSnippet >> index [
| uuids |
uuids := self parent children collect: [:each | each uidString ].
uuids doWithIndex: [ :unId :i |
unId = self uidString ifTrue: [ ^ i ]
]
]
{ #category : #'*LepiterPlugins' }
LeSnippet >> moveFrom: originPage to: destinationPage [
| db origin thisSnippet destination |
db := self page database.
destination := db pageNamed: destinationPage.
origin := db pageNamed: originPage.
thisSnippet := origin children at: self index.
origin removeSnippet: thisSnippet.
destination addSnippet: thisSnippet.
]