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

Revert "Extend SpDiffPresenter to make it navigable accross differences" #1456

Merged
merged 1 commit into from
Sep 19, 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
14 changes: 0 additions & 14 deletions src/Spec2-Adapters-Morphic/SpMorphicDiffAdapter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ Class {
#category : #'Spec2-Adapters-Morphic-Base'
}

{ #category : #'widget API' }
SpMorphicDiffAdapter >> beNavigable [

^ self model beNavigable
]

{ #category : #'spec protocol' }
SpMorphicDiffAdapter >> beNavigable: aBoolean [

self widgetDo: [ :w | w beNavigable: aBoolean ]
]

{ #category : #'widget API' }
SpMorphicDiffAdapter >> beWrapped [

Expand All @@ -43,8 +31,6 @@ SpMorphicDiffAdapter >> buildWidget [
vResizing: #spaceFill;
setBalloonText: self help;
showOptions: self showOptions;
beNavigable: self beNavigable;
beWrapped: self beWrapped;
leftLabel: self leftLabel rightLabel: self rightLabel;
showOnlyDestination: self showOnlyDestination;
yourself
Expand Down
68 changes: 11 additions & 57 deletions src/Spec2-Core/SpDiffPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ Class {
'#leftText => ObservableSlot',
'#rightLabel => ObservableSlot',
'#rightText => ObservableSlot',
'#beWrapped => ObservableSlot',
'#beNavigable => ObservableSlot'
'#beWrapped => ObservableSlot'
],
#category : #'Spec2-Core-Widgets'
}
Expand All @@ -32,18 +31,6 @@ SpDiffPresenter class >> adapterName [
^ #DiffAdapter
]

{ #category : #api }
SpDiffPresenter >> beNavigable [

^ beNavigable
]

{ #category : #api }
SpDiffPresenter >> beNavigable: aBoolean [

beNavigable := aBoolean
]

{ #category : #api }
SpDiffPresenter >> beWrapped [

Expand Down Expand Up @@ -73,7 +60,6 @@ SpDiffPresenter >> contextClass: anObject [

{ #category : #initialization }
SpDiffPresenter >> initialize [

super initialize.

leftText := ''.
Expand All @@ -82,48 +68,16 @@ SpDiffPresenter >> initialize [
showOnlyDestination := false.
showOnlySource := false.
beWrapped := true.
beNavigable := false.

self
property: #beWrapped
whenChangedDo: [ :aBoolean |
self changed: #beWrapped: with: { aBoolean } ].
self
property: #beNavigable
whenChangedDo: [ :aBoolean |
self changed: #beNavigable: with: { aBoolean } ].
self
property: #leftText
whenChangedDo: [ :newText |
self changed: #leftText: with: { newText } ].
self
property: #rightText
whenChangedDo: [ :newText |
self changed: #rightText: with: { newText } ].
self
property: #contextClass
whenChangedDo: [ :newClass |
self changed: #contextClass: with: { newClass } ].
self
property: #showOptions
whenChangedDo: [ :aBoolean |
self changed: #showOptions: with: { aBoolean } ].
self
property: #showOnlyDestination
whenChangedDo: [ :aBoolean |
self changed: #showOnlyDestination: with: { aBoolean } ].
self
property: #showOnlySource
whenChangedDo: [ :aBoolean |
self changed: #showOnlySource: with: { aBoolean } ].
self
property: #leftLabel
whenChangedDo: [ :newText |
self changed: #leftLabel: with: { newText } ].
self
property: #rightLabel
whenChangedDo: [ :newText |
self changed: #rightLabel: with: { newText } ]

self property: #beWrapped whenChangedDo: [ :aBoolean | self changed: #beWrapped: with: {aBoolean} ].
self property: #leftText whenChangedDo: [ :newText | self changed: #leftText: with: {newText} ].
self property: #rightText whenChangedDo: [ :newText | self changed: #rightText: with: {newText} ].
self property: #contextClass whenChangedDo: [ :newClass | self changed: #contextClass: with: {newClass} ].
self property: #showOptions whenChangedDo: [ :aBoolean | self changed: #showOptions: with: {aBoolean} ].
self property: #showOnlyDestination whenChangedDo: [ :aBoolean | self changed: #showOnlyDestination: with: {aBoolean} ].
self property: #showOnlySource whenChangedDo: [ :aBoolean | self changed: #showOnlySource: with: {aBoolean} ].
self property: #leftLabel whenChangedDo: [ :newText | self changed: #leftLabel: with: {newText} ].
self property: #rightLabel whenChangedDo: [ :newText | self changed: #rightLabel: with: {newText} ]
]

{ #category : #accessing }
Expand Down
33 changes: 0 additions & 33 deletions src/Spec2-Examples/SpDiffPresenter.extension.st
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
Extension { #name : #SpDiffPresenter }

{ #category : #'*Spec2-Examples' }
SpDiffPresenter class >> exampleNavigableWithOptionsAndLabels [
"
self exampleNavigableWithOptionsAndLabels
"
<sampleInstance>
^ self new
showOptions: true;
beNavigable: true;
leftText: (True >> #and:) sourceCode;
leftLabel: '#and: implementation';
rightText: (True >> #or:) sourceCode;
rightLabel: '#or: implementation';
contextClass: True;
open
]

{ #category : #'*Spec2-Examples' }
SpDiffPresenter class >> exampleWithOptions [
"
Expand All @@ -31,22 +14,6 @@ SpDiffPresenter class >> exampleWithOptions [
open
]

{ #category : #'*Spec2-Examples' }
SpDiffPresenter class >> exampleWithOptionsAndLabels [
"
self exampleWithOptionsAndLabels
"
<sampleInstance>
^ self new
showOptions: true;
leftText: (True >> #and:) sourceCode;
leftLabel: '#and: implementation';
rightText: (True >> #or:) sourceCode;
rightLabel: '#or: implementation';
contextClass: True;
open
]

{ #category : #'*Spec2-Examples' }
SpDiffPresenter class >> exampleWithoutOptions [
"
Expand Down
Loading