diff --git a/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st index 8c5a212b..7858ebba 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicBoxAdapter.class.st @@ -30,12 +30,6 @@ SpMorphicBoxAdapter >> add: aPresenter [ self add: aPresenter constraints: SpBoxConstraints new ] -{ #category : 'adding' } -SpMorphicBoxAdapter >> add: aPresenter constraints: constraints [ - - super add: aPresenter constraints: constraints -] - { #category : 'private' } SpMorphicBoxAdapter >> addConstraints: constraints toChild: childMorph [ "Adds constraits by child" @@ -254,12 +248,12 @@ SpMorphicBoxAdapter >> newWrapMorph [ { #category : 'accessing' } SpMorphicBoxAdapter >> remove: aPresenter [ - | morph | - morph := aPresenter adapter widget. - startPanel removeMorph: morph. - endPanel removeMorph: morph. - self verifyBoxExtent - + aPresenter adapter ifNotNil: [ :adapter | + | morph | + morph := adapter widget. + startPanel removeMorph: morph. + endPanel removeMorph: morph. + self verifyBoxExtent ] ] { #category : 'accessing' } diff --git a/src/Spec2-Adapters-Morphic/SpMorphicFrameLayoutAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicFrameLayoutAdapter.class.st index c246f8bf..8ad84dfa 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicFrameLayoutAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicFrameLayoutAdapter.class.st @@ -24,12 +24,6 @@ SpMorphicFrameLayoutAdapter >> add: aPresenter [ self add: aPresenter constraints: SpBoxConstraints new ] -{ #category : 'adding' } -SpMorphicFrameLayoutAdapter >> add: aPresenter constraints: constraints [ - - super add: aPresenter constraints: constraints -] - { #category : 'factory' } SpMorphicFrameLayoutAdapter >> addConstraints: constraints toChild: childMorph [ @@ -161,11 +155,9 @@ SpMorphicFrameLayoutAdapter >> newPanelWith: aLayout label: aLabel [ { #category : 'accessing' } SpMorphicFrameLayoutAdapter >> remove: aPresenter [ - | morph | - morph := aPresenter adapter widget. - framePanel removeMorph: morph. - self verifyBoxExtent - + aPresenter adapter ifNotNil: [ :adapter | + framePanel removeMorph: adapter widget. + self verifyBoxExtent ] ] { #category : 'accessing' } diff --git a/src/Spec2-Adapters-Morphic/SpMorphicGridAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicGridAdapter.class.st index 0ef812e9..9ba78d3d 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicGridAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicGridAdapter.class.st @@ -113,7 +113,5 @@ SpMorphicGridAdapter >> newPanel [ { #category : 'removing' } SpMorphicGridAdapter >> remove: aPresenter [ - | morph | - morph := aPresenter adapter widget. - widget removeMorph: morph + aPresenter adapter ifNotNil: [ :adapter | widget removeMorph: adapter widget ] ] diff --git a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st index e241020e..9f67bd86 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicMillerAdapter.class.st @@ -203,10 +203,9 @@ SpMorphicMillerAdapter >> recalculatePages [ { #category : 'accessing' } SpMorphicMillerAdapter >> remove: aPresenter [ - | morph | - needRecalculatePages := true. - morph := aPresenter adapter widget. - innerWidget removeMorph: morph + aPresenter adapter ifNotNil: [ :adapter | + needRecalculatePages := true. + innerWidget removeMorph: adapter widget ] ] { #category : 'accessing' } diff --git a/src/Spec2-Adapters-Morphic/SpMorphicTabAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicTabAdapter.class.st index bae58151..ca30abb3 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicTabAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicTabAdapter.class.st @@ -63,6 +63,8 @@ SpMorphicTabAdapter >> layout: aLayout [ { #category : 'removing' } SpMorphicTabAdapter >> remove: aPresenter [ - widget removePage: (widget pages - detect: [ :each | each actualPageMorph = aPresenter adapter widget ]) + aPresenter adapter ifNotNil: [ :adapter | + | morph | + morph := adapter widget. + widget removePage: (widget pages detect: [ :each | each actualPageMorph = morph ]) ] ]