Skip to content

Commit

Permalink
move to Tonel v3
Browse files Browse the repository at this point in the history
  • Loading branch information
demarey committed Jun 5, 2024
1 parent d263018 commit eac293f
Show file tree
Hide file tree
Showing 21 changed files with 273 additions and 256 deletions.
9 changes: 5 additions & 4 deletions src/BaselineOfInteractions/BaselineOfInteractions.class.st
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Class {
#name : #BaselineOfInteractions,
#superclass : #BaselineOf,
#category : #BaselineOfInteractions
#name : 'BaselineOfInteractions',
#superclass : 'BaselineOf',
#category : 'BaselineOfInteractions',
#package : 'BaselineOfInteractions'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfInteractions >> baseline: spec [

<baseline>
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfInteractions/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfInteractions }
Package { #name : 'BaselineOfInteractions' }
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
Class {
#name : #ITConfirmationPresenterTest,
#superclass : #TestCase,
#name : 'ITConfirmationPresenterTest',
#superclass : 'TestCase',
#instVars : [
'presenter',
'window'
],
#category : #'Interactions-Widgets-Tests'
#category : 'Interactions-Widgets-Tests',
#package : 'Interactions-Widgets-Tests'
}

{ #category : #running }
{ #category : 'running' }
ITConfirmationPresenterTest >> setUp [
presenter := ITConfirmationPresenter on: ITConfirmation example
]

{ #category : #running }
{ #category : 'running' }
ITConfirmationPresenterTest >> tearDown [
window close
]

{ #category : #tests }
{ #category : 'tests' }
ITConfirmationPresenterTest >> testDialogHasThreeButtons [
"yes no cancel"
window := presenter openDialogWithSpec.
Expand All @@ -28,7 +29,7 @@ ITConfirmationPresenterTest >> testDialogHasThreeButtons [
equals: 3.
]

{ #category : #tests }
{ #category : 'tests' }
ITConfirmationPresenterTest >> testGetFalseWhenClickingOnFalseButton [
| answer |
window := presenter openDialogWithSpec.
Expand All @@ -39,15 +40,15 @@ ITConfirmationPresenterTest >> testGetFalseWhenClickingOnFalseButton [
equals: false
]

{ #category : #tests }
{ #category : 'tests' }
ITConfirmationPresenterTest >> testGetInteractionCancelledExceptionWhenClickingOnCancelButton [
window := presenter openDialogWithSpec.
self
should: [ window triggerCancelAction ]
raise: SpInteractionCancelled.
]

{ #category : #tests }
{ #category : 'tests' }
ITConfirmationPresenterTest >> testGetTrueWhenClickingOnTrueButton [
| answer |
window := presenter openDialogWithSpec.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
Class {
#name : #ITInformationPresenterTest,
#superclass : #TestCase,
#name : 'ITInformationPresenterTest',
#superclass : 'TestCase',
#instVars : [
'presenter',
'window',
'information'
],
#category : #'Interactions-Widgets-Tests'
#category : 'Interactions-Widgets-Tests',
#package : 'Interactions-Widgets-Tests'
}

{ #category : #running }
{ #category : 'running' }
ITInformationPresenterTest >> setUp [
information := ITInformation example.
presenter := ITInformationPresenter on: information.
]

{ #category : #running }
{ #category : 'running' }
ITInformationPresenterTest >> tearDown [
window close
]

{ #category : #tests }
{ #category : 'tests' }
ITInformationPresenterTest >> testDialogHasOnlyOkButton [
window := presenter openDialogWithSpec.

Expand All @@ -32,7 +33,7 @@ ITInformationPresenterTest >> testDialogHasOnlyOkButton [
equals: 'Ok'.
]

{ #category : #tests }
{ #category : 'tests' }
ITInformationPresenterTest >> testInformationMessageIsSet [
window := presenter openDialogWithSpec.

Expand All @@ -41,7 +42,7 @@ ITInformationPresenterTest >> testInformationMessageIsSet [
equals: information message
]

{ #category : #tests }
{ #category : 'tests' }
ITInformationPresenterTest >> testInformationTitleIsSet [
window := presenter openDialogWithSpec.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
An ITCollectionChooserTest is a test class for testing the behavior of ITCollectionChooser
"
Class {
#name : #ITItemChooserPresenterTest,
#superclass : #TestCase,
#name : 'ITItemChooserPresenterTest',
#superclass : 'TestCase',
#instVars : [
'presenter',
'window'
],
#category : #'Interactions-Widgets-Tests'
#category : 'Interactions-Widgets-Tests',
#package : 'Interactions-Widgets-Tests'
}

{ #category : #running }
{ #category : 'running' }
ITItemChooserPresenterTest >> setUp [
presenter := ITItemsChooserPresenter new
]

{ #category : #tests }
{ #category : 'tests' }
ITItemChooserPresenterTest >> testItemSelectedWhenSelectItemAndTriggerOkButton [
presenter model: #(1 2 3 4 5 6).
presenter tablePresenter selectIndex: 2.
Expand All @@ -27,19 +28,19 @@ ITItemChooserPresenterTest >> testItemSelectedWhenSelectItemAndTriggerOkButton [
self assert: presenter selectedItem equals: 2.
]

{ #category : #tests }
{ #category : 'tests' }
ITItemChooserPresenterTest >> testPresenterIsCancelledWhenOkActionTriggerred [
presenter openDialogWithSpec triggerCancelAction.
self assert: presenter isCancelled
]

{ #category : #tests }
{ #category : 'tests' }
ITItemChooserPresenterTest >> testPresenterIsNotCancelledWhenOkActionTriggerred [
presenter openDialogWithSpec triggerOkAction.
self deny: presenter isCancelled
]

{ #category : #tests }
{ #category : 'tests' }
ITItemChooserPresenterTest >> testSelectionIsNilWhenSelectItemAndTriggerCancelButton [
presenter model: #(1 2 3 4 5 6).
presenter tablePresenter selectIndex: 2.
Expand Down
2 changes: 1 addition & 1 deletion src/Interactions-Widgets-Tests/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'Interactions-Widgets-Tests' }
Package { #name : 'Interactions-Widgets-Tests' }
11 changes: 6 additions & 5 deletions src/Interactions-Widgets/ITConfirmationPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ I ask the user a confirmation of its intent.
I open myself in a dialog box.
"
Class {
#name : #ITConfirmationPresenter,
#superclass : #ITInformationPresenter,
#category : #'Interactions-Widgets'
#name : 'ITConfirmationPresenter',
#superclass : 'ITInformationPresenter',
#category : 'Interactions-Widgets',
#package : 'Interactions-Widgets'
}

{ #category : #example }
{ #category : 'example' }
ITConfirmationPresenter class >> example [
(self on: ITConfirmation example) openDialogWithSpec
]

{ #category : #private }
{ #category : 'private' }
ITConfirmationPresenter >> icon [
^ (self iconNamed: #question) magnifyBy: 2
]
21 changes: 11 additions & 10 deletions src/Interactions-Widgets/ITInformationPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,30 @@ I notify the user of different kind of information: alert, abort, accessDenied.
I open myself in a dialog box.
"
Class {
#name : #ITInformationPresenter,
#superclass : #SpPresenterWithModel,
#name : 'ITInformationPresenter',
#superclass : 'SpPresenterWithModel',
#instVars : [
'iconPresenter',
'messageText'
],
#category : #'Interactions-Widgets'
#category : 'Interactions-Widgets',
#package : 'Interactions-Widgets'
}

{ #category : #specs }
{ #category : 'specs' }
ITInformationPresenter class >> defaultSpec [
^ SpBoxLayout newHorizontal
add: #iconPresenter width: 150;
add: #messageText;
yourself
]

{ #category : #example }
{ #category : 'example' }
ITInformationPresenter class >> example [
(self on: ITInformation example) openDialogWithSpec
]

{ #category : #private }
{ #category : 'private' }
ITInformationPresenter >> icon [
self model type = #abort
ifTrue: [ ^ (self iconNamed: #stop) magnifyBy: 5 ].
Expand All @@ -36,13 +37,13 @@ ITInformationPresenter >> icon [
^ self iconNamed: #blank
]

{ #category : #initialization }
{ #category : 'initialization' }
ITInformationPresenter >> initialExtent [

^ (self currentWorld extent x / 2) @ 200
]

{ #category : #initialization }
{ #category : 'initialization' }
ITInformationPresenter >> initializePresenters [
iconPresenter := self newImage
image: self icon;
Expand All @@ -53,13 +54,13 @@ ITInformationPresenter >> initializePresenters [
yourself.
]

{ #category : #initialization }
{ #category : 'initialization' }
ITInformationPresenter >> initializeWindow: aWindowPresenter [
super initializeWindow: aWindowPresenter.
aWindowPresenter title: self model title
]

{ #category : #private }
{ #category : 'private' }
ITInformationPresenter >> messageText [
^ messageText
]
Loading

0 comments on commit eac293f

Please sign in to comment.