From 4e9b6e714424ab2ae7fe94acdb40bdda004f2aab Mon Sep 17 00:00:00 2001 From: Juraj Kubelka Date: Wed, 30 Oct 2024 18:23:56 -0300 Subject: [PATCH] define lepiter's `GtPhlowToolCommonViewModel` [feenkcom/gtoolkit#3422] --- src/Lepiter-UI/LePageToolElement.class.st | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Lepiter-UI/LePageToolElement.class.st b/src/Lepiter-UI/LePageToolElement.class.st index 90ff8e15..9044d819 100644 --- a/src/Lepiter-UI/LePageToolElement.class.st +++ b/src/Lepiter-UI/LePageToolElement.class.st @@ -43,7 +43,11 @@ LePageToolElement >> initialize [ detailed: [ :aStyle | aStyle do: [ self onDetailedVolume ] ]). self beFocusable. - self when: BlClickEvent do: [ :anEvent | self requestFocus ] + self when: BlClickEvent do: [ :anEvent | self requestFocus ]. + self phlow + accessTool: (GtPhlowToolClassType forClass: LePage) + viewModel: #pageViewModel + object: #pageModel. ] { #category : #initialization } @@ -119,6 +123,12 @@ LePageToolElement >> onSidebarChangePageWish: aWish [ self pageViewModel: aWish pageUIModel ] +{ #category : #'api - page model' } +LePageToolElement >> pageModel [ + self hasPage ifFalse: [ ^ nil ]. + ^ self pageViewModel pageModel +] + { #category : #'api - accessing' } LePageToolElement >> selectionTransformation: aBlock [ self contentElement selectionTransformation: aBlock