Skip to content

Commit

Permalink
Merge pull request #1456 from pharo-spec/revert-1305-navigable-diff
Browse files Browse the repository at this point in the history
Revert "Extend SpDiffPresenter to make it navigable accross differences"
  • Loading branch information
jecisc authored Sep 19, 2023
2 parents c9cbc42 + 747b129 commit 96be3d9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 104 deletions.
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

0 comments on commit 96be3d9

Please sign in to comment.