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

Resolves calls of SBEditor current by Exploriants #127

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion packages/Sandblocks-Babylonian/SBExploriants.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,12 @@ SBExploriants >> saveTryFixing: aFixBoolean quick: aQuickBoolean [
{ #category : #actions }
SBExploriants >> visualize [

self namedBlocks: SBExploriantsView getTabs activeIndex: 1
"The Views need a parent to visualize themselves. We also want to avoid double-calculations"
| tabs |
tabs := SBExploriantsView getTabs.
tabs do: [:aTab | self addMorph: aTab block. aTab visualize.].
self removeAllMorphs.

self namedBlocks: tabs activeIndex: 1.

]
6 changes: 5 additions & 1 deletion packages/Sandblocks-Babylonian/SBExploriantsView.class.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"
Caution:
The Views need a parent who in in the editor to visualize themselves
"
Class {
#name : #SBExploriantsView,
#superclass : #SBNamedBlock,
Expand Down Expand Up @@ -69,7 +73,7 @@ SBExploriantsView >> findExistingOrConvertToBlocks: aCollectionOfCompiledMethods

^ aCollectionOfCompiledMethods
collect: [:aCompiledMethod |
SBEditor current blockFor: aCompiledMethod withInterfaces: #(#isMethod)
self block sandblockEditor blockFor: aCompiledMethod withInterfaces: #(#isMethod)
ifOpen: [:existingMethodBlock | existingMethodBlock]
ifClosed: [aCompiledMethod asSandblock]]
]
Expand Down
6 changes: 2 additions & 4 deletions packages/Sandblocks-Babylonian/SBResultsView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SBResultsView >> allActiveExamples [
^ (self allCompiledMethodsContainingExamples
collect: [:aCompiledMethod |
"Only examples which are open in the editor can actually be active."
SBEditor current blockFor: aCompiledMethod withInterfaces: #(#isMethod)
self block sandblockEditor blockFor: aCompiledMethod withInterfaces: #(#isMethod)
ifOpen: [:existingMethodBlock | existingMethodBlock containedExamples select: #active]
ifClosed: [#()]]) flatten
]
Expand Down Expand Up @@ -95,9 +95,7 @@ SBResultsView >> initialize [

super initialize.

self name: 'Possible Results'.

self visualize
self name: 'Possible Results'
]

{ #category : #building }
Expand Down
2 changes: 0 additions & 2 deletions packages/Sandblocks-Babylonian/SBVariantsView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ SBVariantsView >> initialize [
super initialize.

self name: 'Variant Manager'.

self visualize
]

{ #category : #actions }
Expand Down
4 changes: 3 additions & 1 deletion packages/Sandblocks-Core/SBEditor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,9 @@ SBEditor >> openAll: aCollection [
SBEditor >> openExploriants [
<globalAction>

self open: SBExploriants uniqueInstance visualize
"Not calling visualize directly as we first want the editor to be an owner of SBExploriants"
self open: SBExploriants uniqueInstance.
SBExploriants uniqueInstance visualize
]

{ #category : #'actions creating' }
Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Core/SBTabView.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ SBTabView >> removeCurrentTab [
{ #category : #tabs }
SBTabView >> setActive: aNamedBlock [

SBEditor current do:
self sandblockEditor do:
(self switchCommandFor: (self namedBlocks indexOf: aNamedBlock ifAbsent: 1))
]

Expand Down
2 changes: 1 addition & 1 deletion packages/Sandblocks-Utils/SBPermutation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ SBPermutation >> apply [

self referencedVariants do: [:aVariant | aVariant switchToAlternative: (self at: aVariant id)].
(Set newFrom: (referencedVariants collect: #containingArtefact thenSelect: #isMethod))
do: [:aMethodBlock | SBEditor current save: aMethodBlock tryFixing: true quick: true].
do: [:aMethodBlock | aMethodBlock sandblockEditor save: aMethodBlock tryFixing: true quick: true].
]

{ #category : #converting }
Expand Down
Loading