Skip to content

Commit

Permalink
exemplify forward view not computing its object if not displayed [fee…
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed Aug 21, 2024
1 parent e4faea7 commit 9f8b8b7
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/GToolkit-Inspector/GtInspectorSampleB.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GtInspectorSampleB >> gtOneFor: aView [
title: 'One';
priority: 1;
object: [
GtJustContextStackSignal emit.
GtInspectorSampleBOneForwardObjectSignal emit.
self ];
view: #gtTwoFor:
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : #GtInspectorSampleBOneForwardObjectSignal,
#superclass : #ContextStackSignal,
#category : #'GToolkit-Inspector-Example Samples'
}
81 changes: 81 additions & 0 deletions src/GToolkit-Inspector/GtInspectorSelectTabSignal.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Class {
#name : #GtInspectorSelectTabSignal,
#superclass : #ContextStackSignal,
#instVars : [
'tabGroup',
'selector',
'selectedTabModel',
'requestedTabModel'
],
#category : #'GToolkit-Inspector-Tab Selector'
}

{ #category : #'gt - extensions' }
GtInspectorSelectTabSignal >> gtOverview [
^ {GtPhlowOverviewItem new
name: 'Selector';
value: self selector.
GtPhlowOverviewItem new
name: 'Requested tab model';
value: self requestedTabModel.
GtPhlowOverviewItem new
name: 'Selected tab model';
value: self selectedTabModel.
GtPhlowOverviewItem new
name: 'Tab group';
value: self tabGroup}
]

{ #category : #'gt - extensions' }
GtInspectorSelectTabSignal >> gtOverviewFor: aView [
<gtView>
selector ifNil: [ ^ aView empty ].

^ aView columnedList
title: 'Overview';
priority: 0;
items: [ self gtOverview ];
column: 'Name' text: #name weight: 0.3;
column: 'Value' text: #description;
send: #value
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> requestedTabModel [
^ requestedTabModel
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> requestedTabModel: anObject [
requestedTabModel := anObject
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> selectedTabModel [
^ selectedTabModel
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> selectedTabModel: anObject [
selectedTabModel := anObject
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> selector [
^ selector
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> selector: anObject [
selector := anObject
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> tabGroup [
^ tabGroup
]

{ #category : #accessing }
GtInspectorSelectTabSignal >> tabGroup: anObject [
tabGroup := anObject
]
10 changes: 10 additions & 0 deletions src/GToolkit-Inspector/GtInspectorStep.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ GtInspectorStep >> clickOnInspectButton [
// GtInspectorInspectButtonId
]

{ #category : #'steps - interactions' }
GtInspectorStep >> clickOnTabWithName: aTabName [
^ self click
referenceSender;
label: ('Click on inspector tab named {1}' format: { aTabName });
// GtPhlowCompositeViewElementId;
// BrTab;
@ [ :aTab | aTab label asString = aTabName ]
]

{ #category : #'steps - interactions' }
GtInspectorStep >> dragPlaygroundVerticallyBy: aNumber [
^ (self mouseDragBy: 0 @ aNumber)
Expand Down
13 changes: 12 additions & 1 deletion src/GToolkit-Inspector/GtInspectorTabSelector.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,18 @@ GtInspectorTabSelector >> selectTabInGroup: aTabGroupElement on: anObject [
aTabGroupElement viewModel tabs
detect: [ :aTabModel |
self matchesTab: aTabModel ]
ifFound: [ :aTabModel | aTabModel select ]
ifFound: [ :aTabModel |
| aSignal |
aSignal := GtInspectorSelectTabSignal new
tabGroup: aTabGroupElement;
requestedTabModel: aTabModel;
selector: self;
emit.

aTabModel select.

aTabGroupElement viewModel selectedTabDo: [ :aTab |
aSignal selectedTabModel: aTabModel ] ]
ifNone: [ "do nothing" ]
]

Expand Down

0 comments on commit 9f8b8b7

Please sign in to comment.