From 747b1291e3eda491e0f4db0498ecd6c9194f7e71 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 19 Sep 2023 14:18:09 +0200 Subject: [PATCH] Revert "Extend SpDiffPresenter to make it navigable accross differences" --- .../SpMorphicDiffAdapter.class.st | 14 ---- src/Spec2-Core/SpDiffPresenter.class.st | 68 +++---------------- .../SpDiffPresenter.extension.st | 33 --------- 3 files changed, 11 insertions(+), 104 deletions(-) diff --git a/src/Spec2-Adapters-Morphic/SpMorphicDiffAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicDiffAdapter.class.st index a4d90d58e..85ca8c263 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicDiffAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicDiffAdapter.class.st @@ -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 [ @@ -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 diff --git a/src/Spec2-Core/SpDiffPresenter.class.st b/src/Spec2-Core/SpDiffPresenter.class.st index 9539c540e..7dec6f79d 100644 --- a/src/Spec2-Core/SpDiffPresenter.class.st +++ b/src/Spec2-Core/SpDiffPresenter.class.st @@ -20,8 +20,7 @@ Class { '#leftText => ObservableSlot', '#rightLabel => ObservableSlot', '#rightText => ObservableSlot', - '#beWrapped => ObservableSlot', - '#beNavigable => ObservableSlot' + '#beWrapped => ObservableSlot' ], #category : #'Spec2-Core-Widgets' } @@ -32,18 +31,6 @@ SpDiffPresenter class >> adapterName [ ^ #DiffAdapter ] -{ #category : #api } -SpDiffPresenter >> beNavigable [ - - ^ beNavigable -] - -{ #category : #api } -SpDiffPresenter >> beNavigable: aBoolean [ - - beNavigable := aBoolean -] - { #category : #api } SpDiffPresenter >> beWrapped [ @@ -73,7 +60,6 @@ SpDiffPresenter >> contextClass: anObject [ { #category : #initialization } SpDiffPresenter >> initialize [ - super initialize. leftText := ''. @@ -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 } diff --git a/src/Spec2-Examples/SpDiffPresenter.extension.st b/src/Spec2-Examples/SpDiffPresenter.extension.st index bd6afe4d5..84a6d4e2d 100644 --- a/src/Spec2-Examples/SpDiffPresenter.extension.st +++ b/src/Spec2-Examples/SpDiffPresenter.extension.st @@ -1,22 +1,5 @@ Extension { #name : #SpDiffPresenter } -{ #category : #'*Spec2-Examples' } -SpDiffPresenter class >> exampleNavigableWithOptionsAndLabels [ - " - self exampleNavigableWithOptionsAndLabels - " - - ^ 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 [ " @@ -31,22 +14,6 @@ SpDiffPresenter class >> exampleWithOptions [ open ] -{ #category : #'*Spec2-Examples' } -SpDiffPresenter class >> exampleWithOptionsAndLabels [ - " - self exampleWithOptionsAndLabels - " - - ^ 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 [ "