Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Backend-independant interactions.
Remove widgets as they are already present in Spec.
  • Loading branch information
demarey committed Jun 14, 2024
1 parent eac293f commit d2e34e3
Show file tree
Hide file tree
Showing 18 changed files with 170 additions and 1,150 deletions.
6 changes: 4 additions & 2 deletions src/BaselineOfInteractions/BaselineOfInteractions.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ BaselineOfInteractions >> baseline: spec [
<baseline>
spec
package: 'Interactions';
package: 'Interactions-Widgets';
package: 'Interactions-Widgets-Tests'
package: 'Interactions-Widgets'
with: [ spec requires: #( 'Interactions' ) ];
package: 'Interactions-Tests'
with: [ spec requires: #( 'Interactions' 'Interactions-Widgets' ) ]
]
20 changes: 0 additions & 20 deletions src/Interactions-Widgets/ITConfirmationPresenter.class.st

This file was deleted.

66 changes: 0 additions & 66 deletions src/Interactions-Widgets/ITInformationPresenter.class.st

This file was deleted.

181 changes: 0 additions & 181 deletions src/Interactions-Widgets/ITItemsChooserPresenter.class.st

This file was deleted.

12 changes: 12 additions & 0 deletions src/Interactions-Widgets/SpConfirmDialog.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Extension { #name : 'SpConfirmDialog' }

{ #category : '*Interactions-Widgets' }
SpConfirmDialog class >> for: aConfirmation [

^ self new
title: aConfirmation title;
label: aConfirmation message;
acceptLabel: aConfirmation yesLabel;
cancelLabel: aConfirmation noLabel;
yourself
]
6 changes: 6 additions & 0 deletions src/Interactions-Widgets/SpDialogPresenter.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Extension { #name : 'SpDialogPresenter' }

{ #category : '*Interactions-Widgets' }
SpDialogPresenter >> doInteraction [
^ self openDialog
]
10 changes: 10 additions & 0 deletions src/Interactions-Widgets/SpInformDialog.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Extension { #name : 'SpInformDialog' }

{ #category : '*Interactions-Widgets' }
SpInformDialog class >> for: anITInformation [

^ self new
title: anITInformation title;
label: anITInformation message;
yourself
]
54 changes: 54 additions & 0 deletions src/Interactions-Widgets/SpecInteraction.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"
I am the entity in charge of receiving User interactions and convert them to Spec widgets.
I use double dispatch on User interactions entity.
"
Class {
#name : 'SpecInteraction',
#superclass : 'Object',
#classInstVars : [
'default'
],
#category : 'Interactions-Widgets',
#package : 'Interactions-Widgets'
}

{ #category : 'accessing' }
SpecInteraction class >> default [

^ default ifNil:[ default := self new ]
]

{ #category : 'querying' }
SpecInteraction >> for: aUserInteraction [

^ aUserInteraction widgetFor: self
]

{ #category : 'accessing' }
SpecInteraction >> widgetForConfirmation: aConfirmation [

^ SpConfirmDialog for: aConfirmation
]

{ #category : 'accessing' }
SpecInteraction >> widgetForFileRequest: aFileRequest [

| widget widgetClass |
widgetClass := aFileRequest isForFileOpening
ifTrue: [ StOpenFilePresenter ]
ifFalse: [ StOpenDirectoryPresenter ].
widget := widgetClass for: aFileRequest.

aFileRequest currentFolder ifNotNil: [ :folder | widget openFolder: folder ].
aFileRequest filter ifNotNil: [ :filter |
widget fileNavigationSystem filter:
(StCustomExtensionsFilter extensions: { filter }) ].

^ widget
]

{ #category : 'accessing' }
SpecInteraction >> widgetForInformation: anITInformation [

^ SpInformDialog for: anITInformation
]
11 changes: 0 additions & 11 deletions src/Interactions-Widgets/SpecUIManager.class.st

This file was deleted.

7 changes: 7 additions & 0 deletions src/Interactions-Widgets/StFileSystemPresenter.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'StFileSystemPresenter' }

{ #category : '*Interactions-Widgets' }
StFileSystemPresenter >> doInteraction [

^ self open
]
Loading

0 comments on commit d2e34e3

Please sign in to comment.