Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge P13 spec actions #1628

Merged
merged 56 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
b491bb4
add componentListClass to the backend
estebanlm Aug 10, 2024
3c5136d
renames to gain more clarity
estebanlm Aug 10, 2024
6da7582
clarify parameter
estebanlm Aug 10, 2024
541e4a2
base for componentListClass (so we know a backend has to define it)
estebanlm Aug 10, 2024
d68b9da
generic showContextMenu (not valid in all presenters even if in base …
estebanlm Aug 10, 2024
a859eb1
use backend-defined component list
estebanlm Aug 10, 2024
9a1015e
use new action names
estebanlm Aug 10, 2024
f287df9
register action meta+t to show context menu in lists, trees, tables a…
estebanlm Aug 10, 2024
aeaab90
fixes to easy components
estebanlm Aug 10, 2024
1e72d31
popover was not traversing its child
estebanlm Aug 10, 2024
705c9c7
I decided to deprecate this methods because they expose an internal m…
estebanlm Aug 12, 2024
aa582d0
add missing methods
estebanlm Aug 12, 2024
b544d9c
format
estebanlm Aug 12, 2024
18a8dc3
categorize
estebanlm Sep 3, 2024
c8cb405
add `size` vocabulary for windows.
estebanlm Sep 3, 2024
b2d0034
fixing compiler to be able to act on the interaction model (otherwise…
estebanlm Sep 6, 2024
1cb8443
ensure visitor answer its result
estebanlm Sep 6, 2024
7881897
add checkbox compatibility
estebanlm Sep 6, 2024
3367ff7
refactor
estebanlm Sep 9, 2024
242a482
answer yourself for clarity
estebanlm Sep 9, 2024
6dd8ed1
add some tests
estebanlm Sep 13, 2024
b4d6f25
lot of work on the new action system, it is starting to feel right...
estebanlm Sep 18, 2024
658a043
allowing menus to have dynamic actions (to be able to show info on th…
estebanlm Sep 19, 2024
6c51e1d
add missing method
estebanlm Sep 19, 2024
590c5c0
restore contextMenu:/contextKeyBindings: (deprecated) to allow for a …
estebanlm Sep 19, 2024
8e0e75a
try to fix menu on button
estebanlm Sep 20, 2024
1369b5f
Fixes https://github.com/pharo-spec/Spec/issues/1547
estebanlm Sep 20, 2024
65d14e7
another fix for menu in button
estebanlm Sep 20, 2024
05f049e
... and fix context menus for text
estebanlm Sep 20, 2024
bf56a95
Merge 5b6ba6ac956d7036a29c9cedd064d444e15525af
estebanlm Sep 20, 2024
d19f0d1
add registration to acitons also on trees (it was missing)
estebanlm Sep 20, 2024
23bc559
restore misteriously missing changes
estebanlm Sep 25, 2024
72a00ee
add stub for listview
estebanlm Sep 25, 2024
e496f0c
categorize and cleanup
estebanlm Sep 25, 2024
2e6454d
remove unused variables
estebanlm Sep 25, 2024
603646f
put list view adapters in the right baseline
estebanlm Sep 26, 2024
34b1ff1
fix listview tests loading
estebanlm Sep 26, 2024
e92d126
use isRootItem
estebanlm Sep 27, 2024
ef7bd3f
add a simple way to add groups to groups
estebanlm Oct 2, 2024
040bed8
categorize
estebanlm Oct 4, 2024
0b1b14a
fixes https://github.com/pharo-spec/Spec/issues/1562
estebanlm Oct 4, 2024
68016aa
Merge branch 'Pharo13' of github.com:pharo-spec/Spec into dev-3.0
estebanlm Oct 4, 2024
09fa345
turns out I need isRoot and not isRootItem. Let's hope this does not …
estebanlm Oct 10, 2024
ed331f8
add dynamic group first iteration (working, in morphic... not yet in …
estebanlm Oct 10, 2024
8b55194
fix demo test
estebanlm Oct 10, 2024
1b48d5a
why compare by label and block when you can compare models?
estebanlm Oct 10, 2024
fcf079b
restore wrongly modified method
estebanlm Oct 10, 2024
3a912b4
add extension
estebanlm Oct 11, 2024
3be53e4
contextMenu now is nil at first (since we do not use it anymore)
estebanlm Oct 11, 2024
d660c94
fix test
estebanlm Oct 14, 2024
c6b92a5
move dependencies test to release tests to have an early report.
estebanlm Oct 15, 2024
d51b2be
Merge branch 'Pharo13' of github.com:pharo-spec/Spec into dev-3.0
estebanlm Oct 15, 2024
e035028
moved
estebanlm Oct 15, 2024
9da377b
restore lost methods
estebanlm Oct 15, 2024
3608536
restore missing method
estebanlm Oct 16, 2024
c7b7333
fix an error, it can't answer self to indicate there is no menu
estebanlm Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .smalltalk.all.ston
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SmalltalkCISpec {
'Monticello.*',
'Metacello.*',
'System-Settings-Tests.*',
'System-Dependencies-Tests',
'RPackage.*',
'ReleaseTests.*' ],
#classes : [
Expand Down
1 change: 1 addition & 0 deletions .smalltalk.release.ston
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SmalltalkCISpec {
#testing : {
#packages : [
'System-Settings-Tests.*',
'System-Dependencies-Tests',
'ReleaseTests.*' ]
}
}
3 changes: 2 additions & 1 deletion src/BaselineOfSpec2/BaselineOfSpec2.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ BaselineOfSpec2 >> baseline: spec [
spec
"Core"
package: 'Spec2-Adapters-Morphic' with: [ spec requires: #('SpecCore') ];
package: 'Spec2-Adapters-Morphic-ListView' with: [ spec requires: #('SpecCore' 'Spec2-Adapters-Morphic') ];
package: 'Spec2-Code-Morphic' with: [ spec requires: #('Spec2-Adapters-Morphic') ];
package: 'Spec2-Code-Diff-Morphic' with: [ spec requires: #('Spec2-Adapters-Morphic') ];
package: 'Spec2-Morphic' with: [ spec requires: #('Spec2-Adapters-Morphic') ];
Expand All @@ -31,7 +32,7 @@ BaselineOfSpec2 >> baseline: spec [
package: 'Spec2-Microdown' with: [ spec requires: #('SpecCore' 'Spec2-Adapters-Morphic') ];
package: 'Spec2-Transformations' ].

spec group: 'Core' with: #('SpecCore' 'Spec2-Microdown' 'Spec2-Morphic' 'Spec2-Adapters-Morphic').
spec group: 'Core' with: #('SpecCore' 'Spec2-Microdown' 'Spec2-Morphic' 'Spec2-Adapters-Morphic' 'Spec2-Adapters-Morphic-ListView').
spec group: 'Code' with: #('Core' 'SpecCoreCode' 'Spec2-Code-Morphic' 'Spec2-Code-Diff-Morphic').
spec group: 'CodeTests' with: #('Code' 'Spec2-Code-Backend-Tests').
spec group: 'Support' with: #('Core' 'Spec2-Morphic-Examples').
Expand Down
8 changes: 6 additions & 2 deletions src/BaselineOfSpecCore/BaselineOfSpecCore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ BaselineOfSpecCore >> baseline: spec [
package: 'Spec2-Transmission' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Interactions' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2' with: [ spec requires: #('Spec2-Core' 'Spec2-Interactions') ];
"ListView"
package: 'Spec2-ListView' with: [ spec requires: #('Spec2-Core') ];
"Code"
package: 'Spec2-Code' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
package: 'Spec2-Code-Commands' with: [ spec requires: #('Spec2-Core' 'Spec2-Commands') ];
Expand All @@ -34,6 +36,7 @@ BaselineOfSpecCore >> baseline: spec [
package: 'Spec2-Adapters-Stub' with: [ spec requires: #('Spec2-Core') ];
package: 'Spec2-Commander2-Tests' with: [ spec requires: #('Spec2-Commander2') ];
package: 'Spec2-Tests' with: [ spec requires: #('Spec2-Core' 'Spec2-Examples' 'Spec2-Dialogs-Tests') ];
package: 'Spec2-ListView-Tests' with: [ spec requires: #('Spec2-ListView' 'Spec2-Tests') ];
package: 'Spec2-Code-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code') ];
package: 'Spec2-Code-Diff-Tests' with: [ spec requires: #('Spec2-Tests' 'Spec2-Code-Diff') ];
"Examples"
Expand All @@ -51,13 +54,14 @@ BaselineOfSpecCore >> baseline: spec [
'Spec2-Core'
'Spec2-Dialogs'
'Spec2-CommandLine'
'Spec2-Adapters-Stub'
'Spec2-Adapters-Stub'
'Spec2-ListView'
'Spec2-Interactions'
'Spec2-Commander2' ).
spec group: 'Code' with: #('Core' 'Spec2-Code-Commands' 'Spec2-Code' 'Spec2-Code-Diff').
spec group: 'CodeTests' with: #('Spec2-Code-Tests' 'Spec2-Code-Diff-Tests').
spec group: 'Support' with: #('Core' 'Spec2-Examples').
spec group: 'Tests' with: #('Core' 'Spec2-Tests' 'Spec2-Commander2-Tests').
spec group: 'Tests' with: #('Core' 'Spec2-Tests' 'Spec2-Commander2-Tests' 'Spec2-ListView-Tests').
spec group: 'SupportTests' with: #('Support').
spec group: 'Pillar' with: #('Spec2-Pillar' ).
spec group: 'Base' with: #('Core' 'Support').
Expand Down
35 changes: 20 additions & 15 deletions src/Spec2-Adapters-Morphic-Alexandrie/SpAlexandrieMorph.class.st
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
Class {
#name : #SpAlexandrieMorph,
#superclass : #Morph,
#name : 'SpAlexandrieMorph',
#superclass : 'Morph',
#instVars : [
'surface',
'drawBlock',
'lastExtent'
],
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
#category : 'Spec2-Adapters-Morphic-Alexandrie-Base',
#package : 'Spec2-Adapters-Morphic-Alexandrie',
#tag : 'Base'
}

{ #category : #accessing }
{ #category : 'accessing' }
SpAlexandrieMorph >> drawBlock: aBlock [

drawBlock := aBlock
]

{ #category : #drawing }
{ #category : 'drawing' }
SpAlexandrieMorph >> drawOn: aMorphicCanvas [

self redraw.
self surface
displayOnMorphicCanvas: aMorphicCanvas
at: bounds origin
aMorphicCanvas
image: self surface asForm
at: self position
sourceRect: (0@0 extent: self extent)
rule: 34
]

{ #category : #drawing }
{ #category : 'drawing' }
SpAlexandrieMorph >> redraw [
| context |

self surface drawDuring: [ :canvas |
drawBlock
cull: canvas
cull: (0@0 extent: self extent) ]
context := self surface newContext.
drawBlock
cull: context
cull: (0@0 extent: self extent)
]

{ #category : #accessing }
{ #category : 'accessing' }
SpAlexandrieMorph >> surface [

lastExtent = self extent ifFalse: [ surface := nil ].
^ surface ifNil: [
lastExtent := self extent.
surface := AthensCairoSurface extent: self extent ]
surface := AeCairoImageSurface extent: self extent ]
]
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Class {
#name : #SpMorphicAlexandrieAdapter,
#superclass : #SpAbstractMorphicAdapter,
#category : #'Spec2-Adapters-Morphic-Alexandrie-Base'
#name : 'SpMorphicAlexandrieAdapter',
#superclass : 'SpAbstractMorphicAdapter',
#category : 'Spec2-Adapters-Morphic-Alexandrie-Base',
#package : 'Spec2-Adapters-Morphic-Alexandrie',
#tag : 'Base'
}

{ #category : #factory }
{ #category : 'factory' }
SpMorphicAlexandrieAdapter >> buildWidget [

| instance |
instance := SpAthensMorph new.

instance := SpAlexandrieMorph new.
self presenter whenDrawBlockChangedDo: [ :newBlock |
instance drawBlock: newBlock ].
self presenter whenExtentChangedDo: [ :newExtent |
Expand All @@ -21,13 +23,13 @@ SpMorphicAlexandrieAdapter >> buildWidget [
^ instance
]

{ #category : #drawing }
{ #category : 'drawing' }
SpMorphicAlexandrieAdapter >> redraw [

widget redraw
]

{ #category : #accessing }
{ #category : 'accessing' }
SpMorphicAlexandrieAdapter >> surface [

^ widget surface
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic-Alexandrie/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Spec2-Adapters-Morphic-Alexandrie' }
Package { #name : 'Spec2-Adapters-Morphic-Alexandrie' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"
A morphic adapter for `SpListViewPresenter`
"
Class {
#name : 'SpMorphicListViewAdapter',
#superclass : 'SpMorphicListAdapter',
#category : 'Spec2-Adapters-Morphic-ListView',
#package : 'Spec2-Adapters-Morphic-ListView'
}

{ #category : 'factory' }
SpMorphicListViewAdapter >> buildWidget [
| datasource |

datasource := self newDataSource.
datasource model: self model.
widget := self newTableWith: datasource.

self presenter whenModelChangedDo: [ widget refresh ].
self presenter whenSelectionChangedDo: [ self refreshWidgetSelection ].
self presenter selection whenChangedDo: [ self refreshWidgetSelection ].

self refreshWidgetSelection.
self configureScrolling.

^ widget
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newDataSource [

^ SpMorphicListViewDataSource new
]

{ #category : 'factory' }
SpMorphicListViewAdapter >> newTableWith: datasource [

^ SpFTTableMorph new
beRowNotHomogeneous;
disableFunction;
dataSource: datasource;
hideColumnHeaders;
beResizable;
setMultipleSelection: self model isMultipleSelection;
dragEnabled: self dragEnabled;
dropEnabled: self dropEnabled;
setBalloonText: self help;
hResizing: #spaceFill;
vResizing: #spaceFill;
onAnnouncement: FTSelectionChanged send: #selectionChanged: to: self;
onAnnouncement: FTStrongSelectionChanged send: #strongSelectionChanged: to: self;
yourself
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"
A morphic datasource for `SpListViewPresenter`, to be used on the `SpMorphicListViewAdapter`.
"
Class {
#name : 'SpMorphicListViewDataSource',
#superclass : 'SpMorphicListDataSource',
#instVars : [
'rowHeights'
],
#category : 'Spec2-Adapters-Morphic-ListView',
#package : 'Spec2-Adapters-Morphic-ListView'
}

{ #category : 'accessing' }
SpMorphicListViewDataSource >> cellColumn: column row: rowIndex [
| cell contentPresenter contentMorph |

cell := FTCellMorph new.

contentPresenter := self model setupAction value: self model.
self model bindAction
value: contentPresenter
value: (self elementAt: rowIndex).

contentMorph := contentPresenter build.

"register wor height"
rowHeights at: rowIndex put: contentMorph height.

^ cell addMorphBack: contentMorph
]

{ #category : 'initialization' }
SpMorphicListViewDataSource >> initialize [

super initialize.
rowHeights := Dictionary new
]

{ #category : 'accessing' }
SpMorphicListViewDataSource >> rowHeight: index [

^ rowHeights
at: index
ifAbsent: [ super rowHeight: index ]
]
1 change: 1 addition & 0 deletions src/Spec2-Adapters-Morphic-ListView/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'Spec2-Adapters-Morphic-ListView' }
Original file line number Diff line number Diff line change
@@ -1,81 +1,6 @@
Class {
#name : 'SpMorphicScrollableAdapterTest',
#superclass : 'TestCase',
#instVars : [
'scrollable',
'presenter'
],
#category : 'Spec2-Adapters-Morphic-Tests',
#package : 'Spec2-Adapters-Morphic-Tests'
}

{ #category : 'running' }
SpMorphicScrollableAdapterTest >> configureBasicContainer: aNumber [

| boxLayout widgets |
boxLayout := SpBoxLayout newVertical.
widgets := (1 to: aNumber) collect: [ : i |
boxLayout add: (SpButtonPresenter new label: i asString; yourself) ].

presenter := SpPresenter new
layout: (scrollable := SpScrollableLayout new
child:(SpPresenter new
layout: boxLayout;
yourself);
yourself);
yourself.

]

{ #category : 'running' }
SpMorphicScrollableAdapterTest >> tearDown [

presenter delete.
super tearDown.
]

{ #category : 'tests' }
SpMorphicScrollableAdapterTest >> testVScrollToAfterOpen100SubPresenters [

| adapterWidget |

self configureBasicContainer: 100.
presenter open.
scrollable withAdapterDo: [ : a | a widget height: 270 ].

self assert: presenter isDisplayed.
self assert: presenter isVisible.

scrollable scrollTo: 0.1 @ 2.
adapterWidget := scrollable adapter widget.
self assert: adapterWidget vScrollbarValue closeTo: 0.74074074074074.

scrollable scrollTo: 0.5 @ 2.
adapterWidget := scrollable adapter widget.
self assert: adapterWidget vScrollbarValue closeTo: 0.74074074074074
]

{ #category : 'tests' }
SpMorphicScrollableAdapterTest >> testVScrollToAfterOpen500SubPresenters [

| adapterWidget |

self configureBasicContainer: 500.
presenter open.
scrollable withAdapterDo: [ : a | a widget height: 270 ].
scrollable scrollTo: 0.1 @ 2.
adapterWidget := scrollable adapter widget.
self assert: adapterWidget vScrollbarValue closeTo: 0.74074074074074
]

{ #category : 'tests' }
SpMorphicScrollableAdapterTest >> testVScrollToBeforeOpen100SubPresenters [

| adapterWidget |

self configureBasicContainer: 100.
scrollable scrollTo: 0.1 @ 2.
presenter open.
adapterWidget := scrollable adapter widget.
self assert: adapterWidget vScrollbarValue closeTo: 0.0
]
Loading
Loading