diff --git a/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st b/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st index ae264011f..e7a55617f 100644 --- a/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st +++ b/src/Spec2-Adapters-Morphic/SpMorphicTreeTableAdapter.class.st @@ -113,6 +113,11 @@ SpMorphicTreeTableAdapter >> addModelTo: tableMorph [ to: self ] +{ #category : 'drawing' } +SpMorphicTreeTableAdapter >> alternateRowsColor [ + self widgetDo: [ :w | w alternateRowsColor: true ] +] + { #category : 'factory' } SpMorphicTreeTableAdapter >> basicSelectionChanged: ann [ | selection | diff --git a/src/Spec2-Core/KMCategory.extension.st b/src/Spec2-Core/KMCategory.extension.st index 7d6280c47..6151ada1d 100644 --- a/src/Spec2-Core/KMCategory.extension.st +++ b/src/Spec2-Core/KMCategory.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #KMCategory } +Extension { #name : 'KMCategory' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } KMCategory >> , aKMCategory [ | newCategory | diff --git a/src/Spec2-Core/MacOSPlatform.extension.st b/src/Spec2-Core/MacOSPlatform.extension.st index 6e4888ba9..97138235f 100644 --- a/src/Spec2-Core/MacOSPlatform.extension.st +++ b/src/Spec2-Core/MacOSPlatform.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #MacOSPlatform } +Extension { #name : 'MacOSPlatform' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } MacOSPlatform >> configureApplication: anApplication configuration: aConfiguration [ aConfiguration configureOSX: anApplication diff --git a/src/Spec2-Core/ManifestSpec2Core.class.st b/src/Spec2-Core/ManifestSpec2Core.class.st index e73e81dcb..0de425855 100644 --- a/src/Spec2-Core/ManifestSpec2Core.class.st +++ b/src/Spec2-Core/ManifestSpec2Core.class.st @@ -6,42 +6,44 @@ Spec is a framework in Pharo for describing user interfaces. It allows for the c I contain the core of Spec 2. By core I mean all the code defining the basics of Spec and the basic widgets users should use to build their applications. " Class { - #name : #ManifestSpec2Core, - #superclass : #PackageManifest, - #category : #'Spec2-Core-Manifest' + #name : 'ManifestSpec2Core', + #superclass : 'PackageManifest', + #category : 'Spec2-Core-Manifest', + #package : 'Spec2-Core', + #tag : 'Manifest' } -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleExcessiveMethodsRuleV1FalsePositive [ ^ #(#(#(#RGClassDefinition #(#SpPresenter)) #'2016-07-01T15:56:13.465539+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleExcessiveVariablesRuleV1FalsePositive [ ^ #(#(#(#RGClassDefinition #(#SpPresenter)) #'2016-07-01T15:56:13.372336+02:00') #(#(#RGClassDefinition #(#SpAbstractWidgetPresenter)) #'2016-07-01T15:56:13.372528+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleGTExampleNotDefinedRuleV1FalsePositive [ ^ #(#(#(#RGClassDefinition #(#SpPresenter)) #'2016-07-01T15:56:13.363445+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleImplementedNotSentRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#'TreePresenter class' #exampleWithNoSpecifiedNodes #true)) #'2016-07-01T15:56:13.496495+02:00') #(#(#RGMethodDefinition #(#'DiffPresenter class' #exampleWithoutOptions #true)) #'2016-07-01T15:56:13.496444+02:00') #(#(#RGMethodDefinition #(#'DiffPresenter class' #exampleWithOptions #true)) #'2016-07-01T15:56:13.496455+02:00') #(#(#RGMethodDefinition #(#'TreePresenter class' #exampleWithCustomColumnsAndNodesAndChildren #true)) #'2016-07-01T15:56:13.496426+02:00') #(#(#RGMethodDefinition #(#'TreePresenter class' #exampleOfAutoRefreshOnExpand #true)) #'2016-07-01T15:56:13.496465+02:00') #(#(#RGMethodDefinition #(#'TreePresenter class' #exampleWithCustomColumnsAndNodes #true)) #'2016-07-01T15:56:13.496478+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleLongMethodsRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpAbstractWidgetPresenter #initialize #false)) #'2016-07-01T15:56:13.356024+02:00') #(#(#RGMethodDefinition #(#SpPresenter #initialize #false)) #'2016-07-01T15:56:13.355982+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleRBOverridesDeprecatedMethodRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#SpMenuItemPresenter #name #false)) #'2016-07-01T15:56:13.378417+02:00') ) ] -{ #category : #'code-critics' } +{ #category : 'code-critics' } ManifestSpec2Core class >> ruleUsesTrueRuleV1FalsePositive [ ^ #(#(#(#RGMethodDefinition #(#'DiffPresenter class' #exampleWithOptions #true)) #'2016-07-01T15:56:13.475288+02:00') ) ] diff --git a/src/Spec2-Core/Model.extension.st b/src/Spec2-Core/Model.extension.st index 8fa880578..ae242ce8d 100644 --- a/src/Spec2-Core/Model.extension.st +++ b/src/Spec2-Core/Model.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #Model } +Extension { #name : 'Model' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } Model >> isSpAnnouncingObject [ ^ true diff --git a/src/Spec2-Core/OSPlatform.extension.st b/src/Spec2-Core/OSPlatform.extension.st index ca72c4e05..e21bf098a 100644 --- a/src/Spec2-Core/OSPlatform.extension.st +++ b/src/Spec2-Core/OSPlatform.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #OSPlatform } +Extension { #name : 'OSPlatform' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } OSPlatform >> configureApplication: anApplication configuration: aConfiguration [ ] diff --git a/src/Spec2-Core/Object.extension.st b/src/Spec2-Core/Object.extension.st index b65c5e135..e489d50e4 100644 --- a/src/Spec2-Core/Object.extension.st +++ b/src/Spec2-Core/Object.extension.st @@ -1,24 +1,24 @@ -Extension { #name : #Object } +Extension { #name : 'Object' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } Object >> asPresenter [ ^ self asString asPresenter ] -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } Object >> isPresenter [ ^ false ] -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } Object >> isSpAnnouncingObject [ ^ false ] -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } Object >> isSpLayout [ ^ false diff --git a/src/Spec2-Core/ObservableValueHolder.extension.st b/src/Spec2-Core/ObservableValueHolder.extension.st index 75a33997c..21e5b8930 100644 --- a/src/Spec2-Core/ObservableValueHolder.extension.st +++ b/src/Spec2-Core/ObservableValueHolder.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #ObservableValueHolder } +Extension { #name : 'ObservableValueHolder' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } ObservableValueHolder >> unsubscribe: anObject [ subscriptions := subscriptions reject: [ :each | each receiver = anObject ]. diff --git a/src/Spec2-Core/OrderedDictionary.extension.st b/src/Spec2-Core/OrderedDictionary.extension.st index 78f5c8bce..9b1ddec71 100644 --- a/src/Spec2-Core/OrderedDictionary.extension.st +++ b/src/Spec2-Core/OrderedDictionary.extension.st @@ -1,6 +1,6 @@ -Extension { #name : #OrderedDictionary } +Extension { #name : 'OrderedDictionary' } -{ #category : #'*Spec2-Core' } +{ #category : '*Spec2-Core' } OrderedDictionary >> replaceKey: aKey with: otherKey [ | value index | diff --git a/src/Spec2-Core/SpAbstractAdapter.class.st b/src/Spec2-Core/SpAbstractAdapter.class.st index dfbb4476a..3fa4afcca 100644 --- a/src/Spec2-Core/SpAbstractAdapter.class.st +++ b/src/Spec2-Core/SpAbstractAdapter.class.st @@ -10,8 +10,8 @@ In the future my instances should just be responsible to create a widget and ins I'm only interesting for back-ends developers. As a developer, using Spec to define application, you should not care and have to deal with me. " Class { - #name : #SpAbstractAdapter, - #superclass : #Model, + #name : 'SpAbstractAdapter', + #superclass : 'Model', #instVars : [ 'model', 'widget', @@ -19,10 +19,12 @@ Class { 'owner', 'unsubscribed' ], - #category : #'Spec2-Core-Base' + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpAbstractAdapter class >> adapt: aPresenter [ ^ self new @@ -30,39 +32,39 @@ SpAbstractAdapter class >> adapt: aPresenter [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter class >> adaptingAliases [ "Answers an array of aliases my class can adapt." ^ #() ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter class >> adaptingName [ "Answers the name this component adapts." ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter class >> allAdapters [ "The abstract adapters should be able to return all the adapters for a framework" ^ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractAdapter class >> isAbstract [ ^ self == SpAbstractAdapter ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter class >> owner: anOwner [ ^ self new owner: anOwner; yourself ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractAdapter >> adapt: aPresenter [ unsubscribed := false. @@ -76,18 +78,18 @@ SpAbstractAdapter >> adapt: aPresenter [ widget := self buildWidget ] -{ #category : #factory } +{ #category : 'factory' } SpAbstractAdapter >> adapterWasBuilt [ "hook to add after-build opeations (for example, initial status, etc.)" ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> add: aWidget [ self subclassResponsibility ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractAdapter >> addEventsTo: aWidget [ aWidget ifNil: [ ^ self ]. @@ -97,114 +99,114 @@ SpAbstractAdapter >> addEventsTo: aWidget [ target: (self eventHandlerReceiver: aWidget) ] -{ #category : #factory } +{ #category : 'factory' } SpAbstractAdapter >> buildWidget [ ^ self subclassResponsibility ] -{ #category : #private } +{ #category : 'private' } SpAbstractAdapter >> eventHandlerReceiver: aWidget [ ^ aWidget ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> hRigid [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> hShrinkWrap [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> hSpaceFill [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractAdapter >> hasWidget: aMorphicButtonAdapter [ ^ self widget hasWidget: aMorphicButtonAdapter widget ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> isRedrawable [ "This must be overriden in the adapter representing your container" ^ false ] -{ #category : #visibility } +{ #category : 'visibility' } SpAbstractAdapter >> isVisible [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> layout: aLayout [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> model [ ^ model ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> owner [ "Every object instantiated by the SpecInerpreter should have an owner that will assign it to a particular presenter" ^ owner ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> owner: anObject [ owner := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> presenter [ ^ model ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> removeSubWidgets [ self subclassResponsibility ] -{ #category : #private } +{ #category : 'private' } SpAbstractAdapter >> replaceLayoutWith: aLayout [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> selector [ ^ selector ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> selector: anObject [ selector := anObject ] -{ #category : #emulating } +{ #category : 'emulating' } SpAbstractAdapter >> sendRightClickEvent [ self subclassResponsibility ] -{ #category : #releasing } +{ #category : 'releasing' } SpAbstractAdapter >> unsubscribe [ "During initialization, adapters usually subscribe to various observable slots in the presenter. When the adapters are replaced by another during dynamic layouts switching, they need to be unsubscribed because it may cause a memory leaks and, in case of Gtk, even VM crashes. @@ -215,54 +217,54 @@ SpAbstractAdapter >> unsubscribe [ unsubscribed := true ] -{ #category : #updating } +{ #category : 'updating' } SpAbstractAdapter >> update: aSymbol [ self changed: aSymbol ] -{ #category : #updating } +{ #category : 'updating' } SpAbstractAdapter >> update: aSymbol with: anArray [ self perform: aSymbol withArguments: anArray ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> useProportionalLayout [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> vRigid [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> vShrinkWrap [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> vSpaceFill [ self subclassResponsibility ] -{ #category : #protocol } +{ #category : 'protocol' } SpAbstractAdapter >> when: anAnnouncement do: aBlock [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractAdapter >> widget [ ^ widget ] -{ #category : #private } +{ #category : 'private' } SpAbstractAdapter >> widgetDo: aBlock [ ^ self widget ifNotNil: aBlock diff --git a/src/Spec2-Core/SpAbstractButtonPresenter.class.st b/src/Spec2-Core/SpAbstractButtonPresenter.class.st index e733a580e..3fadbf3f1 100644 --- a/src/Spec2-Core/SpAbstractButtonPresenter.class.st +++ b/src/Spec2-Core/SpAbstractButtonPresenter.class.st @@ -2,29 +2,31 @@ A base for button presenters, it defines basic functionality common to all buttons. " Class { - #name : #SpAbstractButtonPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAbstractButtonPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#icon => ObservableSlot', '#label => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractButtonPresenter class >> isAbstract [ ^ super isAbstract or: [ self = SpAbstractButtonPresenter ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractButtonPresenter >> icon [ "Answer the icon (an instance of `Form`) defined for this button (it can be nil)" ^ icon ] -{ #category : #api } +{ #category : 'api' } SpAbstractButtonPresenter >> icon: anIcon [ "Sets the icon to be displayed by the button. The icon must be a `Form`" @@ -32,13 +34,13 @@ SpAbstractButtonPresenter >> icon: anIcon [ icon := anIcon ] -{ #category : #api } +{ #category : 'api' } SpAbstractButtonPresenter >> iconName: aSymbol [ self icon: (self iconNamed: aSymbol) ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractButtonPresenter >> initialize [ super initialize. @@ -50,21 +52,21 @@ SpAbstractButtonPresenter >> initialize [ ] -{ #category : #api } +{ #category : 'api' } SpAbstractButtonPresenter >> label [ "Answer the label to be shown by the button" ^ label ] -{ #category : #api } +{ #category : 'api' } SpAbstractButtonPresenter >> label: aString [ "Set the label to be shown by the button." label := aString ] -{ #category : #localization } +{ #category : 'localization' } SpAbstractButtonPresenter >> localeChanged [ super localeChanged. @@ -72,13 +74,13 @@ SpAbstractButtonPresenter >> localeChanged [ ] -{ #category : #private } +{ #category : 'private' } SpAbstractButtonPresenter >> shortcutCharacter [ ^ nil ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractButtonPresenter >> whenIconChangedDo: aBlock [ "Inform when icon property has changed. `aBlock` has three optional arguments: @@ -89,7 +91,7 @@ SpAbstractButtonPresenter >> whenIconChangedDo: aBlock [ self property: #icon whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractButtonPresenter >> whenLabelChangedDo: aBlock [ "Inform when label property has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpAbstractFormButtonPresenter.class.st b/src/Spec2-Core/SpAbstractFormButtonPresenter.class.st index de14abea3..d9fdf2135 100644 --- a/src/Spec2-Core/SpAbstractFormButtonPresenter.class.st +++ b/src/Spec2-Core/SpAbstractFormButtonPresenter.class.st @@ -3,22 +3,24 @@ A base for _form control buttons_ (like radiobuttons or checkboxes). " Class { - #name : #SpAbstractFormButtonPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAbstractFormButtonPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#state => ObservableSlot', '#label => ObservableSlot', '#labelClickable => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractFormButtonPresenter class >> isAbstract [ ^ self = SpAbstractFormButtonPresenter ] -{ #category : #simulating } +{ #category : 'simulating' } SpAbstractFormButtonPresenter >> click [ "Simulate a click on the checkbox Used when the checkbox is a list item" @@ -26,7 +28,7 @@ SpAbstractFormButtonPresenter >> click [ self toggleState ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> enabled: aBoolean [ "Set if the button is enabled." @@ -35,7 +37,7 @@ SpAbstractFormButtonPresenter >> enabled: aBoolean [ ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractFormButtonPresenter >> initialize [ super initialize. @@ -46,35 +48,35 @@ SpAbstractFormButtonPresenter >> initialize [ self whenLabelClickableChangedDo: [ :aBoolean | self changed: {#labelClickable: . aBoolean} ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> label [ "Answers the label to be shown by the button" ^ label ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> label: aString [ "Sets the label to be shown by the button." label := aString ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> labelClickable [ "Answer if the label can be clicked to select the control button" ^ labelClickable ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> labelClickable: aBoolean [ "Set if the label can be clicked to select the control button" labelClickable := aBoolean ] -{ #category : #localization } +{ #category : 'localization' } SpAbstractFormButtonPresenter >> localeChanged [ super localeChanged. @@ -82,14 +84,14 @@ SpAbstractFormButtonPresenter >> localeChanged [ ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> state [ "Answer the current state of the control button" ^ state ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> state: aBoolean [ "Set the state of the control button." @@ -99,14 +101,14 @@ SpAbstractFormButtonPresenter >> state: aBoolean [ state := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpAbstractFormButtonPresenter >> toggleState [ "Toogle the current state of the control button" self state: self state not ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractFormButtonPresenter >> whenActivatedDo: aBlock [ "Informs when the control button has been activated (see `SpAbstractFormButtonPresenter>>#state:`. `aBlock` receives zero arguments." @@ -114,7 +116,7 @@ SpAbstractFormButtonPresenter >> whenActivatedDo: aBlock [ self whenChangedDo: [ :aBoolean | aBoolean ifTrue: aBlock ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractFormButtonPresenter >> whenChangedDo: aBlock [ "Informs when the control button state has been changed (see `SpAbstractFormButtonPresenter>>#state:`. `aBlock` receives one argument: @@ -123,7 +125,7 @@ SpAbstractFormButtonPresenter >> whenChangedDo: aBlock [ self property: #state whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractFormButtonPresenter >> whenDeactivatedDo: aBlock [ "Informs when the control button has been deactivated (see `SpAbstractFormButtonPresenter>>#state:`. `aBlock` receives zero arguments." @@ -131,7 +133,7 @@ SpAbstractFormButtonPresenter >> whenDeactivatedDo: aBlock [ self whenChangedDo: [ :aBoolean | aBoolean ifFalse: aBlock ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractFormButtonPresenter >> whenLabelChangedDo: aBlock [ "Informs when the control button label been changed (see `SpAbstractFormButtonPresenter>>#label:`. `aBlock` receives zero arguments." @@ -139,7 +141,7 @@ SpAbstractFormButtonPresenter >> whenLabelChangedDo: aBlock [ self property: #label whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractFormButtonPresenter >> whenLabelClickableChangedDo: aBlock [ "Informs when the control button label clickable state has been changed (see `SpAbstractFormButtonPresenter>>#labelClickable:`. `aBlock` receives zero arguments." diff --git a/src/Spec2-Core/SpAbstractListPresenter.class.st b/src/Spec2-Core/SpAbstractListPresenter.class.st index 6d9858155..e8cf1984e 100644 --- a/src/Spec2-Core/SpAbstractListPresenter.class.st +++ b/src/Spec2-Core/SpAbstractListPresenter.class.st @@ -2,8 +2,8 @@ A base for list presenters, it defines basic functionality common to all lists. " Class { - #name : #SpAbstractListPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAbstractListPresenter', + #superclass : 'SpAbstractWidgetPresenter', #traits : 'SpTHaveWrappingScrollBars + SpTContextMenu + SpTAlignableColumn', #classTraits : 'SpTHaveWrappingScrollBars classTrait + SpTContextMenu classTrait + SpTAlignableColumn classTrait', #instVars : [ @@ -14,10 +14,12 @@ Class { '#itemFilter => ObservableSlot', '#verticalAlignment' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractListPresenter class >> documentSections [ ^ OrderedDictionary newFromPairs: { @@ -33,13 +35,13 @@ SpAbstractListPresenter class >> documentSections [ (self methods select: [ :method | method protocolName = #'api - events' ]) } ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter class >> isAbstract [ ^ super isAbstract or: [ self = SpAbstractListPresenter ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> activateOnDoubleClick [ "Configure the list to trigger activation on double click. An element on a list can be 'activated', meaning it will trigger an event to execute an @@ -50,7 +52,7 @@ SpAbstractListPresenter >> activateOnDoubleClick [ activateOnSingleClick := false ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> activateOnSingleClick [ "Configure the list to trigger activation on single click. An element on a list can be 'activated', meaning it will trigger an event to execute an @@ -61,7 +63,7 @@ SpAbstractListPresenter >> activateOnSingleClick [ activateOnSingleClick := true ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter >> activatesOnDoubleClick [ "Answer true if activation event is triggered on double click" @@ -72,7 +74,7 @@ SpAbstractListPresenter >> activatesOnDoubleClick [ ^ activateOnSingleClick not ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter >> activatesOnSingleClick [ "Answer true if activation event is triggered on single click" @@ -83,21 +85,21 @@ SpAbstractListPresenter >> activatesOnSingleClick [ ^ activateOnSingleClick ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> beMultipleSelection [ "Enable multiple selection." self selectionMode: (SpMultipleSelectionMode on: self) ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> beSingleSelection [ "Enable single selection (this is the default)." self selectionMode: (SpSingleSelectionMode on: self) ] -{ #category : #simulation } +{ #category : 'simulation' } SpAbstractListPresenter >> clickAtIndex: anIndex [ self selectIndex: anIndex. @@ -106,13 +108,13 @@ SpAbstractListPresenter >> clickAtIndex: anIndex [ self doActivateAtIndex: anIndex ] -{ #category : #simulation } +{ #category : 'simulation' } SpAbstractListPresenter >> clickItem: anInteger [ self selectIndex: anInteger ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> disableActivationDuring: aBlock [ | oldActivate | @@ -122,12 +124,12 @@ SpAbstractListPresenter >> disableActivationDuring: aBlock [ activationBlock := oldActivate ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> disableFilter [ self itemFilter: nil ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> doActivateAtIndex: anIndex [ "Activate only if there is an item at that position" @@ -138,7 +140,7 @@ SpAbstractListPresenter >> doActivateAtIndex: anIndex [ yourself) ] -{ #category : #simulation } +{ #category : 'simulation' } SpAbstractListPresenter >> doubleClickAtIndex: anIndex [ self selectIndex: anIndex. @@ -146,7 +148,7 @@ SpAbstractListPresenter >> doubleClickAtIndex: anIndex [ self doActivateAtIndex: anIndex ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractListPresenter >> initialize [ super initialize. @@ -164,28 +166,28 @@ SpAbstractListPresenter >> initialize [ self registerEvents ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter >> isActiveOnDoubleClick [ "Answer true if activation event is triggered on double click" ^ activateOnSingleClick not ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter >> isActiveOnSingleClick [ "Answer true if activation event is triggered on single click" ^ activateOnSingleClick ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractListPresenter >> isMultipleSelection [ "Answer true if list accepts multiple selection" ^ selectionMode isMultipleSelection ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> itemAt: index [ "If there is an adapter the widget items indexes can be different thant the model items indexes, e.g. when the sort by a column is activated. In this case, ask the adapter to get the element @@ -196,33 +198,33 @@ SpAbstractListPresenter >> itemAt: index [ ifNil: [ self model at: index ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> itemAtPath: anArray [ "This is to provide polymorphism with SpTreeTablePresentrer" ^ self itemAt: anArray first ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> itemFilter [ ^ itemFilter ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> itemFilter: aBlock [ "This block will be used with the search field of the list to filter it with the user input dynamically." itemFilter := aBlock ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> items [ "Answer the items of the list" ^ self model collection ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> items: aSequenceableCollection [ "Set the items of the list. `aSequenceableCollection` is a collection of your domain specific items. @@ -232,12 +234,12 @@ SpAbstractListPresenter >> items: aSequenceableCollection [ self unselectAll ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> itemsAt: aCollectionOfIndex [ ^ aCollectionOfIndex collect: [ :anIndex | self itemAt: anIndex ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> listSize [ "Return the size of the item list contained in model (see `SpAbstractListPresenter>>#model`)" @@ -245,17 +247,17 @@ SpAbstractListPresenter >> listSize [ ^ self model size ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> matchBeginOfString [ self itemFilter: [ :each :pattern | each asLowercase beginsWith: pattern asLowercase ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> matchSubstring [ self itemFilter: [ :each :pattern | each asLowercase includesSubstring: pattern asLowercase ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> model [ "Answer the model for this list. It is tipically, an instance of `SpCollectionListModel`." @@ -263,7 +265,7 @@ SpAbstractListPresenter >> model [ ^ model ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> model: aModel [ "Sets the model used to feed the list presenter with elements of the list. It is tipically an instance of `SpCollectionListModel`." @@ -273,13 +275,13 @@ SpAbstractListPresenter >> model: aModel [ self withAdapterDo: [ :anAdapter | anAdapter refreshList ] ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractListPresenter >> newEmptyModel [ ^ SpCollectionListModel on: #() ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> refresh [ "Forces a refresh of the list. This is useful when some model contents has changed, but we do not want to reset the whole list @@ -288,7 +290,7 @@ SpAbstractListPresenter >> refresh [ self withAdapterDo: [ :anAdapter | anAdapter refreshList ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractListPresenter >> registerEvents [ self whenSelectionModeChangedDo: [ :selection | @@ -297,7 +299,7 @@ SpAbstractListPresenter >> registerEvents [ self withAdapterDo: [ :anAdapter | anAdapter updateMenu ] ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectAll [ "Select all items in the list or table. It does not triggers activation event." @@ -305,7 +307,7 @@ SpAbstractListPresenter >> selectAll [ self selection selectAll ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectFirst [ "Select first element in list. Useful to avoid selecting by index." @@ -313,7 +315,7 @@ SpAbstractListPresenter >> selectFirst [ ^ self selectIndex: 1 ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectIndex: anInteger [ "Select item at position `anInteger`. Selection will not scroll the presenter view to show selected element." @@ -321,7 +323,7 @@ SpAbstractListPresenter >> selectIndex: anInteger [ self selectionMode selectIndex: anInteger ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectIndex: anIndex scrollToSelection: shouldScrollToSelection [ "Select item at position `anInteger`. If `shouldScrollToSelection` is true, selection will scroll the presenter view @@ -332,7 +334,7 @@ SpAbstractListPresenter >> selectIndex: anIndex scrollToSelection: shouldScrollT self verticalAlignment desiredVisibleRow: anIndex ]. ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectIndexes: aCollectionOfIndexes [ "Select items at positions included in `aCollectionOfIndexes`. NOTE: in single selection mode, first element of `aCollectionOfIndexes` will be selected. @@ -341,7 +343,7 @@ SpAbstractListPresenter >> selectIndexes: aCollectionOfIndexes [ self selectionMode selectIndexes: aCollectionOfIndexes ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectIndexes: aCollectionOfIndexes scrollToSelection: shouldScrollToSelection [ "Select items at positions included in `aCollectionOfIndexes`. NOTE: in single selection mode, first element of `aCollectionOfIndexes` will be selected. @@ -353,7 +355,7 @@ SpAbstractListPresenter >> selectIndexes: aCollectionOfIndexes scrollToSelection self verticalAlignment desiredVisibleRow: aCollectionOfIndexes first ]. ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectItem: anItem [ "Select `anItem` if it is included in model list. It does not scrolls to selected element." @@ -361,7 +363,7 @@ SpAbstractListPresenter >> selectItem: anItem [ self selectionMode selectItem: anItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectItems: aCollection [ "Select items included in `aCollection` if they are included in model list. NOTE: In single selection mode it will select the first element of `aCollection` @@ -370,28 +372,28 @@ SpAbstractListPresenter >> selectItems: aCollection [ self selectionMode selectItems: aCollection ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectedItem [ "Return selected item." ^ self selection selectedItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectedItems [ "Return all the selected items in the case of a multiple selection list" ^ self selection selectedItems ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectedItemsSorted [ "Return all the selected items sorted by their index" ^ self itemsAt: self selection selectedIndexes sort ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selection [ "Answer the selection object (an instance of `SpSingleSelectionMode` or `SpMultipleSelectionMode`). This is not the item selected, but the selection container (it may contain one or many selected @@ -400,7 +402,7 @@ SpAbstractListPresenter >> selection [ ^ selectionMode ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectionMode [ "Answer the selection object (an instance of `SpSingleSelectionMode` or `SpMultipleSelectionMode`). This is not the item selected, but the selection container (it may contain one or many selected @@ -410,7 +412,7 @@ SpAbstractListPresenter >> selectionMode [ ^ selectionMode ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> selectionMode: aMode [ selectionMode ifNotNil: [ @@ -418,7 +420,7 @@ SpAbstractListPresenter >> selectionMode: aMode [ selectionMode := aMode ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> sortingBlock [ "Answer the sorting block defined to sort the model list. `aBlock` is a two arguments block that answer a boolean (e.g. `[ :a :b | a < b ]`) @@ -428,7 +430,7 @@ SpAbstractListPresenter >> sortingBlock [ ^ self model sortingBlock ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> sortingBlock: aBlock [ "Set sorting block to sort the model list. `aBlock` is a two arguments block that answer a boolean (e.g. `[ :a :b | a < b ]`) @@ -437,28 +439,28 @@ SpAbstractListPresenter >> sortingBlock: aBlock [ self model sortingBlock: aBlock ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> unselectAll [ "Remove all selections" self selection unselectAll ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> unselectIndex: anInteger [ "Remove selection of element at index `anInteger`" self selection unselectIndex: anInteger ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractListPresenter >> unselectItem: anObject [ "Remove selection of element `anObject`" self selection unselectItem: anObject ] -{ #category : #api } +{ #category : 'api' } SpAbstractListPresenter >> updateItemsKeepingSelection: aCollection [ "Update list items keeping current selection. WARNING: aCollection must includes the elements selected." @@ -470,13 +472,13 @@ SpAbstractListPresenter >> updateItemsKeepingSelection: aCollection [ self selectItems: items ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractListPresenter >> verticalAlignment [ ^ verticalAlignment ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenActivatedDo: aBlock [ "Inform when an element has been 'activated'. `aBlock` receives one argument (a selection object, see `SpAbstractSelectionMode`)" @@ -484,13 +486,13 @@ SpAbstractListPresenter >> whenActivatedDo: aBlock [ activationBlock := aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractListPresenter >> whenItemFilterBlockChangedDo: aBlock [ self property: #itemFilter whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenModelChangedDo: aBlock [ "Inform when model has been changed (see `SpAbstractListPresenter>>#model:`. `aBlock` receive 3 optional arguments: @@ -501,7 +503,7 @@ SpAbstractListPresenter >> whenModelChangedDo: aBlock [ model whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenNoneSelectedDo: aBlock [ "Inform when the list has clean selection (there are no items selected). `aBlock` receives zero arguments" @@ -511,7 +513,7 @@ SpAbstractListPresenter >> whenNoneSelectedDo: aBlock [ ifNil: [ aBlock value ] ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSearchEnabledChangedDo: aBlock [ "Inform when search enabled/disabled has changed. `aBlock` receives zero arguments." @@ -519,7 +521,7 @@ SpAbstractListPresenter >> whenSearchEnabledChangedDo: aBlock [ self property: #searchEnabled whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSelectedDo: aBlock [ "Inform when an item was selected (a real object in the items list). `aBlock` receives one argument (the new selected element)" @@ -529,7 +531,7 @@ SpAbstractListPresenter >> whenSelectedDo: aBlock [ ifNotNil: [ :item | aBlock value: item ] ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSelectedItemChangedDo: aBlock [ "Inform when the selected item is changed. `aBlock` receive one optional argument: the selected item (can be nil)" @@ -537,7 +539,7 @@ SpAbstractListPresenter >> whenSelectedItemChangedDo: aBlock [ self selection whenChangedDo: [ aBlock cull: self selectedItem ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSelectionChangedDo: aBlock [ "Inform when there are changes in selection. This method works for all selection modes (single, multiple and no selection). @@ -546,7 +548,7 @@ SpAbstractListPresenter >> whenSelectionChangedDo: aBlock [ self selection whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSelectionModeChangedDo: aBlock [ "Inform when selection mode (single/multiple) changed. `aBlock` receives zero arguments." @@ -554,7 +556,7 @@ SpAbstractListPresenter >> whenSelectionModeChangedDo: aBlock [ selectionMode whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractListPresenter >> whenSortingBlockChangedDo: aBlock [ "Inform when sorting block changed. `aBlock` receives one argument with the new sort function (or block with two arguments). diff --git a/src/Spec2-Core/SpAbstractPresenter.class.st b/src/Spec2-Core/SpAbstractPresenter.class.st index 35a2e41f6..4e56b6330 100644 --- a/src/Spec2-Core/SpAbstractPresenter.class.st +++ b/src/Spec2-Core/SpAbstractPresenter.class.st @@ -10,8 +10,8 @@ From a Spec2 users, my key methods are - `SpAbstractPresenter>>#openWithSpec: aSpecLayout` to open the receiver with the specified layout. " Class { - #name : #SpAbstractPresenter, - #superclass : #Model, + #name : 'SpAbstractPresenter', + #superclass : 'Model', #traits : 'TObservable', #classTraits : 'TObservable classTrait', #instVars : [ @@ -20,22 +20,24 @@ Class { 'needRebuild', 'eventHandler' ], - #category : #'Spec2-Core-Base' + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> buttonHeight [ ^ self defaultFont height + 12 ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> buttonWidth [ ^ (self defaultFont widthOfString: 'eilwp') + 44 ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> defaultFont [ self flag: #TODO. "This is so wrong. All this needs to be in the theme and in the @@ -53,31 +55,31 @@ SpAbstractPresenter class >> defaultFont [ ] -{ #category : #layout } +{ #category : 'layout' } SpAbstractPresenter class >> defaultLayout [ "Overrides me to define a layout in a static way" Error signal: 'You must define a layout either by defining #defaulLayout on your presenter or setting explicitly a layout with #layout:'. ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> inputTextHeight [ ^ self defaultFont height + 12 ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter class >> isAbstract [ ^ self = SpAbstractPresenter ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> labelHeight [ ^ self defaultFont height ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpAbstractPresenter class >> owner: anOwningPresenter [ ^ self basicNew @@ -86,32 +88,32 @@ SpAbstractPresenter class >> owner: anOwningPresenter [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter class >> systemIconName [ ^ #smallWindow ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter class >> toolName [ "The tool name can be used in some places such as the About window's title." ^ self name ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter class >> toolbarHeight [ ^ self defaultFont height + 12 ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> adapter [ ^ adapter ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> adapter: anAdapter [ "if there existed an adapter already, we need to unsubscribe it to avoid memory leaks" @@ -122,7 +124,7 @@ SpAbstractPresenter >> adapter: anAdapter [ adapter := anAdapter ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> application [ "Answer application owner of this composition. The tree for a composition starts always with an application, which is responsible of @@ -131,35 +133,35 @@ SpAbstractPresenter >> application [ ^ self owner application ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> asBlockedDialogWindow [ ^ self defaultBlockedDialogWindowPresenterClass presenter: self ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> asDialogWindow [ ^ self defaultDialogWindowPresenterClass presenter: self ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> asModalWindow [ ^ self defaultModalWindowPresenterClass presenter: self ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> asWindow [ ^ self defaultWindowPresenterClass presenter: self ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractPresenter >> autoAccept: aBoolean [ ] -{ #category : #'private - building' } +{ #category : 'private - building' } SpAbstractPresenter >> basicBuildAdapterWithLayout: aSpecLayout [ "I assume the SpecBindings is well defined" aSpecLayout ifNil: [ Error signal: 'You must define a layout either by defining #defaulLayout on your presenter or setting explicitly a layout with #layout:' ]. @@ -176,14 +178,14 @@ SpAbstractPresenter >> basicBuildAdapterWithLayout: aSpecLayout [ ^ adapter ] -{ #category : #building } +{ #category : 'building' } SpAbstractPresenter >> build [ "Build the widget using the default layout" ^ self buildWithLayout: self layout ] -{ #category : #'private - building' } +{ #category : 'private - building' } SpAbstractPresenter >> buildAdapterWithLayout: aSpecLayout [ "Build the adapter using the spec name provided as argument" @@ -192,7 +194,7 @@ SpAbstractPresenter >> buildAdapterWithLayout: aSpecLayout [ during: [ self basicBuildAdapterWithLayout: aSpecLayout ] ] -{ #category : #building } +{ #category : 'building' } SpAbstractPresenter >> buildWithLayout: aSpecLayout [ "Build the widget using the layout provided as argument" @@ -200,7 +202,7 @@ SpAbstractPresenter >> buildWithLayout: aSpecLayout [ ^ (self buildAdapterWithLayout: aSpecLayout) widget ] -{ #category : #building } +{ #category : 'building' } SpAbstractPresenter >> buildWithSelector: aSelector [ "Build the widget using the layout selector name provided as argument" @@ -208,19 +210,19 @@ SpAbstractPresenter >> buildWithSelector: aSelector [ ^ self buildWithLayout: (self retrieveLayout: aSelector) ] -{ #category : #'private - showing' } +{ #category : 'private - showing' } SpAbstractPresenter >> defaultBlockedDialogWindowPresenterClass [ ^ self application defaultBlockedDialogWindowPresenterClass ] -{ #category : #'private - showing' } +{ #category : 'private - showing' } SpAbstractPresenter >> defaultDialogWindowPresenterClass [ ^ self application defaultDialogWindowPresenterClass ] -{ #category : #layout } +{ #category : 'layout' } SpAbstractPresenter >> defaultLayout [ " You should define a #defaulLayout method returning a Spec layout for your presenter. See SpExecutableLayout hierarchy class comments for more information on how to use / define layouts. @@ -229,25 +231,25 @@ SpAbstractPresenter >> defaultLayout [ ^ self class defaultLayout ] -{ #category : #'private - showing' } +{ #category : 'private - showing' } SpAbstractPresenter >> defaultModalWindowPresenterClass [ ^ self application defaultModalWindowPresenterClass ] -{ #category : #'private - showing' } +{ #category : 'private - showing' } SpAbstractPresenter >> defaultWindowPresenterClass [ ^ self application defaultWindowPresenterClass ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> enabled: aBoolean [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> eventHandler [ "Answers an generic event handler where you can make your presenter listen to specific low-level events. @@ -260,43 +262,43 @@ SpAbstractPresenter >> eventHandler [ ^ eventHandler ifNil: [ eventHandler := SpEventHandler for: self ] ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SpAbstractPresenter >> forceUpdateSlot: aSymbol [ ^ (self rawValueHolderNamed: aSymbol) valueChanged ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> hasAdapter [ ^ adapter notNil ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> hasAnnouncer [ ^ announcer notNil ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> hasEventHandler [ ^ eventHandler notNil and: [ eventHandler hasEvents ] ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> hasOwner [ ^ self owner notNil ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> hasWindow [ ^ self root isWindowPresenter ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractPresenter >> initialize [ self class initializeSlots: self. @@ -304,7 +306,7 @@ SpAbstractPresenter >> initialize [ needRebuild := true ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractPresenter >> initializeDialogWindow: aDialogWindowPresenter [ "Used to initialize the model in the case of the use into a dialog window. Override this to set buttons other than the default (Ok, Cancel)." @@ -318,7 +320,7 @@ SpAbstractPresenter >> initializeDialogWindow: aDialogWindowPresenter [ presenter close ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractPresenter >> initializeWindow: aWindowPresenter [ "Override this to set window values before opening. You may want to add a menu, a toolbar or a statusbar" @@ -327,48 +329,48 @@ SpAbstractPresenter >> initializeWindow: aWindowPresenter [ want to do ButtonPresenter new openWithSpec)." ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> isMenuPresenter [ ^ false ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> isPresenter [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractPresenter >> isWindowPresenter [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> layout [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> needRebuild [ ^ needRebuild ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> needRebuild: aBoolean [ needRebuild := aBoolean ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> open [ ^ self asWindow open ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openBlockedDialog [ "Build the widget using the default layout and display it into a dialog. Beware: this way will not create a real modal in the sense that the user will keep the focus on other windows. If you want to make the user focus on your dialog only you should use #openModalWithSpec instead." @@ -384,7 +386,7 @@ open ^ self asBlockedDialogWindow open ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openBlockedDialogWithLayout: aSpecLayout [ "Build the widget using the given layout and display it into a dialog. Beware: this way will not create a real modal in the sense that the user will keep the focus on other windows. If you want to make the user focus on your dialog only you should use #openDialogAsModalWithSpec: instead." @@ -392,7 +394,7 @@ SpAbstractPresenter >> openBlockedDialogWithLayout: aSpecLayout [ ^ self asBlockedDialogWindow openWith: aSpecLayout ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openDialog [ "Build the widget using the default layout and display it into a dialog. Beware: this way will not create a real modal in the sense that the user will keep the focus on other windows. If you want to make the user focus on your dialog only you should use #openModalWithSpec instead." @@ -409,7 +411,7 @@ open ^ self asDialogWindow open ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openDialogWithLayout: aSpecLayout [ "Build the widget using the provided spec layout and display it into a dialog. Beware: this way will not create a real modal in the sense that the user will @@ -419,43 +421,43 @@ SpAbstractPresenter >> openDialogWithLayout: aSpecLayout [ ^ self asDialogWindow openWith: aSpecLayout ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openModal [ ^ self asModalWindow open ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openModalWithLayout: aSpecLayout [ ^ self asModalWindow openWith: aSpecLayout ] -{ #category : #showing } +{ #category : 'showing' } SpAbstractPresenter >> openWithLayout: aSpecLayout [ ^ self asWindow openWith: aSpecLayout ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> owner [ ^ owner ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> owner: aPresenter [ owner := aPresenter ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SpAbstractPresenter >> rawValueHolderNamed: aSymbol [ ^ (self class slotNamed: aSymbol) rawRead: self. ] -{ #category : #'private - building' } +{ #category : 'private - building' } SpAbstractPresenter >> retrieveLayout: aSelector [ | layout | @@ -467,7 +469,7 @@ SpAbstractPresenter >> retrieveLayout: aSelector [ ^ layout ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> root [ "Answer root presenter of this composition." @@ -476,7 +478,7 @@ SpAbstractPresenter >> root [ ifNil: [ self ] ] -{ #category : #subscription } +{ #category : 'subscription' } SpAbstractPresenter >> unsubscribe: anObject [ "Observable slots keep subscriptions to them that can leak if not removed in certain cases." | observableSlots | @@ -491,20 +493,20 @@ SpAbstractPresenter >> unsubscribe: anObject [ slotValue unsubscribe: anObject ] ] ] -{ #category : #updating } +{ #category : 'updating' } SpAbstractPresenter >> update: aParameter [ self changed: aParameter ] -{ #category : #validation } +{ #category : 'validation' } SpAbstractPresenter >> validate [ " Validate inputs of the presenter are valid. You should override me in a subclass if you need validation. " ] -{ #category : #validation } +{ #category : 'validation' } SpAbstractPresenter >> validateInto: aValidationReport [ " Validate inputs of the presenter are valid. You should override me in a subclass if you need to add validation failures @@ -513,7 +515,7 @@ SpAbstractPresenter >> validateInto: aValidationReport [ self validate. ] -{ #category : #events } +{ #category : 'events' } SpAbstractPresenter >> whenBuiltDo: aBlock [ self announcer @@ -521,7 +523,7 @@ SpAbstractPresenter >> whenBuiltDo: aBlock [ do: aBlock ] -{ #category : #events } +{ #category : 'events' } SpAbstractPresenter >> whenWillBeBuiltDo: aBlock [ self announcer @@ -529,7 +531,7 @@ SpAbstractPresenter >> whenWillBeBuiltDo: aBlock [ do: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractPresenter >> window [ "Answer window containing this composition." @@ -538,21 +540,21 @@ SpAbstractPresenter >> window [ ifFalse: [ nil ] ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SpAbstractPresenter >> withAdapterDo: aValuable [ "a convenience method to avoid verify by nil all the time" ^ self adapter ifNotNil: aValuable ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SpAbstractPresenter >> withWidgetDo: aValuable [ "a convenience method to avoid verify by nil all the time" ^ self adapter ifNotNil: aValuable ] -{ #category : #'private - utilities' } +{ #category : 'private - utilities' } SpAbstractPresenter >> withWindowDo: aValuable [ self hasWindow ifFalse: [ ^ self ]. diff --git a/src/Spec2-Core/SpAbstractSelectionMode.class.st b/src/Spec2-Core/SpAbstractSelectionMode.class.st index c67baf663..3ddfd76ac 100644 --- a/src/Spec2-Core/SpAbstractSelectionMode.class.st +++ b/src/Spec2-Core/SpAbstractSelectionMode.class.st @@ -4,17 +4,19 @@ A base for selection modes. " Class { - #name : #SpAbstractSelectionMode, - #superclass : #Object, + #name : 'SpAbstractSelectionMode', + #superclass : 'Object', #traits : 'TObservable', #classTraits : 'TObservable classTrait', #instVars : [ 'widget' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractSelectionMode class >> addDocumentSectionHierarchy: aBuilder [ aBuilder newLine. @@ -26,7 +28,7 @@ SpAbstractSelectionMode class >> addDocumentSectionHierarchy: aBuilder [ buildFor: self ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractSelectionMode class >> documentSections [ ^ OrderedDictionary newFromPairs: { @@ -40,7 +42,7 @@ SpAbstractSelectionMode class >> documentSections [ (self methods select: [ :method | method protocolName = #'api - events' ]) } ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpAbstractSelectionMode class >> on: aWidget [ ^ self new @@ -48,27 +50,27 @@ SpAbstractSelectionMode class >> on: aWidget [ yourself ] -{ #category : #private } +{ #category : 'private' } SpAbstractSelectionMode >> basicSelectIndex: indexToSelect [ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractSelectionMode >> includesIndex: anIndex [ "Answer true if selection includes element at index `anIndex`." self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractSelectionMode >> includesItem: anItem [ "Answer true if selection includes element `anItem`." self subclassResponsibility ] -{ #category : #private } +{ #category : 'private' } SpAbstractSelectionMode >> indexOfItem: anItem [ ^ self model @@ -76,27 +78,27 @@ SpAbstractSelectionMode >> indexOfItem: anItem [ ifAbsent: [ 0 ]. ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractSelectionMode >> initialize [ self class initializeSlots: self. super initialize ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractSelectionMode >> isEmpty [ "Answer true if there are no selections" ^ self subclassResponsibility ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractSelectionMode >> isMultipleSelection [ "Answer true if this is a multiple selection mode." ^ false ] -{ #category : #api } +{ #category : 'api' } SpAbstractSelectionMode >> model [ "Answer the model used to act the selection. See also `SpAbstractListPresenter>>#model`." @@ -104,108 +106,108 @@ SpAbstractSelectionMode >> model [ ^ widget model ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectAll [ "Select all items." ^ self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectIndex: anIndex [ "Select item at position `anInteger`." self basicSelectIndex: (self withinRangeIndex: anIndex) ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectIndexes: aCollectionOfIndexes [ "Select items at positions included in `aCollectionOfIndexes`." self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectItem: anItem [ "Select `anItem` if it is included in model list." self basicSelectIndex: (self indexOfItem: anItem) ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectItems: aCollection [ "Select items included in `aCollection` if they are included in model list." self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectedIndex [ ^ self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectedIndexes [ "Answer a collection with indexes of all selected items." self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectedItem [ "Answer selected item" ^ self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> selectedItems [ "Answer a collection with all selected items." ^ self subclassResponsibility ] -{ #category : #private } +{ #category : 'private' } SpAbstractSelectionMode >> selectionHolder [ ^ self subclassResponsibility ] -{ #category : #private } +{ #category : 'private' } SpAbstractSelectionMode >> transferSubscriptionsTo: anotherSelectionMode [ self selectionHolder transferSubscriptionsTo: anotherSelectionMode selectionHolder ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> unselectAll [ "Remove all selections." self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> unselectIndex: anInteger [ "Unselect item at position `anInteger`." self subclassResponsibility ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractSelectionMode >> unselectItem: anObject [ "Unselect item `anObject`." self unselectIndex: (self indexOfItem: anObject) ] -{ #category : #subscription } +{ #category : 'subscription' } SpAbstractSelectionMode >> unsubscribe: anObject [ (self observablePropertyNamed: #selectedIndexes) unsubscribe: anObject. ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractSelectionMode >> whenChangedDo: aBlock [ "Inform when selection has changed. `aBlock` has three optional arguments: @@ -216,18 +218,18 @@ SpAbstractSelectionMode >> whenChangedDo: aBlock [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractSelectionMode >> widget [ "Returns the presenter" ^ widget ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractSelectionMode >> widget: anObject [ widget := anObject ] -{ #category : #private } +{ #category : 'private' } SpAbstractSelectionMode >> withinRangeIndex: anIndex [ | indexToSelect | diff --git a/src/Spec2-Core/SpAbstractTextPresenter.class.st b/src/Spec2-Core/SpAbstractTextPresenter.class.st index 7fdd2ede7..41d2d1e6b 100644 --- a/src/Spec2-Core/SpAbstractTextPresenter.class.st +++ b/src/Spec2-Core/SpAbstractTextPresenter.class.st @@ -3,8 +3,8 @@ A base for text presenters, it defines basic functionality common to all texts. " Class { - #name : #SpAbstractTextPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAbstractTextPresenter', + #superclass : 'SpAbstractWidgetPresenter', #traits : 'SpTContextMenu', #classTraits : 'SpTContextMenu classTrait', #instVars : [ @@ -17,15 +17,17 @@ Class { '#readSelection => ObservableSlot', '#placeholder => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractTextPresenter class >> isAbstract [ ^ self = SpAbstractTextPresenter ] -{ #category : #private } +{ #category : 'private' } SpAbstractTextPresenter >> acceptText: aString [ "Used to set the text value comming from the adapter (we do not want to re-send this value to the adapter, hence we set it 'raw', not triggering events)" @@ -33,31 +35,31 @@ SpAbstractTextPresenter >> acceptText: aString [ self property: #text rawValue: aString ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> askBeforeDiscardingEdits [ ^ askBeforeDiscardingEdits ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> askBeforeDiscardingEdits: aBoolean [ askBeforeDiscardingEdits := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> clearContent [ "Clear current presenter contents" self text: '' ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> clearSelection [ "Remove selection from the text model" self selectionInterval: (0 to: 0) ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> clearUndoManager [ "Clear undo manager contents" @@ -66,7 +68,7 @@ SpAbstractTextPresenter >> clearUndoManager [ anAdapter clearUndoManager ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> cursorPositionIndex [ "Answer the index (position in the string) of the cursor (or nil if the cursor is nowhere)" @@ -74,7 +76,7 @@ SpAbstractTextPresenter >> cursorPositionIndex [ anAdapter cursorPositionIndex ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> cursorPositionIndex: index [ "Set cursor position index. This method will place the cursor in the text index position requested." @@ -82,7 +84,7 @@ SpAbstractTextPresenter >> cursorPositionIndex: index [ ^ self withAdapterDo: [ :anAdapter | anAdapter cursorPositionIndex: index ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> enabled: aBoolean [ "Set if the widget is enabled (clickable or focusable)" @@ -90,7 +92,7 @@ SpAbstractTextPresenter >> enabled: aBoolean [ self changed: #enabled: with: { aBoolean } ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> hasEditingConflicts [ "Return if the text zone has editing conflicts" @@ -99,28 +101,28 @@ SpAbstractTextPresenter >> hasEditingConflicts [ ifNotNil: [:w | w hasEditingConflicts ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> hasEditingConflicts: aBoolean [ "Set if the text zone has editing conflicts" ^ self changed: #hasEditingConflicts: with: { aBoolean } ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> hasUnacceptedEdits [ "Return if the text zone has unaccepted edits (orange corner)" ^ hasUnacceptedEdits ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> hasUnacceptedEdits: aBoolean [ "Return if the text zone has unaccepted edits (orange corner)" hasUnacceptedEdits := aBoolean ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractTextPresenter >> initialize [ super initialize. @@ -136,7 +138,7 @@ SpAbstractTextPresenter >> initialize [ self registerEvents ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> insert: aString at: positionIndex [ "insert `aString` into the text contents at `positionIndex`" @@ -144,7 +146,7 @@ SpAbstractTextPresenter >> insert: aString at: positionIndex [ anAdapter insert: aString at: positionIndex ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> insertAndSelectAfterCurrentSelection: aString [ "Insert `aString` at the end of current selection and select the inserted text." | selectionInterval | @@ -155,13 +157,13 @@ SpAbstractTextPresenter >> insertAndSelectAfterCurrentSelection: aString [ self selectionInterval: (selectionInterval last + 1 to: selectionInterval last + aString size) ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTextPresenter >> isEditable [ ^ self subclassResponsibility ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> isForSmalltalkCode [ "self @@ -172,7 +174,7 @@ SpAbstractTextPresenter >> isForSmalltalkCode [ ^ false ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> isForSmalltalkCode: aBoolean [ "self @@ -181,7 +183,7 @@ SpAbstractTextPresenter >> isForSmalltalkCode: aBoolean [ in: #Pharo8" ] -{ #category : #localization } +{ #category : 'localization' } SpAbstractTextPresenter >> localeChanged [ super localeChanged. @@ -189,33 +191,33 @@ SpAbstractTextPresenter >> localeChanged [ ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> notify: errorMessage at: position in: sourceCode [ self changed: #notify:at:in: with: { errorMessage . position . sourceCode } ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> placeholder [ "Answer the place holder (also known as ghost text) for this text component." ^ placeholder ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> placeholder: aString [ "Set the place holder (also known as ghost text) for this text component." placeholder := aString ] -{ #category : #private } +{ #category : 'private' } SpAbstractTextPresenter >> rawSelection: anInterval [ self property: #selection rawValue: anInterval ] -{ #category : #private } +{ #category : 'private' } SpAbstractTextPresenter >> readSelection [ ^ self readSelectionBlock @@ -223,21 +225,21 @@ SpAbstractTextPresenter >> readSelection [ cull: self ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> readSelectionBlock [ "Return the block used to calculate the text selection" ^ readSelection ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> readSelectionBlock: aBlock [ "Set the block used to calculate the text selection" ^ readSelection := aBlock ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractTextPresenter >> registerEvents [ self whenTextChangedDo: [ self changed: #getText ]. @@ -248,14 +250,14 @@ SpAbstractTextPresenter >> registerEvents [ self property: #askBeforeDiscardingEdits whenChangedDo: [ :bool | self changed: #askBeforeDiscardingEdits: with: {bool} ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTextPresenter >> selectAll [ "Select all text" self changed: #selectAll with: #() ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTextPresenter >> selectLine [ "Select line where the cursor is placed at this moment and answer the resulting selection (See `SpAbstractTextPresenter>>#selectionInterval`). " @@ -264,13 +266,13 @@ SpAbstractTextPresenter >> selectLine [ ^ self selectionInterval ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> selectedClassOrMetaClass [ ^ self behavior ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTextPresenter >> selectedText [ "Answer the text contained in selection interval (See `SpAbstractTextPresenter>>#selectionInterval`)" @@ -284,7 +286,7 @@ SpAbstractTextPresenter >> selectedText [ to: selectionInterval last ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTextPresenter >> selectionInterval [ "Answer the text selection interval (an interval from start to end)." @@ -293,7 +295,7 @@ SpAbstractTextPresenter >> selectionInterval [ ^ selection ifNil: [ 1 to: 0 ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTextPresenter >> selectionInterval: anInterval [ "Set the text selection interval. `anInterval` is an `Interval` from the first character selected to the end." @@ -302,21 +304,21 @@ SpAbstractTextPresenter >> selectionInterval: anInterval [ selection := anInterval ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> text [ "Answer current text" ^ text ] -{ #category : #api } +{ #category : 'api' } SpAbstractTextPresenter >> text: aString [ "Set the text of the text presenter" text := aString ] -{ #category : #simulating } +{ #category : 'simulating' } SpAbstractTextPresenter >> type: aString [ "For simulation: Do as if we type the given string" self withAdapterDo: [ :anAdapter | @@ -326,7 +328,7 @@ SpAbstractTextPresenter >> type: aString [ self text: aString ] -{ #category : #simulating } +{ #category : 'simulating' } SpAbstractTextPresenter >> typeByChar: aString [ "For simulation: Do as if we type the given string" self withAdapterDo: [ :anAdapter | @@ -338,24 +340,24 @@ SpAbstractTextPresenter >> typeByChar: aString [ self text: (self text ifNil: [ '' ]), (each asString) ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> wantsVisualFeedback [ ^ wantsVisualFeedback ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> wantsVisualFeedback: aBoolean [ wantsVisualFeedback := aBoolean ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractTextPresenter >> whenAcceptBlockChangedDo: aBlock [ "Set a block to perform when the accept block changed" self property: #actionToPerform whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTextPresenter >> whenPlaceholderChangedDo: aBlock [ "Inform when placeholder has been changed (See `SpAbstractTextPresenter>>#placeholder:`). `aBlock` receives two optional arguments @@ -365,14 +367,14 @@ SpAbstractTextPresenter >> whenPlaceholderChangedDo: aBlock [ self property: #placeholder whenChangedDo: aBlock ] -{ #category : #private } +{ #category : 'private' } SpAbstractTextPresenter >> whenReadSelectionIsChangedDo: aBlock [ "Set a block to perform when the read selection block changed" self property: #readSelection whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTextPresenter >> whenResetDo: aBlock [ "Inform when a 'reset' event is triggered. It will react when user presses key (this is for historical reasons)." @@ -382,7 +384,7 @@ SpAbstractTextPresenter >> whenResetDo: aBlock [ toAction: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTextPresenter >> whenSelectionChangedDo: aBlock [ "Inform when selection changed. `aBlock` receives two optional arguments @@ -392,7 +394,7 @@ SpAbstractTextPresenter >> whenSelectionChangedDo: aBlock [ self property: #selection whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTextPresenter >> whenSubmitDo: aBlock [ "Inform a 'submit' event has been triggered. It will react when user presses key (this is for historical reasons) and (in case of text fields) with . @@ -401,7 +403,7 @@ SpAbstractTextPresenter >> whenSubmitDo: aBlock [ self subclassResponsibility ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTextPresenter >> whenTextChangedDo: aBlock [ "Inform when text has been changed (a character has been enter or `SpAbstractTextPresenter>>text:` has been called) `aBlock` receives two optional arguments diff --git a/src/Spec2-Core/SpAbstractTreeFilter.class.st b/src/Spec2-Core/SpAbstractTreeFilter.class.st index 85524e104..8ce3a3c75 100644 --- a/src/Spec2-Core/SpAbstractTreeFilter.class.st +++ b/src/Spec2-Core/SpAbstractTreeFilter.class.st @@ -3,7 +3,9 @@ I am an abstract class for tree filters. My children should propose a filter for tree nodes. " Class { - #name : #SpAbstractTreeFilter, - #superclass : #Object, - #category : #'Spec2-Core-Support' + #name : 'SpAbstractTreeFilter', + #superclass : 'Object', + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } diff --git a/src/Spec2-Core/SpAbstractTreePresenter.class.st b/src/Spec2-Core/SpAbstractTreePresenter.class.st index 9a7b22c89..e36f761cf 100644 --- a/src/Spec2-Core/SpAbstractTreePresenter.class.st +++ b/src/Spec2-Core/SpAbstractTreePresenter.class.st @@ -2,8 +2,8 @@ A base for tree presenters, it defines basic functionality common to all trees. " Class { - #name : #SpAbstractTreePresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAbstractTreePresenter', + #superclass : 'SpAbstractWidgetPresenter', #traits : 'SpTHaveWrappingScrollBars + SpTContextMenu + SpTSearchable + SpTAlignableColumn', #classTraits : 'SpTHaveWrappingScrollBars classTrait + SpTContextMenu classTrait + SpTSearchable classTrait + SpTAlignableColumn classTrait', #instVars : [ @@ -14,16 +14,18 @@ Class { '#selectionMode', '#verticalAlignment' ], - #category : #'Spec2-Core-Widgets-Tree' + #category : 'Spec2-Core-Widgets-Tree', + #package : 'Spec2-Core', + #tag : 'Widgets-Tree' } -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter class >> isAbstract [ ^ super isAbstract or: [ self = SpAbstractTreePresenter ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> activateOnDoubleClick [ "Configure the list to trigger activation on double click. An element on a list can be 'activated', meaning it will trigger an event to execute an @@ -34,7 +36,7 @@ SpAbstractTreePresenter >> activateOnDoubleClick [ activateOnSingleClick := false ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> activateOnSingleClick [ "Configure the list to trigger activation on single click. An element on a list can be 'activated', meaning it will trigger an event to execute an @@ -45,7 +47,7 @@ SpAbstractTreePresenter >> activateOnSingleClick [ activateOnSingleClick := true ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter >> activatesOnDoubleClick [ "Answer true if activation event is triggered on double click" @@ -56,7 +58,7 @@ SpAbstractTreePresenter >> activatesOnDoubleClick [ ^ activateOnSingleClick not ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter >> activatesOnSingleClick [ "Answer true if activation event is triggered on single click" @@ -67,27 +69,27 @@ SpAbstractTreePresenter >> activatesOnSingleClick [ ^ activateOnSingleClick ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> beMultipleSelection [ "Enable multiple selection." self selectionMode: (SpTreeMultipleSelectionMode on: self) ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> beSingleSelection [ "Enable single selection (this is the default)." self selectionMode: (SpTreeSingleSelectionMode on: self) ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> children [ ^ childrenBlock ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> children: aBlock [ "Set a block to answer the children of a node when it is expanded. `aBlock` receives one argument, the node element to expand. @@ -96,13 +98,13 @@ SpAbstractTreePresenter >> children: aBlock [ childrenBlock := aBlock ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> childrenFor: anObject [ ^ self children value: anObject ] -{ #category : #simulation } +{ #category : 'simulation' } SpAbstractTreePresenter >> clickAtPath: aPath [ self selectPaths: { aPath }. @@ -111,7 +113,7 @@ SpAbstractTreePresenter >> clickAtPath: aPath [ self doActivateAtPath: aPath ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> collapseAll [ "Collapse all nodes of the tree. " @@ -119,7 +121,7 @@ SpAbstractTreePresenter >> collapseAll [ anAdapter collapseAll ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> collapsePath: aPath [ "Collapse the tree path. `aPath` is the path to collapse. A path is an array of node indexes (e.g. #(1 2 3))" @@ -128,7 +130,7 @@ SpAbstractTreePresenter >> collapsePath: aPath [ anAdapter collapsePath: aPath ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> disableActivationDuring: aBlock [ | oldActivate | @@ -138,7 +140,7 @@ SpAbstractTreePresenter >> disableActivationDuring: aBlock [ activationBlock := oldActivate ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> doActivateAtPath: aPath [ "Activate only if there is an item at that position" @@ -148,7 +150,7 @@ SpAbstractTreePresenter >> doActivateAtPath: aPath [ yourself) ] -{ #category : #simulation } +{ #category : 'simulation' } SpAbstractTreePresenter >> doubleClickAtPath: aPath [ self selectPath: aPath. @@ -156,7 +158,7 @@ SpAbstractTreePresenter >> doubleClickAtPath: aPath [ self doActivateAtPath: aPath ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> expandAll [ "Expand all nodes of the tree. WARNING: If your tree is big, this operation can be slow." @@ -165,7 +167,7 @@ SpAbstractTreePresenter >> expandAll [ anAdapter expandAll ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> expandPath: aPath [ "Expand the tree path. `aPath` is the path to expand. A path is an array of node indexes (e.g. #(1 2 3))" @@ -174,7 +176,7 @@ SpAbstractTreePresenter >> expandPath: aPath [ anAdapter expandPath: aPath ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> expandRoots [ "Expand all roots of the tree" @@ -182,7 +184,7 @@ SpAbstractTreePresenter >> expandRoots [ anAdapter expandRoots ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractTreePresenter >> initialize [ super initialize. @@ -190,21 +192,21 @@ SpAbstractTreePresenter >> initialize [ self initializeTHaveWrappingScrollBars ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter >> isActiveOnDoubleClick [ "Answer true if activation event is triggered on double click" ^ activateOnSingleClick not ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter >> isActiveOnSingleClick [ "Answer true if activation event is triggered on single click" ^ activateOnSingleClick ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreePresenter >> isExpanded: aPath [ self withAdapterDo: [ :anAdapter | @@ -213,7 +215,7 @@ SpAbstractTreePresenter >> isExpanded: aPath [ ^ false ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> itemAt: index of: anArray then: path [ "dives into elements of tree to find the one that corresponds to path" | element | @@ -229,7 +231,7 @@ SpAbstractTreePresenter >> itemAt: index of: anArray then: path [ element ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> itemAtPath: anArray [ self withAdapterDo: [ :anAdapter | @@ -241,21 +243,21 @@ SpAbstractTreePresenter >> itemAtPath: anArray [ then: anArray allButFirst ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> itemAtPath: anArray ifAbsent: aBlock [ ^ [ self itemAtPath: anArray ] on: SubscriptOutOfBounds do: [ aBlock value ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> items: aCollection [ "Set the roots of a tree. This is a convenience method, synonym of `SpTreePresenter>>#roots:`" self roots: aCollection ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> pathIndexOf: anArrayOfElements [ ^ self @@ -263,7 +265,7 @@ SpAbstractTreePresenter >> pathIndexOf: anArrayOfElements [ in: self roots ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> pathIndexOf: pathArray in: aCollection [ | pathElement | @@ -276,7 +278,7 @@ SpAbstractTreePresenter >> pathIndexOf: pathArray in: aCollection [ ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> pathItemOf: aPath [ "answer an array of items following a path. e.g. #(1 2 3) = { item1. item2. item3 }" @@ -286,7 +288,7 @@ SpAbstractTreePresenter >> pathItemOf: aPath [ in: self roots ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> pathItemOf: pathArray in: aCollection [ | pathElement | @@ -299,7 +301,7 @@ SpAbstractTreePresenter >> pathItemOf: pathArray in: aCollection [ ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> refresh [ "Forces a refresh of the tree. This is useful when some model contents has changed, but we do not want to reset the whole list @@ -308,21 +310,21 @@ SpAbstractTreePresenter >> refresh [ self withAdapterDo: [ :anAdapter | anAdapter refreshTree ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractTreePresenter >> registerEvents [ self whenMenuChangedDo: [ self withAdapterDo: [ :anAdapter | anAdapter updateMenu ] ] ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> roots [ "Answer the roots of the tree" ^ roots ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> roots: aCollection [ "Set the roots of the tree table. This is the starting point from where the whole tree will be shown." @@ -331,13 +333,13 @@ SpAbstractTreePresenter >> roots: aCollection [ self selection clearSelection ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> searchValueOf: item [ ^ item asString ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectItem: anItem [ "Select `anItem` if it is included in model list. It does not scrolls to selected element." @@ -345,7 +347,7 @@ SpAbstractTreePresenter >> selectItem: anItem [ self selection selectItem: anItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectItems: aListOfItem [ "Select items included in `aCollection` if they are included in model list. NOTE: In single selection mode it will select the first element of `aCollection` @@ -354,7 +356,7 @@ SpAbstractTreePresenter >> selectItems: aListOfItem [ self selection selectItems: aListOfItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectPath: aPath [ "Selects element in `aPath` `aPath` is the path to select. A path is an array of node indexes (e.g. #(1 2 3)). @@ -363,7 +365,7 @@ SpAbstractTreePresenter >> selectPath: aPath [ self selection selectPath: aPath ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectPath: aPath scrollToSelection: shouldScrollToSelection [ "Selects element in `aPath` `aPath` is the path to select. A path is an array of node indexes (e.g. #(1 2 3)). @@ -378,13 +380,13 @@ SpAbstractTreePresenter >> selectPath: aPath scrollToSelection: shouldScrollToSe shouldScrollToSelection ifTrue: [ adapter scrollToSelection ] ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectPathByItems: pathArray [ self selectPathByItems: pathArray scrollToSelection: false ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectPathByItems: pathArray scrollToSelection: aBoolean [ "IMPORTANT: Scrolling to selection just has sense when the widget is already shown, because before it is displayed it does not has real bounds. In morphic (and gtk) it has a minimal extent assigned, @@ -400,7 +402,7 @@ SpAbstractTreePresenter >> selectPathByItems: pathArray scrollToSelection: aBool scrollToSelection: aBoolean ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectPaths: pathArray [ "Selects all elements in `pathsArray`` `pathsArray` is an array of paths. A path is an array of node indexes (e.g. #(1 2 3))" @@ -408,21 +410,21 @@ SpAbstractTreePresenter >> selectPaths: pathArray [ self selection selectPaths: pathArray ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectedItem [ "Return selected item." ^ self selection selectedItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selectedItems [ "Return all the selected items in the case of a multiple selection list" ^ self selection selectedItems ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> selection [ "Answer the selection object (an instance of `SpSingleSelectionMode` or `SpMultipleSelectionMode`). This is not the item selected, but the selection container (it may contain one or many selected @@ -431,7 +433,7 @@ SpAbstractTreePresenter >> selection [ ^ selectionMode value ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> selectionMode: aMode [ selectionMode ifNotNil: [ @@ -439,21 +441,21 @@ SpAbstractTreePresenter >> selectionMode: aMode [ selectionMode := aMode ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> unselectAll [ "Remove all selections" self selection unselectAll ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> unselectItem: anItem [ "Remove selection of element `anItem`" self selection unselectItem: anItem ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpAbstractTreePresenter >> unselectPath: aPath [ "Unselects element in `aPath` `aPath` is the path to select. A path is an array of node indexes (e.g. #(1 2 3))" @@ -461,7 +463,7 @@ SpAbstractTreePresenter >> unselectPath: aPath [ self selection unselectPath: aPath ] -{ #category : #api } +{ #category : 'api' } SpAbstractTreePresenter >> updateRootsKeepingSelection: aCollection [ "Update tree roots keeping current selection. WARNING: aCollection must includes the elements selected." @@ -475,12 +477,12 @@ SpAbstractTreePresenter >> updateRootsKeepingSelection: aCollection [ self selectPaths: (selectedPaths collect: [ :each | self pathIndexOf: each ]) ] ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractTreePresenter >> verticalAlignment [ ^ verticalAlignment ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenActivatedDo: aBlock [ "Inform when an element has been 'activated'. `aBlock` receives one argument (a selection object, see `SpAbstractSelectionMode`)" @@ -488,7 +490,7 @@ SpAbstractTreePresenter >> whenActivatedDo: aBlock [ activationBlock := aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenMultiSelectionChangedDo: aBlockClosure [ "Inform when selection mode has changed. `aBlock` has three optional arguments: @@ -499,7 +501,7 @@ SpAbstractTreePresenter >> whenMultiSelectionChangedDo: aBlockClosure [ selectionMode whenChangedDo: aBlockClosure ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenRootsChangedDo: aBlockClosure [ "Inform when roots have changed. `aBlock` has three optional arguments: @@ -510,7 +512,7 @@ SpAbstractTreePresenter >> whenRootsChangedDo: aBlockClosure [ self property: #roots whenChangedDo: aBlockClosure ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenSelectedIndexChangedDo: aBlock [ "Inform when selected index has changed. `aBlock` receives one optional argument (the new element)." @@ -519,7 +521,7 @@ SpAbstractTreePresenter >> whenSelectedIndexChangedDo: aBlock [ aBlock cull: selection first ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenSelectedItemChangedDo: aBlock [ "Inform when selected index has changed. `aBlock` receives one optional argument (the new element)." @@ -528,7 +530,7 @@ SpAbstractTreePresenter >> whenSelectedItemChangedDo: aBlock [ aBlock cull: (selection ifNotNil: [ selection selectedItem ]) ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenSelectionChangedDo: aBlock [ "Inform when selection has changed. `aBlock` has three optional arguments: @@ -539,7 +541,7 @@ SpAbstractTreePresenter >> whenSelectionChangedDo: aBlock [ self selection whenChangedDo: [ aBlock cull: selectionMode ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreePresenter >> whenShowColumnHeadersChangedDo: aBlock [ "Inform when showColumnHeaders property has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpAbstractTreeSelectionMode.class.st b/src/Spec2-Core/SpAbstractTreeSelectionMode.class.st index 327f47ffc..b0a2db842 100644 --- a/src/Spec2-Core/SpAbstractTreeSelectionMode.class.st +++ b/src/Spec2-Core/SpAbstractTreeSelectionMode.class.st @@ -1,16 +1,18 @@ Class { - #name : #SpAbstractTreeSelectionMode, - #superclass : #Object, + #name : 'SpAbstractTreeSelectionMode', + #superclass : 'Object', #traits : 'TObservable', #classTraits : 'TObservable classTrait', #instVars : [ '#selection => ObservableSlot', '#presenter' ], - #category : #'Spec2-Core-Widgets-Tree' + #category : 'Spec2-Core-Widgets-Tree', + #package : 'Spec2-Core', + #tag : 'Widgets-Tree' } -{ #category : #'accessing method dictionary' } +{ #category : 'accessing method dictionary' } SpAbstractTreeSelectionMode class >> on: aPresenter [ ^ self new @@ -18,13 +20,13 @@ SpAbstractTreeSelectionMode class >> on: aPresenter [ yourself ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> clearSelection [ selection := #() ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractTreeSelectionMode >> initialize [ self class initializeSlots: self. selection := #(). @@ -32,29 +34,29 @@ SpAbstractTreeSelectionMode >> initialize [ ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractTreeSelectionMode >> isEmpty [ ^ selection isEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> isMultipleSelection [ ^ false ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> itemNotFoundAction [ "ignore. we do not change the selection" ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> pathOf: anItem [ ^ (self pathOf: anItem from: presenter roots) ifNil: [ NotFound signalFor: anItem in: presenter roots ] ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> pathOf: anItem from: aCollection [ | index | @@ -68,19 +70,19 @@ SpAbstractTreeSelectionMode >> pathOf: anItem from: aCollection [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> presenter: aPresenter [ presenter := aPresenter ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> selectItem: anItem [ [ self selectPath: (self pathOf: anItem) ] on: NotFound do: [ self itemNotFoundAction ] ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> selectItems: aListOfItems [ aListOfItems do: [ :each | @@ -89,7 +91,7 @@ SpAbstractTreeSelectionMode >> selectItems: aListOfItems [ do: [ "ignore. we do not change the selection" ] ] ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> selectPath: aPath [ "Select a node in the tree by providing a list of indexes. Example: @@ -108,17 +110,17 @@ SpAbstractTreeSelectionMode >> selectPath: aPath [ self subclassResponsibility ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> selectPaths: pathArray [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> selectedItem [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> selectedItemsInPath [ "Answer the items on a path, not just the indexes." | path | @@ -131,48 +133,48 @@ SpAbstractTreeSelectionMode >> selectedItemsInPath [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> selectedPaths [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpAbstractTreeSelectionMode >> selectionHolder [ ^ self observablePropertyNamed: #selection ] -{ #category : #transfering } +{ #category : 'transfering' } SpAbstractTreeSelectionMode >> transferSubscriptionsTo: anotherSelectionMode [ self selectionHolder transferSubscriptionsTo: anotherSelectionMode selectionHolder ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> unselectAll [ self clearSelection ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> unselectItem: anItem [ [ self unselectPath: (self pathOf: anItem) ] on: NotFound do: [ "ignore. nothing to unselect" ] ] -{ #category : #selecting } +{ #category : 'selecting' } SpAbstractTreeSelectionMode >> unselectPath: aPath [ self subclassResponsibility ] -{ #category : #subscription } +{ #category : 'subscription' } SpAbstractTreeSelectionMode >> unsubscribe: anObject [ (self observablePropertyNamed: #selection) unsubscribe: anObject ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractTreeSelectionMode >> whenChangedDo: aBlock [ self property: #selection whenChangedDo: aBlock diff --git a/src/Spec2-Core/SpAbstractWidgetPresenter.class.st b/src/Spec2-Core/SpAbstractWidgetPresenter.class.st index a521ee07d..4d776bbac 100644 --- a/src/Spec2-Core/SpAbstractWidgetPresenter.class.st +++ b/src/Spec2-Core/SpAbstractWidgetPresenter.class.st @@ -2,8 +2,8 @@ SpAbstractBasicWidget is an abstract class for basic widgets. " Class { - #name : #SpAbstractWidgetPresenter, - #superclass : #SpPresenter, + #name : 'SpAbstractWidgetPresenter', + #superclass : 'SpPresenter', #instVars : [ '#borderWidth => ObservableSlot', '#borderColor => ObservableSlot', @@ -16,22 +16,24 @@ Class { '#acceptDrop => ObservableSlot', '#deferredActions' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpAbstractWidgetPresenter class >> adapterName [ ^ self subclassResponsibility ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentExtraSections: aBuilder [ "a hook to add extra sections when needed" ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentSection: aBuilder label: label methods: methods [ methods ifEmpty: [ ^ self ]. @@ -44,7 +46,7 @@ SpAbstractWidgetPresenter class >> addDocumentSection: aBuilder label: label met aBuilder monospace: (each methodClass name, '>>#', each selector) ] ] ] ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentSectionExampleCode: aBuilder [ | exampleCode | @@ -57,7 +59,7 @@ SpAbstractWidgetPresenter class >> addDocumentSectionExampleCode: aBuilder [ aBuilder codeblock: exampleCode ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentSectionFactoryMethod: aBuilder [ | selector | @@ -74,7 +76,7 @@ SpAbstractWidgetPresenter class >> addDocumentSectionFactoryMethod: aBuilder [ aBuilder text: '.' ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentSectionHierarchy: aBuilder [ aBuilder newLine. @@ -85,7 +87,7 @@ SpAbstractWidgetPresenter class >> addDocumentSectionHierarchy: aBuilder [ buildFor: self ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> addDocumentSectionTransmissions: aBuilder [ | transmissions defaultInputPort defaultOutputPort | @@ -111,13 +113,13 @@ SpAbstractWidgetPresenter class >> addDocumentSectionTransmissions: aBuilder [ ifTrue: [ aBuilder monospace: ' (default)' ] ] ] ] ] -{ #category : #layout } +{ #category : 'layout' } SpAbstractWidgetPresenter class >> defaultLayout [ ^ SpAbstractWidgetLayout for: self adapterName ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentExampleCode [ | exampleMethod | @@ -128,25 +130,25 @@ SpAbstractWidgetPresenter class >> documentExampleCode [ ^ (exampleMethod sourceCode lines allButFirst reject: [ :each | each trimLeft beginsWith: '<' ]) asStringWithCr trimmed "Remove method name" "Remove pragmas" ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentExampleCodeSelector [ ^ #example ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentExamplesProtocol [ ^ #'*Spec2-Examples' ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentFactoryMethodSelector [ ^ nil ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentSections [ ^ OrderedDictionary newFromPairs: { @@ -160,34 +162,34 @@ SpAbstractWidgetPresenter class >> documentSections [ (self methods select: [ :method | method protocolName = #'api - events' ]) } ] -{ #category : #documentation } +{ #category : 'documentation' } SpAbstractWidgetPresenter class >> documentTransmissionsProtocol [ ^ #'*Spec2-Transmission' ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractWidgetPresenter class >> isAbstract [ ^ self = SpAbstractWidgetPresenter ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractWidgetPresenter class >> isWindow [ ^ false ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> acceptDrop [ ^ acceptDrop ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> acceptDrop: aBlock [ acceptDrop := aBlock ] -{ #category : #'private - deferring' } +{ #category : 'private - deferring' } SpAbstractWidgetPresenter >> addDeferredAction: aBlock [ "Deferred actions are one-shot actions, performed during adapter initialization." @@ -195,7 +197,7 @@ SpAbstractWidgetPresenter >> addDeferredAction: aBlock [ deferredActions := deferredActions copyWith: aBlock ] -{ #category : #'private - building' } +{ #category : 'private - building' } SpAbstractWidgetPresenter >> basicBuildAdapterWithLayout: aSpecLayout [ | builtAdapter | @@ -204,84 +206,84 @@ SpAbstractWidgetPresenter >> basicBuildAdapterWithLayout: aSpecLayout [ ^ builtAdapter ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> borderColor [ "Return the border color" ^ borderColor ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> borderColor: aColor [ "Set the border width" borderColor := aColor ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> borderWidth [ "Return the border width" ^ borderWidth ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> borderWidth: anInteger [ "Set the border width" borderWidth := anInteger ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> color [ ^ color ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> color: aColor [ ^ color := aColor ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractWidgetPresenter >> defaultColor [ ^ self theme backgroundColor ] -{ #category : #api } +{ #category : 'api' } SpAbstractWidgetPresenter >> disable [ "Disable the presenter" self enabled: false ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> dragEnabled [ ^ dragEnabled ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> dragEnabled: aBoolean [ dragEnabled := aBoolean ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> dropEnabled [ ^ dropEnabled ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> dropEnabled: aBoolean [ dropEnabled := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpAbstractWidgetPresenter >> enable [ "Enable the presenter" self enabled: true ] -{ #category : #api } +{ #category : 'api' } SpAbstractWidgetPresenter >> enabled: aBooleanOrValuable [ "Set if the widget is enabled (clickable or focusable). This can either be a boolean or a block returning a boolean." @@ -289,21 +291,21 @@ SpAbstractWidgetPresenter >> enabled: aBooleanOrValuable [ enabled := aBooleanOrValuable ] -{ #category : #api } +{ #category : 'api' } SpAbstractWidgetPresenter >> help [ "Return the help string to display as help (tooltip) to the user." ^ help ] -{ #category : #api } +{ #category : 'api' } SpAbstractWidgetPresenter >> help: aString [ "Set a help string to display to the user if he let the mouse over the widget (a tooltip)." help := aString ] -{ #category : #initialization } +{ #category : 'initialization' } SpAbstractWidgetPresenter >> initialize [ super initialize. @@ -320,14 +322,14 @@ SpAbstractWidgetPresenter >> initialize [ self withWidgetDo: [ :w | w update: #dropEnabled: with: { value } ] ] ] -{ #category : #testing } +{ #category : 'testing' } SpAbstractWidgetPresenter >> isEnabled [ "Answer if presenter is enabled" ^ enabled ] -{ #category : #localization } +{ #category : 'localization' } SpAbstractWidgetPresenter >> localeChanged [ super localeChanged. @@ -335,7 +337,7 @@ SpAbstractWidgetPresenter >> localeChanged [ ] -{ #category : #'private - deferring' } +{ #category : 'private - deferring' } SpAbstractWidgetPresenter >> processDeferredActions [ deferredActions ifNil: [ ^ self ]. @@ -345,12 +347,12 @@ SpAbstractWidgetPresenter >> processDeferredActions [ deferredActions := nil ] ] -{ #category : #private } +{ #category : 'private' } SpAbstractWidgetPresenter >> replaceLayoutWith: aLayout [ "do nothing, widgets do not have updatable layouts" ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpAbstractWidgetPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ self canTakeKeyboardFocus ifFalse: [ ^ self ]. @@ -359,7 +361,7 @@ SpAbstractWidgetPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes aBlock value: self ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpAbstractWidgetPresenter >> traversePresentersDo: aBlock excluding: excludes [ "Terminate" @@ -367,31 +369,31 @@ SpAbstractWidgetPresenter >> traversePresentersDo: aBlock excluding: excludes [ aBlock value: self ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> wantsDrop [ ^ wantsDrop ] -{ #category : #'drag and drop' } +{ #category : 'drag and drop' } SpAbstractWidgetPresenter >> wantsDrop: aBlock [ wantsDrop := aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> whenBorderColorChangedDo: aBlock [ "Set a block to be performed when the brder width changed" self property: #borderColor whenChangedDo: aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpAbstractWidgetPresenter >> whenBorderWidthChangedDo: aBlock [ "Set a block to be performed when the brder width changed" self property: #borderWidth whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractWidgetPresenter >> whenEnabledChangedDo: aBlock [ "Inform when enabled status has changed. `aBlock` has three optional arguments: @@ -402,7 +404,7 @@ SpAbstractWidgetPresenter >> whenEnabledChangedDo: aBlock [ self property: #enabled whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAbstractWidgetPresenter >> whenHelpChangedDo: aBlock [ "Inform when help property has changed. `aBlock` has three optional arguments: @@ -413,7 +415,7 @@ SpAbstractWidgetPresenter >> whenHelpChangedDo: aBlock [ self property: #help whenChangedDo: aBlock ] -{ #category : #'private - deferring' } +{ #category : 'private - deferring' } SpAbstractWidgetPresenter >> withAdapterPerformOrDefer: aBlock [ self adapter diff --git a/src/Spec2-Core/SpActionBarPresenter.class.st b/src/Spec2-Core/SpActionBarPresenter.class.st index cf44e4b75..bae49bfe3 100644 --- a/src/Spec2-Core/SpActionBarPresenter.class.st +++ b/src/Spec2-Core/SpActionBarPresenter.class.st @@ -5,27 +5,29 @@ This is like the small action bars at the bottom of a list in most mobile apps ( " Class { - #name : #SpActionBarPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpActionBarPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ 'items' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpActionBarPresenter class >> adapterName [ ^ #ActionBarAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpActionBarPresenter class >> documentFactoryMethodSelector [ ^ #newActionBar ] -{ #category : #api } +{ #category : 'api' } SpActionBarPresenter >> add: aButtonPresenter [ "Add a button presenter to be shown at the start of the action bar (at the left)." @@ -35,7 +37,7 @@ SpActionBarPresenter >> add: aButtonPresenter [ add: aButtonPresenter ] -{ #category : #api } +{ #category : 'api' } SpActionBarPresenter >> addLast: aButtonPresenter [ "Add a button presenter to be shown at the end of the action bar (at the right)." @@ -45,14 +47,14 @@ SpActionBarPresenter >> addLast: aButtonPresenter [ add: aButtonPresenter ] -{ #category : #initialization } +{ #category : 'initialization' } SpActionBarPresenter >> initialize [ super initialize. items := Dictionary new asValueHolder ] -{ #category : #api } +{ #category : 'api' } SpActionBarPresenter >> items [ "Answer a dictionary containing the pairs: #start -> anOrderedCollection, @@ -61,19 +63,19 @@ SpActionBarPresenter >> items [ ^ items value ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpActionBarPresenter >> presenters [ ^ self items values flattened ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpActionBarPresenter >> presentersInFocusOrder [ ^ self presenters ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpActionBarPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ self presentersInFocusOrder do: [ :each | diff --git a/src/Spec2-Core/SpActivatedSelection.class.st b/src/Spec2-Core/SpActivatedSelection.class.st index 5120f9a41..13a5eb354 100644 --- a/src/Spec2-Core/SpActivatedSelection.class.st +++ b/src/Spec2-Core/SpActivatedSelection.class.st @@ -2,15 +2,17 @@ I'm a simple object to wrap a selected item for an `SpActivationTransform`. " Class { - #name : #SpActivatedSelection, - #superclass : #Object, + #name : 'SpActivatedSelection', + #superclass : 'Object', #instVars : [ 'value' ], - #category : #'Spec2-Core-Support' + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpActivatedSelection class >> newValue: anObject [ ^ self new @@ -18,19 +20,19 @@ SpActivatedSelection class >> newValue: anObject [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpActivatedSelection >> selectedItem [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } SpActivatedSelection >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } SpActivatedSelection >> value: anObject [ value := anObject diff --git a/src/Spec2-Core/SpActivationHolder.class.st b/src/Spec2-Core/SpActivationHolder.class.st index 32d36fb1e..c823814d2 100644 --- a/src/Spec2-Core/SpActivationHolder.class.st +++ b/src/Spec2-Core/SpActivationHolder.class.st @@ -2,63 +2,65 @@ A holder to allow activation (and selection) events to be listened by more than one object (otherwise, it can hold just one) " Class { - #name : #SpActivationHolder, - #superclass : #Object, + #name : 'SpActivationHolder', + #superclass : 'Object', #instVars : [ 'subscriptions' ], - #category : #'Spec2-Core-Support' + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #adding } +{ #category : 'adding' } SpActivationHolder >> add: aBlock [ subscriptions := subscriptions copyWith: aBlock ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> cull: arg [ subscriptions do: [ :each | each cull: arg ] ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> cull: firstArg cull: secondArg [ subscriptions do: [ :each | each cull: firstArg cull: secondArg ] ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> cull: firstArg cull: secondArg cull: thirdArg [ subscriptions do: [ :each | each cull: firstArg cull: secondArg cull: thirdArg ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpActivationHolder >> initialize [ super initialize. subscriptions := #() ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> value: arg [ subscriptions do: [ :each | each value: arg ] ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> value: firstArg value: secondArg [ subscriptions do: [ :each | each value: firstArg value: secondArg ] ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationHolder >> value: firstArg value: secondArg value: thirdArg [ subscriptions do: [ :each | diff --git a/src/Spec2-Core/SpActivationTransform.class.st b/src/Spec2-Core/SpActivationTransform.class.st index 219517723..f28d8382a 100644 --- a/src/Spec2-Core/SpActivationTransform.class.st +++ b/src/Spec2-Core/SpActivationTransform.class.st @@ -1,14 +1,16 @@ Class { - #name : #SpActivationTransform, - #superclass : #Object, + #name : 'SpActivationTransform', + #superclass : 'Object', #instVars : [ 'block', 'transformBlock' ], - #category : #'Spec2-Core-Support' + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpActivationTransform class >> activateDo: aBlock transform: transformBlock [ ^ self new @@ -17,13 +19,13 @@ SpActivationTransform class >> activateDo: aBlock transform: transformBlock [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpActivationTransform >> block: aBlock [ block := aBlock ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationTransform >> cull: aSelection [ ^ block cull: (SpActivatedSelection new @@ -31,13 +33,13 @@ SpActivationTransform >> cull: aSelection [ yourself). ] -{ #category : #accessing } +{ #category : 'accessing' } SpActivationTransform >> transformBlock: aBlock [ transformBlock := aBlock ] -{ #category : #evaluating } +{ #category : 'evaluating' } SpActivationTransform >> value: aSelection [ ^ self cull: aSelection diff --git a/src/Spec2-Core/SpAdapterBindings.class.st b/src/Spec2-Core/SpAdapterBindings.class.st index 74d5f2b2e..f5833b722 100644 --- a/src/Spec2-Core/SpAdapterBindings.class.st +++ b/src/Spec2-Core/SpAdapterBindings.class.st @@ -4,27 +4,29 @@ I am an abstract class I am used to link a spec-oriented adapter name to a framework specific adapter class name " Class { - #name : #SpAdapterBindings, - #superclass : #Object, + #name : 'SpAdapterBindings', + #superclass : 'Object', #instVars : [ 'bindings' ], - #category : #'Spec2-Core-Base' + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #testing } +{ #category : 'testing' } SpAdapterBindings class >> isAbstract [ ^ self name = #SpAdapterBindings ] -{ #category : #accessing } +{ #category : 'accessing' } SpAdapterBindings >> abstractAdapterClass [ ^ self subclassResponsibility ] -{ #category : #utilities } +{ #category : 'utilities' } SpAdapterBindings >> adapterClass: aSymbol [ ^ Smalltalk @@ -32,12 +34,12 @@ SpAdapterBindings >> adapterClass: aSymbol [ ifAbsent: [ aSymbol ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpAdapterBindings >> allAdapters [ ^ self abstractAdapterClass allAdapters ] -{ #category : #initialization } +{ #category : 'initialization' } SpAdapterBindings >> initialize [ super initialize. @@ -46,7 +48,7 @@ SpAdapterBindings >> initialize [ self initializeBindings ] -{ #category : #initialization } +{ #category : 'initialization' } SpAdapterBindings >> initializeBindings [ self allAdapters do: [ :each | @@ -59,7 +61,7 @@ SpAdapterBindings >> initializeBindings [ put: each name ] ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpAdapterBindings >> translateSymbol: aSymbol [ ^ bindings diff --git a/src/Spec2-Core/SpApplication.class.st b/src/Spec2-Core/SpApplication.class.st index f2c08bbff..892b5502c 100644 --- a/src/Spec2-Core/SpApplication.class.st +++ b/src/Spec2-Core/SpApplication.class.st @@ -42,8 +42,8 @@ MyApplication>>start " Class { - #name : #SpApplication, - #superclass : #Object, + #name : 'SpApplication', + #superclass : 'Object', #instVars : [ 'backend', 'windows', @@ -55,29 +55,31 @@ Class { #classVars : [ 'DefaultApplication' ], - #category : #'Spec2-Core-Base' + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #accessing } +{ #category : 'accessing' } SpApplication class >> defaultApplication [ ^ DefaultApplication ifNil: [ DefaultApplication := SpNullApplication new ] ] -{ #category : #private } +{ #category : 'private' } SpApplication class >> defaultApplication: anApplication [ "To be used for testing purposes" DefaultApplication := anApplication ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication class >> defaultBackendName [ ^ #Morphic ] -{ #category : #examples } +{ #category : 'examples' } SpApplication class >> example1 [ "This example shows how to change the backend of an application" | app | @@ -88,7 +90,7 @@ SpApplication class >> example1 [ app run ] -{ #category : #examples } +{ #category : 'examples' } SpApplication class >> example2 [ "This example shows how to change the backend of an application" | app | @@ -100,13 +102,13 @@ SpApplication class >> example2 [ app run ] -{ #category : #private } +{ #category : 'private' } SpApplication >> adapterBindings [ ^ self backend adapterBindings ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplication >> alert: aString [ "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." @@ -116,7 +118,7 @@ SpApplication >> alert: aString [ openModal ] -{ #category : #'accessing - backend' } +{ #category : 'accessing - backend' } SpApplication >> backend [ ^ backend ifNil: [ @@ -124,7 +126,7 @@ SpApplication >> backend [ backend ] ] -{ #category : #showing } +{ #category : 'showing' } SpApplication >> close [ self @@ -133,13 +135,13 @@ SpApplication >> close [ self closeAllWindows ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> closeAllWindows [ self windows do: [ :each | each close ] ] -{ #category : #'accessing - backend' } +{ #category : 'accessing - backend' } SpApplication >> configuration [ ^ configuration ifNil: [ @@ -147,7 +149,7 @@ SpApplication >> configuration [ configuration ] ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplication >> confirm: aString [ "Displays a confirm dialog, for more configurable version please use `self application newConfirm title: ....`." @@ -157,37 +159,37 @@ SpApplication >> confirm: aString [ openModal ] -{ #category : #showing } +{ #category : 'showing' } SpApplication >> defaultBlockedDialogWindowPresenterClass [ ^ SpBlockedDialogWindowPresenter ] -{ #category : #showing } +{ #category : 'showing' } SpApplication >> defaultDialogWindowPresenterClass [ ^ SpDialogWindowPresenter ] -{ #category : #showing } +{ #category : 'showing' } SpApplication >> defaultModalWindowPresenterClass [ ^ SpModalWindowPresenter ] -{ #category : #showing } +{ #category : 'showing' } SpApplication >> defaultWindowPresenterClass [ ^ SpWindowPresenter ] -{ #category : #ui } +{ #category : 'ui' } SpApplication >> defer: aBlock [ "doInUIThread: ?" self backend defer: aBlock ] -{ #category : #private } +{ #category : 'private' } SpApplication >> ensureBackend [ backend ifNotNil: [ ^ backend ]. @@ -195,7 +197,7 @@ SpApplication >> ensureBackend [ ^ backend ] -{ #category : #private } +{ #category : 'private' } SpApplication >> ensureConfiguration [ configuration ifNotNil: [ ^ configuration ]. @@ -205,50 +207,50 @@ SpApplication >> ensureConfiguration [ ^ configuration ] -{ #category : #ui } +{ #category : 'ui' } SpApplication >> forceDefer: aBlock [ "doInUIThread: ?" self backend forceDefer: aBlock ] -{ #category : #testing } +{ #category : 'testing' } SpApplication >> hasWindow: aWindow [ ^ self windows includes: aWindow ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpApplication >> iconManager [ "we have icon providers for this" ^ iconManager ifNil: [ iconManager := Smalltalk ui icons ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpApplication >> iconManager: anIconManager [ iconManager := anIconManager ] -{ #category : #'accessing - resources' } +{ #category : 'accessing - resources' } SpApplication >> iconNamed: aString [ ^ self iconProvider iconNamed: aString ] -{ #category : #'accessing - resources' } +{ #category : 'accessing - resources' } SpApplication >> iconProvider [ ^ iconProvider ifNil: [ iconProvider := self newIconProvider ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> iconProvider: anIconProvider [ iconProvider := anIconProvider ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplication >> inform: aString [ "Displays an inform dialog, for more configurable version please use `self application newInform title: ....`." @@ -258,51 +260,51 @@ SpApplication >> inform: aString [ openModal ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> locale [ ^ Locale current ] -{ #category : #factory } +{ #category : 'factory' } SpApplication >> new: aPresenter [ "a synonym for #newPresenter:" ^ self newPresenter: aPresenter ] -{ #category : #'private - factory' } +{ #category : 'private - factory' } SpApplication >> newIconProvider [ ^ SpPharoThemeIconProvider new ] -{ #category : #factory } +{ #category : 'factory' } SpApplication >> newPresenter: aPresenterClass [ ^ aPresenterClass newApplication: self ] -{ #category : #'ui - notifying' } +{ #category : 'ui - notifying' } SpApplication >> notify: aSpecNotification [ "how notifications are handled depends on the backend" aSpecNotification dispatchTo: self backend ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> properties [ ^ properties ifNil: [ properties := SmallDictionary new ] ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey [ ^ self properties at: aKey ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey ifAbsent: aBlock [ ^ self properties @@ -310,7 +312,7 @@ SpApplication >> propertyAt: aKey ifAbsent: aBlock [ ifAbsent: aBlock ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey ifAbsentPut: aBlock [ ^ self properties @@ -318,7 +320,7 @@ SpApplication >> propertyAt: aKey ifAbsentPut: aBlock [ ifAbsentPut: aBlock ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey ifPresent: aBlock [ ^ self properties @@ -326,7 +328,7 @@ SpApplication >> propertyAt: aKey ifPresent: aBlock [ ifPresent: aBlock ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey ifPresent: aBlock ifAbsent: absentBlock [ ^ self properties @@ -335,7 +337,7 @@ SpApplication >> propertyAt: aKey ifPresent: aBlock ifAbsent: absentBlock [ ifAbsent: absentBlock ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey ifPresent: aBlock ifAbsentPut: absentBlock [ ^ self properties @@ -344,7 +346,7 @@ SpApplication >> propertyAt: aKey ifPresent: aBlock ifAbsentPut: absentBlock [ ifAbsentPut: absentBlock ] -{ #category : #'accessing - properties' } +{ #category : 'accessing - properties' } SpApplication >> propertyAt: aKey put: aValue [ ^ self properties @@ -352,13 +354,13 @@ SpApplication >> propertyAt: aKey put: aValue [ put: aValue ] -{ #category : #private } +{ #category : 'private' } SpApplication >> registerWindow: aWindow [ self windows add: aWindow ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> reset [ self closeAllWindows. @@ -366,25 +368,25 @@ SpApplication >> reset [ self backend resetAdapterBindings ] -{ #category : #running } +{ #category : 'running' } SpApplication >> run [ self start ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplication >> selectDirectoryTitle: aString [ ^ self backend selectDirectoryTitle: aString ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplication >> selectFileTitle: aString [ ^ self backend selectFileTitle: aString ] -{ #category : #ui } +{ #category : 'ui' } SpApplication >> showWaitCursorWhile: aBlock [ self backend @@ -392,7 +394,7 @@ SpApplication >> showWaitCursorWhile: aBlock [ inApplication: self ] -{ #category : #running } +{ #category : 'running' } SpApplication >> start [ "This method is a hook automatically invoked. Override this method to start your application. Pay attention that this is your responsibility to configure the presenter you are opening @@ -408,7 +410,7 @@ SpApplication >> start [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> topWindow [ ^ self windows @@ -416,19 +418,19 @@ SpApplication >> topWindow [ ifNone: [ nil ] ] -{ #category : #private } +{ #category : 'private' } SpApplication >> unregisterWindow: aWindow [ self windows remove: aWindow ifAbsent: [ ] ] -{ #category : #'accessing - backend' } +{ #category : 'accessing - backend' } SpApplication >> useBackend: aName [ self useBackend: aName with: nil ] -{ #category : #'accessing - backend' } +{ #category : 'accessing - backend' } SpApplication >> useBackend: aName with: aConfiguration [ backend := SpApplicationBackend findBackendNamed: aName. @@ -436,13 +438,13 @@ SpApplication >> useBackend: aName with: aConfiguration [ configuration configure: self ] -{ #category : #windows } +{ #category : 'windows' } SpApplication >> windowClosed: aWindowPresenter [ self unregisterWindow: aWindowPresenter ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplication >> windows [ ^ windows ifNil: [ windows := Set new ] diff --git a/src/Spec2-Core/SpApplicationBackend.class.st b/src/Spec2-Core/SpApplicationBackend.class.st index 8e1b8459c..49599fa45 100644 --- a/src/Spec2-Core/SpApplicationBackend.class.st +++ b/src/Spec2-Core/SpApplicationBackend.class.st @@ -7,21 +7,23 @@ Backends define different things from an application: - ... " Class { - #name : #SpApplicationBackend, - #superclass : #Object, + #name : 'SpApplicationBackend', + #superclass : 'Object', #instVars : [ 'adapterBindings' ], - #category : #'Spec2-Core-Support' + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpApplicationBackend class >> backendName [ ^ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplicationBackend class >> findBackendNamed: aName [ ^ (self allSubclasses @@ -29,38 +31,38 @@ SpApplicationBackend class >> findBackendNamed: aName [ new ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplicationBackend >> adapterBindings [ ^ adapterBindings ] -{ #category : #private } +{ #category : 'private' } SpApplicationBackend >> adapterBindingsClass [ self subclassResponsibility ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplicationBackend >> defaultConfigurationFor: anApplication [ ^ self subclassResponsibility ] -{ #category : #initialization } +{ #category : 'initialization' } SpApplicationBackend >> initialize [ super initialize. self resetAdapterBindings ] -{ #category : #accessing } +{ #category : 'accessing' } SpApplicationBackend >> name [ ^ self class backendName ] -{ #category : #'ui - notifying' } +{ #category : 'ui - notifying' } SpApplicationBackend >> notify: aSpecNotification [ aSpecNotification type @@ -68,31 +70,31 @@ SpApplicationBackend >> notify: aSpecNotification [ on: self ] -{ #category : #'ui - notifying' } +{ #category : 'ui - notifying' } SpApplicationBackend >> notifyError: aSpecNotification [ self subclassResponsibility ] -{ #category : #'ui - notifying' } +{ #category : 'ui - notifying' } SpApplicationBackend >> notifyInfo: aSpecNotification [ self subclassResponsibility ] -{ #category : #initialization } +{ #category : 'initialization' } SpApplicationBackend >> resetAdapterBindings [ adapterBindings := self adapterBindingsClass new ] -{ #category : #'ui - dialogs' } +{ #category : 'ui - dialogs' } SpApplicationBackend >> selectFileTitle: aString [ self subclassResponsibility ] -{ #category : #ui } +{ #category : 'ui' } SpApplicationBackend >> showWaitCursorWhile: aBlock inApplication: anApplication [ self subclassResponsibility diff --git a/src/Spec2-Core/SpApplicationConfiguration.class.st b/src/Spec2-Core/SpApplicationConfiguration.class.st index ab169351e..3765d6425 100644 --- a/src/Spec2-Core/SpApplicationConfiguration.class.st +++ b/src/Spec2-Core/SpApplicationConfiguration.class.st @@ -10,12 +10,14 @@ A configuration takes the responsibility to prepare an application to run proper See also: `SpMorphicConfiguration` and `SpGtkConfiguration` " Class { - #name : #SpApplicationConfiguration, - #superclass : #Object, - #category : #'Spec2-Core-Base' + #name : 'SpApplicationConfiguration', + #superclass : 'Object', + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #configuring } +{ #category : 'configuring' } SpApplicationConfiguration >> configure: anApplication [ "Override this to add your application configuration" @@ -24,19 +26,19 @@ SpApplicationConfiguration >> configure: anApplication [ configuration: self ] -{ #category : #configuring } +{ #category : 'configuring' } SpApplicationConfiguration >> configureOSX: anApplication [ ] -{ #category : #configuring } +{ #category : 'configuring' } SpApplicationConfiguration >> configureUnix: anApplication [ ] -{ #category : #configuring } +{ #category : 'configuring' } SpApplicationConfiguration >> configureWindows: anApplication [ ] -{ #category : #initialization } +{ #category : 'initialization' } SpApplicationConfiguration >> reset [ "a hook to allow users to reset its configuration" ] diff --git a/src/Spec2-Core/SpAthensPresenter.class.st b/src/Spec2-Core/SpAthensPresenter.class.st index 1d0f9f124..8af8d4aa6 100644 --- a/src/Spec2-Core/SpAthensPresenter.class.st +++ b/src/Spec2-Core/SpAthensPresenter.class.st @@ -4,42 +4,44 @@ Users can draw their own vectorial images and render them as part of a Spec bas " Class { - #name : #SpAthensPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpAthensPresenter', + #superclass : 'SpAbstractWidgetPresenter', #traits : 'SpTContextMenu', #classTraits : 'SpTContextMenu classTrait', #instVars : [ '#drawBlock => ObservableSlot', '#surfaceExtent => ObservableSlot' ], - #category : #'Spec2-Core-Widgets-Athens' + #category : 'Spec2-Core-Widgets-Athens', + #package : 'Spec2-Core', + #tag : 'Widgets-Athens' } -{ #category : #specs } +{ #category : 'specs' } SpAthensPresenter class >> adapterName [ ^ #AthensAdapter ] -{ #category : #defaults } +{ #category : 'defaults' } SpAthensPresenter class >> defaultSurfaceExtent [ ^ 300@300 ] -{ #category : #documentation } +{ #category : 'documentation' } SpAthensPresenter class >> documentFactoryMethodSelector [ ^ #newAthens ] -{ #category : #api } +{ #category : 'api' } SpAthensPresenter >> drawBlock [ "Answer the block used to draw into an athens canvas." ^ drawBlock ] -{ #category : #api } +{ #category : 'api' } SpAthensPresenter >> drawBlock: aBlock [ "Set the block used to draw into the athens canvas. `aBlock` receives one argument, the `AthensCanvas` instance used to draw the surface. @@ -48,34 +50,34 @@ SpAthensPresenter >> drawBlock: aBlock [ drawBlock := aBlock ] -{ #category : #initialization } +{ #category : 'initialization' } SpAthensPresenter >> initialize [ super initialize. self surfaceExtent: self class defaultSurfaceExtent ] -{ #category : #api } +{ #category : 'api' } SpAthensPresenter >> redraw [ self withAdapterDo: [ :anAdapter | anAdapter redraw ] ] -{ #category : #api } +{ #category : 'api' } SpAthensPresenter >> surfaceExtent [ "Anwer the surface extent (the size the surface will have)" ^ surfaceExtent ] -{ #category : #api } +{ #category : 'api' } SpAthensPresenter >> surfaceExtent: anExtent [ "Set surface extent (a point) to contain the athens drawing." surfaceExtent := anExtent ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAthensPresenter >> whenDrawBlockChangedDo: aBlock [ "Inform when drawBlock has changed. `aBlock` has three optional arguments: @@ -86,7 +88,7 @@ SpAthensPresenter >> whenDrawBlockChangedDo: aBlock [ self property: #drawBlock whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpAthensPresenter >> whenExtentChangedDo: aBlock [ "Inform when the Athens surface extent has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpBaseEventDefinition.class.st b/src/Spec2-Core/SpBaseEventDefinition.class.st index 754b6161e..facfeeef9 100644 --- a/src/Spec2-Core/SpBaseEventDefinition.class.st +++ b/src/Spec2-Core/SpBaseEventDefinition.class.st @@ -4,31 +4,33 @@ My children will define (and install in an adaptor/widget) a specific kind of lo " Class { - #name : #SpBaseEventDefinition, - #superclass : #Object, + #name : 'SpBaseEventDefinition', + #superclass : 'Object', #instVars : [ 'action' ], - #category : #'Spec2-Core-Base-Event' + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #enumerating } +{ #category : 'enumerating' } SpBaseEventDefinition class >> do: aBlock [ ^ self new action: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpBaseEventDefinition >> action [ ^ action ] -{ #category : #accessing } +{ #category : 'accessing' } SpBaseEventDefinition >> action: anObject [ action := anObject ] -{ #category : #installing } +{ #category : 'installing' } SpBaseEventDefinition >> installOn: anAdapter target: aWidget [ self subclassResponsibility diff --git a/src/Spec2-Core/SpBindings.class.st b/src/Spec2-Core/SpBindings.class.st index 84f1da451..cb08d1e9c 100644 --- a/src/Spec2-Core/SpBindings.class.st +++ b/src/Spec2-Core/SpBindings.class.st @@ -8,12 +8,14 @@ Example: ``` " Class { - #name : #SpBindings, - #superclass : #DynamicVariable, - #category : #'Spec2-Core-Support' + #name : 'SpBindings', + #superclass : 'DynamicVariable', + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #accessing } +{ #category : 'accessing' } SpBindings >> default [ ^ (self class environment at: #SpMorphicAdapterBindings) new ] diff --git a/src/Spec2-Core/SpBlockedDialogWindowPresenter.class.st b/src/Spec2-Core/SpBlockedDialogWindowPresenter.class.st index fc4a31e3f..21257a7b7 100644 --- a/src/Spec2-Core/SpBlockedDialogWindowPresenter.class.st +++ b/src/Spec2-Core/SpBlockedDialogWindowPresenter.class.st @@ -27,12 +27,14 @@ SomePresenter >> initializeDialogWindow: aDialogPresenter ``` " Class { - #name : #SpBlockedDialogWindowPresenter, - #superclass : #SpDialogWindowPresenter, - #category : #'Spec2-Core-Windows' + #name : 'SpBlockedDialogWindowPresenter', + #superclass : 'SpDialogWindowPresenter', + #category : 'Spec2-Core-Windows', + #package : 'Spec2-Core', + #tag : 'Windows' } -{ #category : #specs } +{ #category : 'specs' } SpBlockedDialogWindowPresenter class >> adapterName [ ^ #BlockedDialogWindowAdapter ] diff --git a/src/Spec2-Core/SpButtonBarPresenter.class.st b/src/Spec2-Core/SpButtonBarPresenter.class.st index 0ccfd06a4..f82cfc779 100644 --- a/src/Spec2-Core/SpButtonBarPresenter.class.st +++ b/src/Spec2-Core/SpButtonBarPresenter.class.st @@ -4,28 +4,30 @@ A button bar can be used to provide a consistent layout of buttons throughout yo " Class { - #name : #SpButtonBarPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpButtonBarPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ 'items', 'placeAtStart' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpButtonBarPresenter class >> adapterName [ ^ #ButtonBarAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpButtonBarPresenter class >> documentFactoryMethodSelector [ ^ #newButtonBar ] -{ #category : #api } +{ #category : 'api' } SpButtonBarPresenter >> add: aButtonPresenter [ "Add `aButtonPresenter` to the button list." @@ -33,13 +35,13 @@ SpButtonBarPresenter >> add: aButtonPresenter [ items add: aButtonPresenter ] -{ #category : #testing } +{ #category : 'testing' } SpButtonBarPresenter >> canTakeKeyboardFocus [ ^ false ] -{ #category : #initialization } +{ #category : 'initialization' } SpButtonBarPresenter >> initialize [ super initialize. @@ -47,28 +49,28 @@ SpButtonBarPresenter >> initialize [ self placeAtEnd ] -{ #category : #testing } +{ #category : 'testing' } SpButtonBarPresenter >> isPlaceAtEnd [ "Answer when the button bar will place buttons at the end of the bar" ^ self isPlaceAtStart not ] -{ #category : #testing } +{ #category : 'testing' } SpButtonBarPresenter >> isPlaceAtStart [ "Answer when the button bar will place buttons at the start of the bar" ^ placeAtStart ] -{ #category : #api } +{ #category : 'api' } SpButtonBarPresenter >> items [ "Answer list of buttons." ^ items value ] -{ #category : #api } +{ #category : 'api' } SpButtonBarPresenter >> items: aCollectionOfButtonPresenters [ "Set buttons to show, taking elements in `aCollectionOfButtonPresenters`." @@ -78,21 +80,21 @@ SpButtonBarPresenter >> items: aCollectionOfButtonPresenters [ items addAll: aCollectionOfButtonPresenters ] -{ #category : #api } +{ #category : 'api' } SpButtonBarPresenter >> placeAtEnd [ "Indicate the button bar will place buttons at the end of the bar (arranged to the right)" placeAtStart := false ] -{ #category : #api } +{ #category : 'api' } SpButtonBarPresenter >> placeAtStart [ "Indicate the button bar will place buttons at the start of the bar (arranged to the left)" placeAtStart := true ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpButtonBarPresenter >> presenters [ ^ self items diff --git a/src/Spec2-Core/SpButtonPresenter.class.st b/src/Spec2-Core/SpButtonPresenter.class.st index 78b60279b..29e0ad86e 100644 --- a/src/Spec2-Core/SpButtonPresenter.class.st +++ b/src/Spec2-Core/SpButtonPresenter.class.st @@ -3,8 +3,8 @@ A button who executes an action when pressed. " Class { - #name : #SpButtonPresenter, - #superclass : #SpAbstractButtonPresenter, + #name : 'SpButtonPresenter', + #superclass : 'SpAbstractButtonPresenter', #traits : 'SpTContextMenu', #classTraits : 'SpTContextMenu classTrait', #instVars : [ @@ -15,35 +15,37 @@ Class { '#shortcut => ObservableSlot', '#state => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpButtonPresenter class >> adapterName [ ^ #ButtonAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpButtonPresenter class >> documentFactoryMethodSelector [ ^ #newButton ] -{ #category : #specs } +{ #category : 'specs' } SpButtonPresenter class >> title [ ^ 'Button' ] -{ #category : #api } +{ #category : 'api' } SpButtonPresenter >> action [ "Answer the block performed when the button is clicked." ^ action ] -{ #category : #api } +{ #category : 'api' } SpButtonPresenter >> action: aBlock [ "Set the block performed when the button is clicked. `aBlock` receives zero arguments." @@ -51,17 +53,17 @@ SpButtonPresenter >> action: aBlock [ action := aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> askBeforeChanging [ ^ askBeforeChanging ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> askBeforeChanging: aBoolean [ askBeforeChanging := aBoolean ] -{ #category : #simulating } +{ #category : 'simulating' } SpButtonPresenter >> click [ "I emulate the click from the presenter point of view. @@ -72,24 +74,24 @@ SpButtonPresenter >> click [ ^ self performAction ] -{ #category : #'private - focus' } +{ #category : 'private - focus' } SpButtonPresenter >> ensureKeyBindingsFor: widget [ super ensureKeyBindingsFor: widget. self shortcut ifNotNil: [ :s | self registerShortcut: s ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> font [ ^ font ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> font: aFont [ font := aFont ] -{ #category : #initialization } +{ #category : 'initialization' } SpButtonPresenter >> initialize [ super initialize. @@ -114,7 +116,7 @@ SpButtonPresenter >> initialize [ self color: nil ] -{ #category : #private } +{ #category : 'private' } SpButtonPresenter >> performAction [ self action value. @@ -122,7 +124,7 @@ SpButtonPresenter >> performAction [ actionPerformed := nil ] -{ #category : #private } +{ #category : 'private' } SpButtonPresenter >> registerShortcut: newShortcut [ | receiver | @@ -133,14 +135,14 @@ SpButtonPresenter >> registerShortcut: newShortcut [ toAction: [ self performAction ] ] -{ #category : #api } +{ #category : 'api' } SpButtonPresenter >> shortcut [ "Answer the shortcut used to trigger button's action from keyboard." ^ shortcut ] -{ #category : #api } +{ #category : 'api' } SpButtonPresenter >> shortcut: aShortcut [ "Set the shortcut used to trigger button's action from keyboard. `aShortcut` needs to be an instance of `KMKeyCombination` (or polymorphic with it), @@ -149,27 +151,27 @@ SpButtonPresenter >> shortcut: aShortcut [ shortcut := aShortcut ] -{ #category : #private } +{ #category : 'private' } SpButtonPresenter >> shortcutCharacter [ ^ self shortcut ifNotNil: [ :s | s platformCharacter ] ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> state [ self flag: #TODO. "To remove or move to morphic extension" ^ state ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> state: aBoolean [ "set if the button is highlighted" state := aBoolean ] -{ #category : #private } +{ #category : 'private' } SpButtonPresenter >> unregisterShortcut: oldShortcut [ | receiver | receiver := self window. @@ -179,7 +181,7 @@ SpButtonPresenter >> unregisterShortcut: oldShortcut [ removeKeyCombination: oldShortcut ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpButtonPresenter >> whenActionChangedDo: aBlock [ "Inform when action block has been changed. `aBlock` receives two optional arguments: @@ -189,7 +191,7 @@ SpButtonPresenter >> whenActionChangedDo: aBlock [ self property: #action whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpButtonPresenter >> whenActionPerformedDo: aBlock [ "Inform that the button has been aclicked, and its action has been performed. `aBlock` receive zero arguments." @@ -197,7 +199,7 @@ SpButtonPresenter >> whenActionPerformedDo: aBlock [ self property: #actionPerformed whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpButtonPresenter >> whenActivatedDo: aBlock [ "Inform that the button has been aclicked, and its action has been performed. `aBlock` receive zero arguments. @@ -206,14 +208,14 @@ SpButtonPresenter >> whenActivatedDo: aBlock [ ^ self whenActionPerformedDo: aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> whenFontChangedDo: aBlock [ "set a block to perform after that the button has been aclicked, and its action performed" self property: #font whenChangedDo: aBlock ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpButtonPresenter >> whenStateChangedDo: aBlock [ "set a block to perform after that the button has been aclicked, and its action performed" diff --git a/src/Spec2-Core/SpCheckBoxPresenter.class.st b/src/Spec2-Core/SpCheckBoxPresenter.class.st index 99960a415..360761d8c 100644 --- a/src/Spec2-Core/SpCheckBoxPresenter.class.st +++ b/src/Spec2-Core/SpCheckBoxPresenter.class.st @@ -3,36 +3,38 @@ A Checkbox Button that can be activated/deactivated. " Class { - #name : #SpCheckBoxPresenter, - #superclass : #SpAbstractFormButtonPresenter, - #category : #'Spec2-Core-Widgets' + #name : 'SpCheckBoxPresenter', + #superclass : 'SpAbstractFormButtonPresenter', + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpCheckBoxPresenter class >> adapterName [ ^ #CheckBoxAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpCheckBoxPresenter class >> documentFactoryMethodSelector [ ^ #newCheckBox ] -{ #category : #specs } +{ #category : 'specs' } SpCheckBoxPresenter class >> title [ ^ 'Checkbox Button' ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpCheckBoxPresenter >> labelOnLeft [ ^ self changed: #labelOnLeft with: #() ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpCheckBoxPresenter >> labelOnRight [ ^ self changed: #labelOnRight with: #() diff --git a/src/Spec2-Core/SpCheckBoxTableColumn.class.st b/src/Spec2-Core/SpCheckBoxTableColumn.class.st index e17da2d5d..abde89723 100644 --- a/src/Spec2-Core/SpCheckBoxTableColumn.class.st +++ b/src/Spec2-Core/SpCheckBoxTableColumn.class.st @@ -11,29 +11,31 @@ SpCheckBoxTableColumn ``` " Class { - #name : #SpCheckBoxTableColumn, - #superclass : #SpTableColumn, + #name : 'SpCheckBoxTableColumn', + #superclass : 'SpTableColumn', #instVars : [ 'onActivation', 'onDeactivation' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #visiting } +{ #category : 'visiting' } SpCheckBoxTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitCheckboxColumn: self ] -{ #category : #api } +{ #category : 'api' } SpCheckBoxTableColumn >> onActivation [ "Answer the block to be executed when a checkbox is activated (marked)" ^ onActivation ] -{ #category : #api } +{ #category : 'api' } SpCheckBoxTableColumn >> onActivation: aBlock [ "Set the block to be executed when a checkbox is activated (marked). `aBlock` receives one argument, the element in which the checkbox acts." @@ -41,14 +43,14 @@ SpCheckBoxTableColumn >> onActivation: aBlock [ onActivation := aBlock ] -{ #category : #api } +{ #category : 'api' } SpCheckBoxTableColumn >> onDeactivation [ "Answer the block to be executed when a checkbox is deactivated (unmarked)" ^ onDeactivation ] -{ #category : #api } +{ #category : 'api' } SpCheckBoxTableColumn >> onDeactivation: aBlock [ "Set the block to be executed when a checkbox is deactivated (unmarked). `aBlock` receives one argument, the element in which the checkbox acts." diff --git a/src/Spec2-Core/SpCollectionListModel.class.st b/src/Spec2-Core/SpCollectionListModel.class.st index 39264cb46..9889f3183 100644 --- a/src/Spec2-Core/SpCollectionListModel.class.st +++ b/src/Spec2-Core/SpCollectionListModel.class.st @@ -4,8 +4,8 @@ A collection model to be used with list presenters (`SpAbstractListPresenter` an This model receives a `collection` of elements to be served to the list. " Class { - #name : #SpCollectionListModel, - #superclass : #Object, + #name : 'SpCollectionListModel', + #superclass : 'Object', #traits : 'TObservable', #classTraits : 'TObservable classTrait', #instVars : [ @@ -13,10 +13,12 @@ Class { '#collection', '#sorting => ObservableSlot' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCollectionListModel class >> on: aCollection [ ^ self new @@ -24,7 +26,7 @@ SpCollectionListModel class >> on: aCollection [ yourself ] -{ #category : #adding } +{ #category : 'adding' } SpCollectionListModel >> add: anItem [ collection := collection copyWith: anItem. @@ -34,30 +36,30 @@ SpCollectionListModel >> add: anItem [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> announcer [ ^ announcer ifNil: [ announcer := Announcer new ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> at: anIndex [ ^ collection at: anIndex ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> at: anIndex ifAbsent: aBlock [ ^ collection at: anIndex ifAbsent: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> collection [ ^ collection ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> collection: anObject [ | oldValue | @@ -70,43 +72,43 @@ SpCollectionListModel >> collection: anObject [ newValue: collection) ] -{ #category : #testing } +{ #category : 'testing' } SpCollectionListModel >> hasElementAt: index [ ^ self size >= index ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> indexOf: anIndex ifAbsent: aBlock [ ^ collection indexOf: anIndex ifAbsent: aBlock ] -{ #category : #initialization } +{ #category : 'initialization' } SpCollectionListModel >> initialize [ self class initializeSlots: self. super initialize ] -{ #category : #testing } +{ #category : 'testing' } SpCollectionListModel >> isEmpty [ ^ collection isEmpty ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> items [ ^ collection ] -{ #category : #refreshing } +{ #category : 'refreshing' } SpCollectionListModel >> refreshList [ self sortingBlock ifNotNil: [ :aSortFunction | collection := collection sorted: aSortFunction ] ] -{ #category : #collection } +{ #category : 'collection' } SpCollectionListModel >> removeAll [ collection := #(). @@ -116,24 +118,24 @@ SpCollectionListModel >> removeAll [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpCollectionListModel >> size [ ^ collection size ] -{ #category : #initialization } +{ #category : 'initialization' } SpCollectionListModel >> sortingBlock [ ^ sorting ] -{ #category : #initialization } +{ #category : 'initialization' } SpCollectionListModel >> sortingBlock: aBlock [ sorting := aBlock. self refreshList ] -{ #category : #events } +{ #category : 'events' } SpCollectionListModel >> whenChangedDo: aBlock [ self announcer @@ -146,7 +148,7 @@ SpCollectionListModel >> whenChangedDo: aBlock [ for: self ] -{ #category : #events } +{ #category : 'events' } SpCollectionListModel >> whenSortingBlockChangedDo: aBlock [ self property: #sorting whenChangedDo: aBlock diff --git a/src/Spec2-Core/SpColumnAlignment.class.st b/src/Spec2-Core/SpColumnAlignment.class.st index 2f01245e2..11e1155c0 100644 --- a/src/Spec2-Core/SpColumnAlignment.class.st +++ b/src/Spec2-Core/SpColumnAlignment.class.st @@ -1,37 +1,39 @@ Class { - #name : #SpColumnAlignment, - #superclass : #Object, + #name : 'SpColumnAlignment', + #superclass : 'Object', #classInstVars : [ 'uniqueInstance' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #accessing } +{ #category : 'accessing' } SpColumnAlignment class >> center [ ^ SpColumnAlignmentCenter uniqueInstance ] -{ #category : #accessing } +{ #category : 'accessing' } SpColumnAlignment class >> left [ ^ SpColumnAlignmentLeft uniqueInstance ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpColumnAlignment class >> new [ self error: 'Use #uniqueInstance' ] -{ #category : #accessing } +{ #category : 'accessing' } SpColumnAlignment class >> right [ ^ SpColumnAlignmentRight uniqueInstance ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpColumnAlignment class >> uniqueInstance [ self = SpColumnAlignment diff --git a/src/Spec2-Core/SpColumnAlignmentCenter.class.st b/src/Spec2-Core/SpColumnAlignmentCenter.class.st index ef8c106f2..b12887437 100644 --- a/src/Spec2-Core/SpColumnAlignmentCenter.class.st +++ b/src/Spec2-Core/SpColumnAlignmentCenter.class.st @@ -1,5 +1,7 @@ Class { - #name : #SpColumnAlignmentCenter, - #superclass : #SpColumnAlignment, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpColumnAlignmentCenter', + #superclass : 'SpColumnAlignment', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } diff --git a/src/Spec2-Core/SpColumnAlignmentLeft.class.st b/src/Spec2-Core/SpColumnAlignmentLeft.class.st index b4cdfcc5b..7bf3d2809 100644 --- a/src/Spec2-Core/SpColumnAlignmentLeft.class.st +++ b/src/Spec2-Core/SpColumnAlignmentLeft.class.st @@ -1,5 +1,7 @@ Class { - #name : #SpColumnAlignmentLeft, - #superclass : #SpColumnAlignment, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpColumnAlignmentLeft', + #superclass : 'SpColumnAlignment', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } diff --git a/src/Spec2-Core/SpColumnAlignmentRight.class.st b/src/Spec2-Core/SpColumnAlignmentRight.class.st index 8f1f6bf8e..1cdd4d5c2 100644 --- a/src/Spec2-Core/SpColumnAlignmentRight.class.st +++ b/src/Spec2-Core/SpColumnAlignmentRight.class.st @@ -1,5 +1,7 @@ Class { - #name : #SpColumnAlignmentRight, - #superclass : #SpColumnAlignment, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpColumnAlignmentRight', + #superclass : 'SpColumnAlignment', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } diff --git a/src/Spec2-Core/SpComponentListPresenter.class.st b/src/Spec2-Core/SpComponentListPresenter.class.st index e3775fa62..f7dbce815 100644 --- a/src/Spec2-Core/SpComponentListPresenter.class.st +++ b/src/Spec2-Core/SpComponentListPresenter.class.st @@ -4,30 +4,32 @@ When you do not have a list of elements that can be presented as a single list o " Class { - #name : #SpComponentListPresenter, - #superclass : #SpAbstractListPresenter, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpComponentListPresenter', + #superclass : 'SpAbstractListPresenter', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #specs } +{ #category : 'specs' } SpComponentListPresenter class >> adapterName [ ^ #ComponentListAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpComponentListPresenter class >> documentFactoryMethodSelector [ ^ #newComponentList ] -{ #category : #initialization } +{ #category : 'initialization' } SpComponentListPresenter >> addPresenter: aPresenter [ aPresenter owner: self. self model add: aPresenter ] -{ #category : #private } +{ #category : 'private' } SpComponentListPresenter >> doActivateAtIndex: index [ "Activate only if there is an item at that position" @@ -38,21 +40,21 @@ SpComponentListPresenter >> doActivateAtIndex: index [ yourself) ] -{ #category : #testing } +{ #category : 'testing' } SpComponentListPresenter >> includes: aPresenter [ "Answer true when the presenter includes `aPresenter` as part of its items." ^ self presenters includes: aPresenter ] -{ #category : #testing } +{ #category : 'testing' } SpComponentListPresenter >> isEmpty [ "Answer true if presenter list is empty." ^ self presenters isEmpty ] -{ #category : #api } +{ #category : 'api' } SpComponentListPresenter >> items: aSequenceableCollection [ "Set the items of the list. `aSequenceableCollection` is a list of presenters OR a list of elements that understand @@ -64,7 +66,7 @@ SpComponentListPresenter >> items: aSequenceableCollection [ yourself ]) ] -{ #category : #api } +{ #category : 'api' } SpComponentListPresenter >> presenters [ "Answer the presenters of the list. This is a synonym of `SpAbstractListPresenter>>#items`" @@ -72,7 +74,7 @@ SpComponentListPresenter >> presenters [ ^ self items ] -{ #category : #api } +{ #category : 'api' } SpComponentListPresenter >> presenters: aSequenceableCollection [ "Set the list of presenters that will be the items to show in the component list. This is a synonym of `SpAbstractListPresenter>>#items:` @@ -81,7 +83,7 @@ SpComponentListPresenter >> presenters: aSequenceableCollection [ ^ self items: aSequenceableCollection ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpComponentListPresenter >> whenPresentersChangedDo: aBlock [ "Inform when the presenter list changed (See `SpComponentListPresenter>>#presenters:`. `aBlock` receive 3 optional arguments: diff --git a/src/Spec2-Core/SpCompositeIconProvider.class.st b/src/Spec2-Core/SpCompositeIconProvider.class.st index b82f3498c..bd9b91aa7 100644 --- a/src/Spec2-Core/SpCompositeIconProvider.class.st +++ b/src/Spec2-Core/SpCompositeIconProvider.class.st @@ -8,28 +8,30 @@ A typical usage is: ``` " Class { - #name : #SpCompositeIconProvider, - #superclass : #SpIconProvider, + #name : 'SpCompositeIconProvider', + #superclass : 'SpIconProvider', #instVars : [ 'providers' ], - #category : #'Spec2-Core-IconProvider' + #category : 'Spec2-Core-IconProvider', + #package : 'Spec2-Core', + #tag : 'IconProvider' } -{ #category : #copying } +{ #category : 'copying' } SpCompositeIconProvider >> , aProvider [ self addProvider: aProvider. ^ self ] -{ #category : #accessing } +{ #category : 'accessing' } SpCompositeIconProvider >> addProvider: anIconProvider [ providers := providers copyWith: anIconProvider ] -{ #category : #accessing } +{ #category : 'accessing' } SpCompositeIconProvider >> iconNamed: aName ifAbsent: aBlock [ self providers do: [ :each | @@ -39,14 +41,14 @@ SpCompositeIconProvider >> iconNamed: aName ifAbsent: aBlock [ ^ aBlock value ] -{ #category : #initialization } +{ #category : 'initialization' } SpCompositeIconProvider >> initialize [ super initialize. providers := #() ] -{ #category : #accessing } +{ #category : 'accessing' } SpCompositeIconProvider >> providers [ ^ providers diff --git a/src/Spec2-Core/SpCompositeTableColumn.class.st b/src/Spec2-Core/SpCompositeTableColumn.class.st index 66ea3a5eb..3ebbc0222 100644 --- a/src/Spec2-Core/SpCompositeTableColumn.class.st +++ b/src/Spec2-Core/SpCompositeTableColumn.class.st @@ -24,15 +24,17 @@ SpCompositeTableColumn new ``` " Class { - #name : #SpCompositeTableColumn, - #superclass : #SpTableColumn, + #name : 'SpCompositeTableColumn', + #superclass : 'SpTableColumn', #instVars : [ 'columns' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCompositeTableColumn class >> title: aString withAll: aCollection [ ^ self new @@ -41,7 +43,7 @@ SpCompositeTableColumn class >> title: aString withAll: aCollection [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCompositeTableColumn class >> with: column [ ^ self new @@ -49,7 +51,7 @@ SpCompositeTableColumn class >> with: column [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCompositeTableColumn class >> with: column1 with: column2 [ ^ self new @@ -58,7 +60,7 @@ SpCompositeTableColumn class >> with: column1 with: column2 [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCompositeTableColumn class >> with: column1 with: column2 with: column3 [ ^ self new @@ -68,7 +70,7 @@ SpCompositeTableColumn class >> with: column1 with: column2 with: column3 [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpCompositeTableColumn class >> withAll: aCollection [ ^ self new @@ -76,34 +78,34 @@ SpCompositeTableColumn class >> withAll: aCollection [ yourself ] -{ #category : #visiting } +{ #category : 'visiting' } SpCompositeTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitCompositeColumn: self ] -{ #category : #api } +{ #category : 'api' } SpCompositeTableColumn >> addAllColumns: aCollection [ "Add all columns contained in `aCollection` to the composed columns." aCollection do: [ :each | self addColumn: each ] ] -{ #category : #api } +{ #category : 'api' } SpCompositeTableColumn >> addColumn: aTableColumn [ "Add a column to the composed columns." columns add: aTableColumn ] -{ #category : #api } +{ #category : 'api' } SpCompositeTableColumn >> columns [ "Answer the columns composing this composite." ^ columns ] -{ #category : #initialization } +{ #category : 'initialization' } SpCompositeTableColumn >> initialize [ super initialize. @@ -111,7 +113,7 @@ SpCompositeTableColumn >> initialize [ columns := OrderedCollection new: 2 ] -{ #category : #testing } +{ #category : 'testing' } SpCompositeTableColumn >> isComposite [ "Answer if this is a composite column. For this class, answer will always be true." diff --git a/src/Spec2-Core/SpDialogWindowPresenter.class.st b/src/Spec2-Core/SpDialogWindowPresenter.class.st index 27cb1de51..3b0d83bd0 100644 --- a/src/Spec2-Core/SpDialogWindowPresenter.class.st +++ b/src/Spec2-Core/SpDialogWindowPresenter.class.st @@ -29,8 +29,8 @@ SomePresenter >> initializeDialogWindow: aDialogPresenter ``` " Class { - #name : #SpDialogWindowPresenter, - #superclass : #SpWindowPresenter, + #name : 'SpDialogWindowPresenter', + #superclass : 'SpWindowPresenter', #instVars : [ 'buttons', 'okAction', @@ -38,23 +38,25 @@ Class { 'cancelled', 'defaultButton' ], - #category : #'Spec2-Core-Windows' + #category : 'Spec2-Core-Windows', + #package : 'Spec2-Core', + #tag : 'Windows' } -{ #category : #specs } +{ #category : 'specs' } SpDialogWindowPresenter class >> adapterName [ ^ #DialogWindowAdapter ] -{ #category : #private } +{ #category : 'private' } SpDialogWindowPresenter >> addButton: aButtonPresenter [ buttons add: aButtonPresenter. ^ aButtonPresenter ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> addButton: aString do: aBlock [ "Adds button logic to dialog. This method will add a standard button to the button bar of the dialog, having `aString` @@ -71,7 +73,7 @@ SpDialogWindowPresenter >> addButton: aString do: aBlock [ yourself) ] -{ #category : #private } +{ #category : 'private' } SpDialogWindowPresenter >> addDefaultButton: aButtonPresenter [ "Adds button logic to dialog." @@ -80,7 +82,7 @@ SpDialogWindowPresenter >> addDefaultButton: aButtonPresenter [ ^ defaultButton ] -{ #category : #NOTUSED } +{ #category : 'NOTUSED' } SpDialogWindowPresenter >> addDefaultButton: aString do: aBlock [ "Adds button logic to dialog." @@ -89,7 +91,7 @@ SpDialogWindowPresenter >> addDefaultButton: aString do: aBlock [ ^ defaultButton ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> beCancel [ "Set the status of this dialog as 'cancelled'. See `SpDialogWindowPresenter>>#isCancelled`" @@ -97,7 +99,7 @@ SpDialogWindowPresenter >> beCancel [ cancelled := true ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> beOk [ "Set the status of this dialog as 'Ok'. See `SpDialogWindowPresenter>>#isOk`" @@ -105,7 +107,7 @@ SpDialogWindowPresenter >> beOk [ cancelled := false ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> buttons [ "Answer an OrderedCollection that contains all defined buttons. Default action will always be the last one." @@ -115,7 +117,7 @@ SpDialogWindowPresenter >> buttons [ ^ buttons ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> cancelAction [ "Answer the defined cancel action (the one that is executed when pressed 'cancel' button by default). In initialization phase, cancel action is defined as: @@ -129,14 +131,14 @@ SpDialogWindowPresenter >> cancelAction [ ^ cancelAction ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> cancelAction: aBlock [ "Set the action to execute when 'cancel' button is pressed." cancelAction := aBlock ] -{ #category : #testing } +{ #category : 'testing' } SpDialogWindowPresenter >> cancelled [ "Answer true if dialog has been cancelled. This is a synonym of `SpDialogWindowPresenter>>#cancelled`" @@ -144,14 +146,14 @@ SpDialogWindowPresenter >> cancelled [ ^ cancelled ] -{ #category : #private } +{ #category : 'private' } SpDialogWindowPresenter >> executeDefaultAction [ defaultButton ifNil: [ ^ self ]. defaultButton action cull: self ] -{ #category : #initialization } +{ #category : 'initialization' } SpDialogWindowPresenter >> initialize [ super initialize. @@ -160,7 +162,7 @@ SpDialogWindowPresenter >> initialize [ self initializeDefaultActions ] -{ #category : #initialization } +{ #category : 'initialization' } SpDialogWindowPresenter >> initializeDefaultActions [ "default ok/cancel actions. this is just for backwards compatibility" @@ -172,14 +174,14 @@ SpDialogWindowPresenter >> initializeDefaultActions [ self close ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpDialogWindowPresenter >> initializeWindow [ super initializeWindow. self presenter initializeDialogWindow: self ] -{ #category : #testing } +{ #category : 'testing' } SpDialogWindowPresenter >> isButtonEnabled: aButtonName [ | button | button := self buttons detect: [ :aButton | aButton label = aButtonName ]. @@ -187,27 +189,27 @@ SpDialogWindowPresenter >> isButtonEnabled: aButtonName [ ] -{ #category : #testing } +{ #category : 'testing' } SpDialogWindowPresenter >> isCancelled [ "Answer true if dialog has been cancelled." ^ cancelled ] -{ #category : #testing } +{ #category : 'testing' } SpDialogWindowPresenter >> isDialog [ ^ true ] -{ #category : #testing } +{ #category : 'testing' } SpDialogWindowPresenter >> isOk [ "Answer true if dialog has been accepted." ^ self isCancelled not ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> okAction [ "Answer the defined ok action (the one that is executed when pressed 'ok' button by default). In initialization phase, ok action is defined as: @@ -221,14 +223,14 @@ SpDialogWindowPresenter >> okAction [ ^ okAction ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> okAction: aBlock [ "Set the action to execute when 'ok' button is pressed." okAction := aBlock ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpDialogWindowPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ super traverseInFocusOrderDo: aBlock excluding: excludes. @@ -236,7 +238,7 @@ SpDialogWindowPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ each traverseInFocusOrderDo: aBlock excluding: excludes ] ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> triggerCancelAction [ "Trigger defined cancel action. See `SpDialogWindowPresenter>>#cancelAction:`" @@ -245,7 +247,7 @@ SpDialogWindowPresenter >> triggerCancelAction [ cancelAction cull: self ] -{ #category : #api } +{ #category : 'api' } SpDialogWindowPresenter >> triggerOkAction [ "Trigger defined ok action. See `SpDialogWindowPresenter>>#okAction:`" diff --git a/src/Spec2-Core/SpDiffPresenter.class.st b/src/Spec2-Core/SpDiffPresenter.class.st index 7dec6f79d..f867bccd9 100644 --- a/src/Spec2-Core/SpDiffPresenter.class.st +++ b/src/Spec2-Core/SpDiffPresenter.class.st @@ -9,8 +9,8 @@ self exampleWithoutOptions. self exampleWithOptions. " Class { - #name : #SpDiffPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpDiffPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#showOptions => ObservableSlot', '#showOnlyDestination => ObservableSlot', @@ -22,43 +22,45 @@ Class { '#rightText => ObservableSlot', '#beWrapped => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpDiffPresenter class >> adapterName [ ^ #DiffAdapter ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> beWrapped [ ^ beWrapped ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> beWrapped: aBoolean [ beWrapped := aBoolean ] -{ #category : #'undo-redo' } +{ #category : 'undo-redo' } SpDiffPresenter >> clearUndoManager [ "The diff presenter does not allow edition, it does not have undo history. But this message is added to have polimorphism in the Message Browser" ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> contextClass [ ^ contextClass ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> contextClass: anObject [ contextClass := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } SpDiffPresenter >> initialize [ super initialize. @@ -80,79 +82,79 @@ SpDiffPresenter >> initialize [ self property: #rightLabel whenChangedDo: [ :newText | self changed: #rightLabel: with: {newText} ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> leftLabel [ ^ leftLabel ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> leftLabel: anObject [ leftLabel := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> leftText [ ^ leftText ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> leftText: anObject [ leftText := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> rightLabel [ ^ rightLabel ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> rightLabel: anObject [ rightLabel := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> rightText [ ^ rightText ] -{ #category : #accessing } +{ #category : 'accessing' } SpDiffPresenter >> rightText: anObject [ rightText := anObject ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showBoth [ self property: #showOnlySource rawValue: false. self property: #showOnlyDestination rawValue: false. self changed: #showBoth with: {} ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOnlyDestination [ ^ showOnlyDestination ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOnlyDestination: aBoolean [ showOnlyDestination := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOnlySource [ ^ showOnlySource ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOnlySource: aBoolean [ showOnlySource := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOptions [ ^ showOptions ] -{ #category : #api } +{ #category : 'api' } SpDiffPresenter >> showOptions: aBoolean [ showOptions := aBoolean ] diff --git a/src/Spec2-Core/SpDocumentHierarchyBuilder.class.st b/src/Spec2-Core/SpDocumentHierarchyBuilder.class.st index 562fe9f24..941d82278 100644 --- a/src/Spec2-Core/SpDocumentHierarchyBuilder.class.st +++ b/src/Spec2-Core/SpDocumentHierarchyBuilder.class.st @@ -16,8 +16,8 @@ SpDocumentHierarchyBuilder new ``` " Class { - #name : #SpDocumentHierarchyBuilder, - #superclass : #Object, + #name : 'SpDocumentHierarchyBuilder', + #superclass : 'Object', #instVars : [ 'topClass', 'flattenTree', @@ -26,10 +26,12 @@ Class { 'class', 'fromClass' ], - #category : #'Spec2-Core-Utils' + #category : 'Spec2-Core-Utils', + #package : 'Spec2-Core', + #tag : 'Utils' } -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> addLevel: level from: aClass [ "'├ ─ ╰ │'" | path | @@ -61,7 +63,7 @@ SpDocumentHierarchyBuilder >> addLevel: level from: aClass [ from: each ] ] -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> addLevel: level from: aClass to: stream [ "'├ ─ ╰ │'" | path | @@ -90,14 +92,14 @@ SpDocumentHierarchyBuilder >> addLevel: level from: aClass to: stream [ to: stream ] ] -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> applyFilterTo: aCollection [ filterBlock ifNil: [ ^ aCollection ]. ^ aCollection select: filterBlock ] -{ #category : #building } +{ #category : 'building' } SpDocumentHierarchyBuilder >> buildFor: aClass [ self fillTreeOf: aClass. @@ -106,7 +108,7 @@ SpDocumentHierarchyBuilder >> buildFor: aClass [ from: self fromClass ] -{ #category : #building } +{ #category : 'building' } SpDocumentHierarchyBuilder >> buildStringFor: aClass [ self fillTreeOf: aClass. @@ -117,13 +119,13 @@ SpDocumentHierarchyBuilder >> buildStringFor: aClass [ to: (ZnNewLineWriterStream on: stream) ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> builder: aBuilder [ builder := aBuilder ] -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> fillTreeOf: aClass [ class := aClass. @@ -134,7 +136,7 @@ SpDocumentHierarchyBuilder >> fillTreeOf: aClass [ ^ flattenTree ] -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> fillTreeWithSubclassesOf: aClass [ flattenTree at: aClass put: (self applyFilterTo: aClass subclasses). @@ -142,7 +144,7 @@ SpDocumentHierarchyBuilder >> fillTreeWithSubclassesOf: aClass [ self fillTreeWithSubclassesOf: each ] ] -{ #category : #private } +{ #category : 'private' } SpDocumentHierarchyBuilder >> fillTreeWithSuperclassesOf: aClass [ | superclasses | @@ -156,25 +158,25 @@ SpDocumentHierarchyBuilder >> fillTreeWithSuperclassesOf: aClass [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> filter: aBlock [ filterBlock := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> fromClass [ ^ fromClass ifNil: [ SpAbstractPresenter ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> fromClass: aClass [ fromClass := aClass ] -{ #category : #testing } +{ #category : 'testing' } SpDocumentHierarchyBuilder >> isPassingThrough: aClass topLevel: aTopClass [ | superclasses | @@ -185,13 +187,13 @@ SpDocumentHierarchyBuilder >> isPassingThrough: aClass topLevel: aTopClass [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> topClass [ ^ topClass ifNil: [ self fromClass superclass ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDocumentHierarchyBuilder >> topClass: aClass [ topClass := aClass diff --git a/src/Spec2-Core/SpDropListItem.class.st b/src/Spec2-Core/SpDropListItem.class.st index eb1bd0f72..9302ee5b0 100644 --- a/src/Spec2-Core/SpDropListItem.class.st +++ b/src/Spec2-Core/SpDropListItem.class.st @@ -2,18 +2,20 @@ A DropListItem is an item (wrapper) designed to fit into a DropList. " Class { - #name : #SpDropListItem, - #superclass : #Object, + #name : 'SpDropListItem', + #superclass : 'Object', #instVars : [ 'model', 'displayBlock', 'icon', 'action' ], - #category : #'Spec2-Core-Support' + #category : 'Spec2-Core-Support', + #package : 'Spec2-Core', + #tag : 'Support' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpDropListItem class >> named: label do: aBlock [ ^ self new @@ -23,7 +25,7 @@ SpDropListItem class >> named: label do: aBlock [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpDropListItem class >> on: anObject do: aBlock [ ^ self new @@ -32,7 +34,7 @@ SpDropListItem class >> on: anObject do: aBlock [ yourself ] -{ #category : #comparing } +{ #category : 'comparing' } SpDropListItem >> = anObject [ "Answer whether the receiver and anObject represent the same object." @@ -41,17 +43,17 @@ SpDropListItem >> = anObject [ ^ self label = anObject label and: [ action = anObject action ] ] -{ #category : #protocol } +{ #category : 'protocol' } SpDropListItem >> action [ ^ action ] -{ #category : #protocol } +{ #category : 'protocol' } SpDropListItem >> action: aBlock [ action := aBlock ] -{ #category : #protocol } +{ #category : 'protocol' } SpDropListItem >> display: aBlock [ "Set the block whose execution should return the string to be displayed. aBlock will be executed with an optional argument, which is the underlying item." @@ -59,24 +61,24 @@ SpDropListItem >> display: aBlock [ displayBlock := aBlock. ] -{ #category : #comparing } +{ #category : 'comparing' } SpDropListItem >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ self label hash bitXor: action hash ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListItem >> icon [ ^ icon ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListItem >> icon: anObject [ icon := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } SpDropListItem >> initialize [ super initialize. @@ -84,32 +86,32 @@ SpDropListItem >> initialize [ displayBlock := [ :e | e asString ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListItem >> label [ ^ displayBlock cull: model ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListItem >> label: anObject [ "For compatibility with old raw-string usage. Send #display: instead" displayBlock := [ anObject ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListItem >> model [ ^ model ] -{ #category : #private } +{ #category : 'private' } SpDropListItem >> model: anObject [ model := anObject ] -{ #category : #execution } +{ #category : 'execution' } SpDropListItem >> value [ "This way, I am polymorphic with nil" diff --git a/src/Spec2-Core/SpDropListPresenter.class.st b/src/Spec2-Core/SpDropListPresenter.class.st index bd194e3db..a9f83350a 100644 --- a/src/Spec2-Core/SpDropListPresenter.class.st +++ b/src/Spec2-Core/SpDropListPresenter.class.st @@ -5,8 +5,8 @@ _NOTE: I assume there is a little problem on an empty list, but frankly, who cre " Class { - #name : #SpDropListPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpDropListPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#model => ObservableSlot', '#startsWithSelection', @@ -14,28 +14,30 @@ Class { '#displayBlock => ObservableSlot', '#iconBlock => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpDropListPresenter class >> adapterName [ ^ #DropListAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpDropListPresenter class >> documentFactoryMethodSelector [ ^ #newDropList ] -{ #category : #specs } +{ #category : 'specs' } SpDropListPresenter class >> title [ ^ 'Drop List' ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> addItemLabeled: aString do: aBlock [ "Add an item to the drop list, along with an action. `aString` is the label of the element. @@ -44,7 +46,7 @@ SpDropListPresenter >> addItemLabeled: aString do: aBlock [ self addItemLabeled: aString do: aBlock icon: nil. ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> addItemLabeled: aString do: aBlock icon: anIcon [ "Add an item to the drop list, along with an icon and an action. `aString` is the label of the element. @@ -60,13 +62,13 @@ SpDropListPresenter >> addItemLabeled: aString do: aBlock icon: anIcon [ ifFalse: [self appendCollection: { item } ] ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> appendCollection: items [ model collection: (model collection, items) ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> disableSelectionDuring: aBlock [ | oldSubscriptions holder | @@ -77,7 +79,7 @@ SpDropListPresenter >> disableSelectionDuring: aBlock [ holder subscriptions: oldSubscriptions ] ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> display [ "Answer the formatting block to transform how the elements will be displayed. See also `SpDropListPresenter>>#display:`" @@ -85,7 +87,7 @@ SpDropListPresenter >> display [ ^ displayBlock ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> display: aBlock [ "Set the formatting block to transform how the elements will be displayed. `aBlock` receives one argument (the element to be displayed) and it should answer a string. @@ -95,14 +97,14 @@ SpDropListPresenter >> display: aBlock [ ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> displayForItem: anItem [ "The order of the arguments may look weird, but then it seems more natural while using the widget" ^ self display cull: anItem model cull: anItem ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> displayIcon [ "Answer the block that will be used to retrieve the icon to be displayed along with the elements." @@ -110,7 +112,7 @@ SpDropListPresenter >> displayIcon [ ^ iconBlock ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> displayIcon: aBlock [ "Answer a block that will be used to retrieve the icon to be displayed along with the elements. `aBlock` receives one argument (an element from the list)" @@ -118,14 +120,14 @@ SpDropListPresenter >> displayIcon: aBlock [ iconBlock := aBlock ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> dropListItems: dropListItems [ "Populate the drop list with a list DropListItems" model collection: dropListItems ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> emptyList [ "Empty the list of elements used to populate the drop down list." @@ -134,25 +136,25 @@ SpDropListPresenter >> emptyList [ ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> getIconFor: anItem [ ^ self displayIcon cull: anItem model cull: anItem ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> getIndex [ ^ selection selectedIndex ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> getList [ ^ model items ] -{ #category : #testing } +{ #category : 'testing' } SpDropListPresenter >> hasIcons [ "Answer whether the dropdown list will show icons" @@ -161,7 +163,7 @@ SpDropListPresenter >> hasIcons [ each icon notNil or: [ (self getIconFor: each) notNil ] ] ] ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> iconBlock [ "Answer the block that will be used to retrieve the icon to be displayed along with the elements." @@ -174,7 +176,7 @@ SpDropListPresenter >> iconBlock [ ^ iconBlock ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> iconBlock: aBlock [ "Answer a block that will be used to retrieve the icon to be displayed along with the elements. `aBlock` receives one argument (an element from the list)" @@ -187,7 +189,7 @@ SpDropListPresenter >> iconBlock: aBlock [ iconBlock := aBlock ] -{ #category : #initialization } +{ #category : 'initialization' } SpDropListPresenter >> initialize [ super initialize. @@ -198,20 +200,20 @@ SpDropListPresenter >> initialize [ startsWithSelection := true ] -{ #category : #testing } +{ #category : 'testing' } SpDropListPresenter >> isStartWithSelection [ ^ startsWithSelection ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> items [ "Return the list used to populate the drop list" ^ self listItems ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> items: aList [ "Populate the drop list with a list of ui specific items" "`aList` is a list of domain specific objects. If you want to specify more precisely the item actions, see `SpDropListPresenter>>#addItemLabeled:do:`" @@ -227,21 +229,21 @@ SpDropListPresenter >> items: aList [ self setCollection: dropListItems ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> listItems [ "Return the list used to populate the drop list" ^ self getList collect: [ :e | e model ]. ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> listSize [ "Return the size of the list of choices" ^ self listItems size ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> model [ "Answer the model containing the elements to be shown in the drop down list. Tipically, the model is a collection of `SpDropListItem`." @@ -249,13 +251,13 @@ SpDropListPresenter >> model [ ^ model ] -{ #category : #selection } +{ #category : 'selection' } SpDropListPresenter >> resetSelection [ self selection unselectAll ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> selectIndex: anInteger [ "Select the element at position `anInteger` and executes the action associated with it." @@ -266,7 +268,7 @@ SpDropListPresenter >> selectIndex: anInteger [ self selection selectedItem value ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> selectItem: anItem [ "Select the element `anItem` if it is in the list. It executes the action associated with the item if it is defined." @@ -282,7 +284,7 @@ SpDropListPresenter >> selectItem: anItem [ realItem value ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> selectedIndex [ "Answer the index of selected item. You usually do not need to use this method but `SpDropListPresenter>>#selectedItem`." @@ -290,7 +292,7 @@ SpDropListPresenter >> selectedIndex [ ^ self getIndex ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> selectedItem [ "Answer selected item" @@ -298,14 +300,14 @@ SpDropListPresenter >> selectedItem [ ifNotNil: [ :anItem | anItem model ] ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> selection [ "Answer selection model, an instance of `SpSingleSelectionMode`." ^ selection ] -{ #category : #private } +{ #category : 'private' } SpDropListPresenter >> setCollection: items [ model collection: items. @@ -316,35 +318,35 @@ SpDropListPresenter >> setCollection: items [ ifFalse: [ self resetSelection ] ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> sortingBlock [ "Answer the block used to sort the elements of the list." ^ self model sortingBlock ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> sortingBlock: aBlock [ "Set the block or `SortFunction` used to sort the elements of the list." self model sortingBlock: aBlock ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> startWithSelection [ "Indicate when drop list will start with an element selected." startsWithSelection := true ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> startWithoutSelection [ "Indicate when droplist will start without an element selected." startsWithSelection := false ] -{ #category : #api } +{ #category : 'api' } SpDropListPresenter >> updateItemsKeepingSelection: aCollection [ "Update list items keeping current selection. WARNING: aCollection must includes the elements selected." @@ -356,7 +358,7 @@ SpDropListPresenter >> updateItemsKeepingSelection: aCollection [ self selectItem: item ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpDropListPresenter >> whenSelectedItemChangedDo: aBlock [ "Inform when the selected item is changed. `aBlock` receive one optional argument: the selected item (can be nil)" @@ -364,7 +366,7 @@ SpDropListPresenter >> whenSelectedItemChangedDo: aBlock [ selection whenChangedDo: [ aBlock cull: self selectedItem ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpDropListPresenter >> whenSelectionChangedDo: aBlock [ "Inform when the selection is changed. The method should be used only if you are interested in the fact that there was @@ -380,7 +382,7 @@ SpDropListPresenter >> whenSelectionChangedDo: aBlock [ selection whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpDropListPresenter >> whenSortingBlockChangedDo: aBlock [ "Inform when sorting block has changed. `aBlock` receive 3 optional arguments: diff --git a/src/Spec2-Core/SpDropListTableColumn.class.st b/src/Spec2-Core/SpDropListTableColumn.class.st index 26576796c..ca734de3b 100644 --- a/src/Spec2-Core/SpDropListTableColumn.class.st +++ b/src/Spec2-Core/SpDropListTableColumn.class.st @@ -9,17 +9,19 @@ self example ``` " Class { - #name : #SpDropListTableColumn, - #superclass : #SpTableColumn, + #name : 'SpDropListTableColumn', + #superclass : 'SpTableColumn', #instVars : [ 'display', 'selectedItemChangedAction', 'startWithSelection' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #examples } +{ #category : 'examples' } SpDropListTableColumn class >> example [ ^ SpTablePresenter new @@ -33,54 +35,54 @@ SpDropListTableColumn class >> example [ open ] -{ #category : #visiting } +{ #category : 'visiting' } SpDropListTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitDropListColumn: self ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> display [ ^ display ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> display: aBlock [ display := aBlock ] -{ #category : #initialization } +{ #category : 'initialization' } SpDropListTableColumn >> initialize [ super initialize. startWithSelection := true ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> selectedItemChangedAction [ ^ selectedItemChangedAction ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> selectedItemChangedAction: aBlock [ selectedItemChangedAction := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> shouldStartWithSelection [ ^ startWithSelection ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> startWithSelection [ startWithSelection := true ] -{ #category : #accessing } +{ #category : 'accessing' } SpDropListTableColumn >> startWithoutSelection [ startWithSelection := false ] diff --git a/src/Spec2-Core/SpDynamicPresenter.class.st b/src/Spec2-Core/SpDynamicPresenter.class.st index d64e986d9..c49e2b5e1 100644 --- a/src/Spec2-Core/SpDynamicPresenter.class.st +++ b/src/Spec2-Core/SpDynamicPresenter.class.st @@ -27,46 +27,48 @@ todo - retrieveSpec: " Class { - #name : #SpDynamicPresenter, - #superclass : #SpPresenter, + #name : 'SpDynamicPresenter', + #superclass : 'SpPresenter', #traits : 'SpTDynamicPresenter', #classTraits : 'SpTDynamicPresenter classTrait', - #category : #'Spec2-Core-Base' + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpDynamicPresenter >> assign: aPresenter to: anInstVarName [ self presenterAt: anInstVarName put: aPresenter. aPresenter owner: self ] -{ #category : #'error handling' } +{ #category : 'error handling' } SpDynamicPresenter >> doesNotUnderstand: aMessage [ "To make sure that we can use accessors to access the dynamically managed subcomponents." ^ self presenterAt: aMessage selector ifAbsent: [ super doesNotUnderstand: aMessage ] ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpDynamicPresenter >> instantiatePresenters: aCollectionOfPairs [ aCollectionOfPairs pairsDo: [ :k :v | self presenterAt: k asSymbol put: (self createInstanceFor: v) ] ] -{ #category : #api } +{ #category : 'api' } SpDynamicPresenter >> needFullRebuild: aBoolean [ self needRebuild: aBoolean. self presentersDo: [ :w | w needRebuild: aBoolean ] ] -{ #category : #api } +{ #category : 'api' } SpDynamicPresenter >> open [ self layout ifNil: [ ^ super open ]. ^ self asWindow openWith: self layout ] -{ #category : #api } +{ #category : 'api' } SpDynamicPresenter >> openModal [ self layout ifNil: [ ^ super open ]. diff --git a/src/Spec2-Core/SpEditableListPresenter.class.st b/src/Spec2-Core/SpEditableListPresenter.class.st index dee50e2ae..4b67ca326 100644 --- a/src/Spec2-Core/SpEditableListPresenter.class.st +++ b/src/Spec2-Core/SpEditableListPresenter.class.st @@ -12,8 +12,8 @@ Example: self example " Class { - #name : #SpEditableListPresenter, - #superclass : #SpPresenter, + #name : 'SpEditableListPresenter', + #superclass : 'SpPresenter', #instVars : [ 'title', 'list', @@ -28,15 +28,17 @@ Class { 'label', 'removeItemBlock' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #layout } +{ #category : 'layout' } SpEditableListPresenter class >> defaultLayout [ ^ self layoutWithOrdering: true ] -{ #category : #layout } +{ #category : 'layout' } SpEditableListPresenter class >> layoutWithOrdering: useOrdering [ | listLayout | listLayout := SpBoxLayout newLeftToRight @@ -65,33 +67,33 @@ SpEditableListPresenter class >> layoutWithOrdering: useOrdering [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpEditableListPresenter class >> new: aCollection [ ^ self new items: aCollection. ] -{ #category : #layout } +{ #category : 'layout' } SpEditableListPresenter class >> withoutOrderingBar [ ^ self layoutWithOrdering: false ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> addButton [ ^ addButton ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> addItemBlock: aBlock [ addItemBlock := aBlock. ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> bottomButton [ ^ bottomButton ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> connectPresenters [ super connectPresenters. addButton action: [ @@ -113,18 +115,18 @@ SpEditableListPresenter >> connectPresenters [ self moveElementAt: self selectedIndex to: self selectedIndex + 1 ] ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> display: aBlock [ list display: aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> downButton [ ^ downButton ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> initialize [ super initialize. title := 'Title'. @@ -135,7 +137,7 @@ SpEditableListPresenter >> initialize [ self refresh. ] ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> initializeDialogWindow: aWindow [ aWindow @@ -145,7 +147,7 @@ SpEditableListPresenter >> initializeDialogWindow: aWindow [ presenter close ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> initializePresenters [ label := self newLabel. list := self newList. @@ -181,32 +183,32 @@ SpEditableListPresenter >> initializePresenters [ help: 'Move this item on the last position of the list' ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> initializeWindow: aWindowPresenter [ aWindowPresenter title: self title ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> items [ ^ list model items ] -{ #category : #private } +{ #category : 'private' } SpEditableListPresenter >> items: anItemList [ list items: anItemList. ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> label: aString [ label label: aString ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> list [ ^ list ] -{ #category : #private } +{ #category : 'private' } SpEditableListPresenter >> moveElementAt: index to: newIndex [ "WARNING: this method can only be used if the model is an OrderedCollection" | elementToMove | @@ -223,7 +225,7 @@ SpEditableListPresenter >> moveElementAt: index to: newIndex [ self list selectIndex: newIndex ] -{ #category : #initialization } +{ #category : 'initialization' } SpEditableListPresenter >> newList [ "Default list collection is an Array. As this presenter aims to add / remove items from the list, we need a growable collection" @@ -232,86 +234,86 @@ SpEditableListPresenter >> newList [ yourself ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> okAction: aBlock [ okBlock := aBlock ] -{ #category : #private } +{ #category : 'private' } SpEditableListPresenter >> performOkAction [ okBlock value ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> refresh [ self resetSelection. self items: self items ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> removeButton [ ^ removeButton ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> removeItem: anObject [ self items remove: anObject. list selection unselectAll ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> removeItemBlock: aBlock [ removeItemBlock := aBlock. ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> resetSelection [ self selectIndex: 0 ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> selectIndex: anIndex [ list selectIndex: anIndex ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> selectItem: anObject [ list selectItem: anObject ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> selectedIndex [ ^ list selection selectedIndex ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> selectedItem [ ^ list selection selectedItem ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> title [ ^ title ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> title: aTitle [ title := aTitle ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> topButton [ ^ topButton ] -{ #category : #accessing } +{ #category : 'accessing' } SpEditableListPresenter >> upButton [ ^ upButton ] -{ #category : #api } +{ #category : 'api' } SpEditableListPresenter >> whenSelectionChangedDo: aBlockClosure [ list whenSelectionChangedDo: aBlockClosure ] diff --git a/src/Spec2-Core/SpEventHandler.class.st b/src/Spec2-Core/SpEventHandler.class.st index c0e43c000..fba2f4f03 100644 --- a/src/Spec2-Core/SpEventHandler.class.st +++ b/src/Spec2-Core/SpEventHandler.class.st @@ -10,16 +10,18 @@ I can listen: WARNING: Not all presenters will answer equally to all events. For example, presenters who can't take the keyboard focus can't respond to focus events. " Class { - #name : #SpEventHandler, - #superclass : #Object, + #name : 'SpEventHandler', + #superclass : 'Object', #instVars : [ 'presenter', 'events' ], - #category : #'Spec2-Core-Base-Event' + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpEventHandler class >> for: aPresenter [ ^ self basicNew @@ -27,40 +29,40 @@ SpEventHandler class >> for: aPresenter [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpEventHandler class >> new [ self error: 'Use #new' ] -{ #category : #testing } +{ #category : 'testing' } SpEventHandler >> hasEvents [ ^ events notEmpty ] -{ #category : #initialization } +{ #category : 'initialization' } SpEventHandler >> initialize [ super initialize. events := Set new ] -{ #category : #initialization } +{ #category : 'initialization' } SpEventHandler >> initializePresenter: aPresenter [ presenter := aPresenter. self initialize ] -{ #category : #installing } +{ #category : 'installing' } SpEventHandler >> installAllEventsTo: anAdapter target: aWidget [ events do: [ :each | each installOn: anAdapter target: aWidget ] ] -{ #category : #private } +{ #category : 'private' } SpEventHandler >> register: anEvent [ events add: anEvent. @@ -68,13 +70,13 @@ SpEventHandler >> register: anEvent [ anAdapter installEvent: anEvent ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenDoubleClickDo: aBlock [ self register: (SpMouseDoubleClickDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenFocusLostDo: aBlock [ "Register on a focus lost event. aBlock does not have parameters." @@ -82,7 +84,7 @@ SpEventHandler >> whenFocusLostDo: aBlock [ self register: (SpFocusLostEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenFocusReceivedDo: aBlock [ "Register on a focus received event. aBlock does not have parameters." @@ -91,7 +93,7 @@ SpEventHandler >> whenFocusReceivedDo: aBlock [ self register: (SpFocusReceivedEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenKeyDownDo: aBlock [ "Register on a key down event. aBlock receives 'event' as parameter." @@ -99,7 +101,7 @@ SpEventHandler >> whenKeyDownDo: aBlock [ self register: (SpKeyDownEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenKeyUpDo: aBlock [ "Register on a key down event. aBlock receives 'event' as parameter." @@ -107,7 +109,7 @@ SpEventHandler >> whenKeyUpDo: aBlock [ self register: (SpKeyUpEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenMouseDownDo: aBlock [ "Register on a mouse down event. aBlock receives 'event' as parameter." @@ -115,7 +117,7 @@ SpEventHandler >> whenMouseDownDo: aBlock [ self register: (SpMouseDownEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenMouseEnterDo: aBlock [ "Register on a mouse enter event. aBlock receives 'event' as parameter." @@ -123,7 +125,7 @@ SpEventHandler >> whenMouseEnterDo: aBlock [ self register: (SpMouseEnterEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenMouseLeaveDo: aBlock [ "Register on a mouse leave event. aBlock receives 'event' as parameter." @@ -131,7 +133,7 @@ SpEventHandler >> whenMouseLeaveDo: aBlock [ self register: (SpMouseLeaveEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenMouseMoveDo: aBlock [ "Register on a mouse move event. aBlock receives 'event' as parameter." @@ -139,7 +141,7 @@ SpEventHandler >> whenMouseMoveDo: aBlock [ self register: (SpMouseMoveEventDefinition do: aBlock) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpEventHandler >> whenMouseUpDo: aBlock [ "Register on a mouse up event. aBlock receives 'event' as parameter." diff --git a/src/Spec2-Core/SpFTArrayIndexColumn.class.st b/src/Spec2-Core/SpFTArrayIndexColumn.class.st index 6f66628ce..a905503fd 100644 --- a/src/Spec2-Core/SpFTArrayIndexColumn.class.st +++ b/src/Spec2-Core/SpFTArrayIndexColumn.class.st @@ -11,37 +11,39 @@ This class has and extends API of FTColumn index: " Class { - #name : #SpFTArrayIndexColumn, - #superclass : #SpFTColumn, + #name : 'SpFTArrayIndexColumn', + #superclass : 'SpFTColumn', #instVars : [ 'index' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpFTArrayIndexColumn class >> index: aNumber [ ^ self new index: aNumber ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpFTArrayIndexColumn class >> index: aNumber width: aNumber2 [ ^ (self index: aNumber) width: aNumber2 ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTArrayIndexColumn >> index [ ^ index ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTArrayIndexColumn >> index: anObject [ index := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTArrayIndexColumn >> transform: anArray [ ^ anArray at: self index ] diff --git a/src/Spec2-Core/SpFTColumn.class.st b/src/Spec2-Core/SpFTColumn.class.st index 95a14e233..6616902b1 100644 --- a/src/Spec2-Core/SpFTColumn.class.st +++ b/src/Spec2-Core/SpFTColumn.class.st @@ -2,83 +2,85 @@ A column for Fast table " Class { - #name : #SpFTColumn, - #superclass : #Object, + #name : 'SpFTColumn', + #superclass : 'Object', #instVars : [ 'id', 'width', 'table' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpFTColumn class >> id: anObject [ ^ self new id: anObject; yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn class >> undefinedColumnWidth [ "This is a contant that defines a column width is undefined, then the layout will try to arrange it by itself." ^ 0 ] -{ #category : #layout } +{ #category : 'layout' } SpFTColumn >> acquireWidth: anOwnerWidth [ ^ self widthOrUndefined min: anOwnerWidth ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> id [ ^ id ] -{ #category : #initialization } +{ #category : 'initialization' } SpFTColumn >> id: anObject [ id := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> readObject: anObject [ "Fast table presenters have a block that returns an array that is mapped by this column" ^ self transform: (table displayBlock value: anObject) ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> table [ ^ table ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> table: anObject [ table := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> title [ ^ id ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> transform: anObject [ ^ anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> width [ ^ width ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> width: anObject [ width := anObject ] -{ #category : #accessing } +{ #category : 'accessing' } SpFTColumn >> widthOrUndefined [ ^ self width ifNil: [ self class undefinedColumnWidth ] ] diff --git a/src/Spec2-Core/SpFixedProgressBarState.class.st b/src/Spec2-Core/SpFixedProgressBarState.class.st index 6be6a0a92..3855c6dfc 100644 --- a/src/Spec2-Core/SpFixedProgressBarState.class.st +++ b/src/Spec2-Core/SpFixedProgressBarState.class.st @@ -17,22 +17,24 @@ Internal Representation and Key Implementation Points. " Class { - #name : #SpFixedProgressBarState, - #superclass : #SpProgressBarState, + #name : 'SpFixedProgressBarState', + #superclass : 'SpProgressBarState', #instVars : [ 'value' ], - #category : #'Spec2-Core-Utils' + #category : 'Spec2-Core-Utils', + #package : 'Spec2-Core', + #tag : 'Utils' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpFixedProgressBarState class >> value: aNumber [ ^ self new value: aNumber; yourself ] -{ #category : #initialization } +{ #category : 'initialization' } SpFixedProgressBarState >> initialize [ self class initializeSlots: self. @@ -40,17 +42,17 @@ SpFixedProgressBarState >> initialize [ value := 0 ] -{ #category : #accessing } +{ #category : 'accessing' } SpFixedProgressBarState >> value [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } SpFixedProgressBarState >> value: aNumber [ value := aNumber ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpFixedProgressBarState >> whenValueChangedDo: aBlock [ self property: #value whenChangedDo: aBlock ] diff --git a/src/Spec2-Core/SpFocusLostEventDefinition.class.st b/src/Spec2-Core/SpFocusLostEventDefinition.class.st index a070db931..b51c23018 100644 --- a/src/Spec2-Core/SpFocusLostEventDefinition.class.st +++ b/src/Spec2-Core/SpFocusLostEventDefinition.class.st @@ -3,12 +3,14 @@ I define a ""lost focus"" (focus leaved the widget) event. " Class { - #name : #SpFocusLostEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpFocusLostEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpFocusLostEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installFocusLostEvent: self to: aWidget diff --git a/src/Spec2-Core/SpFocusReceivedEventDefinition.class.st b/src/Spec2-Core/SpFocusReceivedEventDefinition.class.st index c3ac17fda..8aad0392f 100644 --- a/src/Spec2-Core/SpFocusReceivedEventDefinition.class.st +++ b/src/Spec2-Core/SpFocusReceivedEventDefinition.class.st @@ -3,12 +3,14 @@ I define a ""got focus"" (focus received) event. " Class { - #name : #SpFocusReceivedEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpFocusReceivedEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpFocusReceivedEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installFocusReceivedEvent: self to: aWidget diff --git a/src/Spec2-Core/SpGeneratorListModel.class.st b/src/Spec2-Core/SpGeneratorListModel.class.st index 421c06a77..59dcf8371 100644 --- a/src/Spec2-Core/SpGeneratorListModel.class.st +++ b/src/Spec2-Core/SpGeneratorListModel.class.st @@ -6,16 +6,18 @@ See `Generator` class. " Class { - #name : #SpGeneratorListModel, - #superclass : #SpCollectionListModel, + #name : 'SpGeneratorListModel', + #superclass : 'SpCollectionListModel', #instVars : [ 'generator', 'size' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #examples } +{ #category : 'examples' } SpGeneratorListModel class >> example [ | items generator | @@ -32,7 +34,7 @@ SpGeneratorListModel class >> example [ ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpGeneratorListModel class >> on: aBlock [ ^ self new @@ -40,7 +42,7 @@ SpGeneratorListModel class >> on: aBlock [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeneratorListModel >> at: anIndex [ ^ self @@ -48,7 +50,7 @@ SpGeneratorListModel >> at: anIndex [ ifAbsent: [ self error: 'Index not found' ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeneratorListModel >> at: anIndex ifAbsent: aBlock [ [ collection size < anIndex ] @@ -61,25 +63,25 @@ SpGeneratorListModel >> at: anIndex ifAbsent: aBlock [ ^ collection at: anIndex ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeneratorListModel >> generator [ ^ generator ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeneratorListModel >> generator: aGenerator [ generator := aGenerator. ] -{ #category : #testing } +{ #category : 'testing' } SpGeneratorListModel >> hasElementAt: index [ self at: index ifAbsent: [ ^ false ]. ^ true ] -{ #category : #initialization } +{ #category : 'initialization' } SpGeneratorListModel >> initialize [ super initialize. @@ -87,7 +89,7 @@ SpGeneratorListModel >> initialize [ size := 10000 ] -{ #category : #accessing } +{ #category : 'accessing' } SpGeneratorListModel >> size [ ^ size diff --git a/src/Spec2-Core/SpIconAndLabelToolbarDisplayMode.class.st b/src/Spec2-Core/SpIconAndLabelToolbarDisplayMode.class.st index c45b337cd..6b68e015a 100644 --- a/src/Spec2-Core/SpIconAndLabelToolbarDisplayMode.class.st +++ b/src/Spec2-Core/SpIconAndLabelToolbarDisplayMode.class.st @@ -2,12 +2,14 @@ Display the toolbar with icons and label only " Class { - #name : #SpIconAndLabelToolbarDisplayMode, - #superclass : #SpToolbarDisplayMode, - #category : #'Spec2-Core-Widgets' + #name : 'SpIconAndLabelToolbarDisplayMode', + #superclass : 'SpToolbarDisplayMode', + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #configuring } +{ #category : 'configuring' } SpIconAndLabelToolbarDisplayMode >> configureButton: aButton item: aToolbarItem [ "ask for icon and label" aButton getLabelSelector: #label. @@ -17,18 +19,18 @@ SpIconAndLabelToolbarDisplayMode >> configureButton: aButton item: aToolbarItem ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconAndLabelToolbarDisplayMode >> extent [ ^ (45@45) scaledByDisplayScaleFactor ] -{ #category : #printing } +{ #category : 'printing' } SpIconAndLabelToolbarDisplayMode >> label [ ^ 'Icon and Label' ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconAndLabelToolbarDisplayMode >> styleName [ ^ 'toolBar.iconsAndLabel' diff --git a/src/Spec2-Core/SpIconProvider.class.st b/src/Spec2-Core/SpIconProvider.class.st index a08bd558e..48a34500a 100644 --- a/src/Spec2-Core/SpIconProvider.class.st +++ b/src/Spec2-Core/SpIconProvider.class.st @@ -3,12 +3,14 @@ I'm base icon provider. Children of `SpIconProvider` will define concrete ways to access icons. " Class { - #name : #SpIconProvider, - #superclass : #Object, - #category : #'Spec2-Core-IconProvider' + #name : 'SpIconProvider', + #superclass : 'Object', + #category : 'Spec2-Core-IconProvider', + #package : 'Spec2-Core', + #tag : 'IconProvider' } -{ #category : #copying } +{ #category : 'copying' } SpIconProvider >> , aProvider [ ^ SpCompositeIconProvider new @@ -17,7 +19,7 @@ SpIconProvider >> , aProvider [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconProvider >> iconNamed: aName [ ^ self @@ -25,7 +27,7 @@ SpIconProvider >> iconNamed: aName [ ifAbsent: [ self error: ('Icon {1} not found.' format: { aName }) ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconProvider >> iconNamed: aName ifAbsent: aBlock [ self subclassResponsibility diff --git a/src/Spec2-Core/SpIconToolbarDisplayMode.class.st b/src/Spec2-Core/SpIconToolbarDisplayMode.class.st index 10091b675..e27a66bee 100644 --- a/src/Spec2-Core/SpIconToolbarDisplayMode.class.st +++ b/src/Spec2-Core/SpIconToolbarDisplayMode.class.st @@ -2,12 +2,14 @@ Display the toolbar with icons only " Class { - #name : #SpIconToolbarDisplayMode, - #superclass : #SpToolbarDisplayMode, - #category : #'Spec2-Core-Widgets' + #name : 'SpIconToolbarDisplayMode', + #superclass : 'SpToolbarDisplayMode', + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #configuring } +{ #category : 'configuring' } SpIconToolbarDisplayMode >> configureButton: aButton item: aToolbarItem [ "ask for icon (no label)" aButton getIconSelector: #icon. @@ -15,19 +17,19 @@ SpIconToolbarDisplayMode >> configureButton: aButton item: aToolbarItem [ aButton getStateSelector: #state ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconToolbarDisplayMode >> extent [ ^ (30@30) scaledByDisplayScaleFactor ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconToolbarDisplayMode >> label [ ^ 'Icon' ] -{ #category : #accessing } +{ #category : 'accessing' } SpIconToolbarDisplayMode >> styleName [ ^ 'toolBar.icons' diff --git a/src/Spec2-Core/SpImagePresenter.class.st b/src/Spec2-Core/SpImagePresenter.class.st index 78cba2983..03db8e7bd 100644 --- a/src/Spec2-Core/SpImagePresenter.class.st +++ b/src/Spec2-Core/SpImagePresenter.class.st @@ -3,70 +3,72 @@ A presenter to display images. Images need to be instances of `Form`. " Class { - #name : #SpImagePresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpImagePresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#image => ObservableSlot', '#action => ObservableSlot', '#autoScale => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpImagePresenter class >> adapterName [ ^ #ImageAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpImagePresenter class >> documentFactoryMethodSelector [ ^ #newImage ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpImagePresenter >> action [ ^ action ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpImagePresenter >> action: aBlock [ "Set the action of the image" action := aBlock ] -{ #category : #api } +{ #category : 'api' } SpImagePresenter >> autoScale [ "Answer if image has autoscale activated." ^ autoScale ] -{ #category : #api } +{ #category : 'api' } SpImagePresenter >> autoScale: aBoolean [ "Set whether image will autoscale or not." autoScale := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpImagePresenter >> image [ "Answer the `Form` instance that will be displayed." ^ image ] -{ #category : #api } +{ #category : 'api' } SpImagePresenter >> image: aForm [ "Set a `Form` instance to be displayed." image := aForm ] -{ #category : #initialization } +{ #category : 'initialization' } SpImagePresenter >> initialize [ super initialize. @@ -74,7 +76,7 @@ SpImagePresenter >> initialize [ autoScale := false ] -{ #category : #api } +{ #category : 'api' } SpImagePresenter >> switchAutoscale [ "Toggles autoscale state." @@ -82,7 +84,7 @@ SpImagePresenter >> switchAutoscale [ ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpImagePresenter >> whenAutoScaleChangeDo: aBlockClosure [ "Inform when autoScale state has changed. `aBlock` has three optional arguments: @@ -93,7 +95,7 @@ SpImagePresenter >> whenAutoScaleChangeDo: aBlockClosure [ self property: #autoScale whenChangedDo: aBlockClosure ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpImagePresenter >> whenImageChangeDo: aBlock [ "Inform when image to display has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpImageTableColumn.class.st b/src/Spec2-Core/SpImageTableColumn.class.st index 291c749e2..aaaadc8e4 100644 --- a/src/Spec2-Core/SpImageTableColumn.class.st +++ b/src/Spec2-Core/SpImageTableColumn.class.st @@ -11,12 +11,14 @@ SpImageTableColumn ``` " Class { - #name : #SpImageTableColumn, - #superclass : #SpTableColumn, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpImageTableColumn', + #superclass : 'SpTableColumn', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #examples } +{ #category : 'examples' } SpImageTableColumn class >> example [ SpTablePresenter new @@ -32,7 +34,7 @@ SpImageTableColumn class >> example [ open ] -{ #category : #visiting } +{ #category : 'visiting' } SpImageTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitImageColumn: self diff --git a/src/Spec2-Core/SpIndeterminatedProgressBarState.class.st b/src/Spec2-Core/SpIndeterminatedProgressBarState.class.st index 7438a2584..dcdf10782 100644 --- a/src/Spec2-Core/SpIndeterminatedProgressBarState.class.st +++ b/src/Spec2-Core/SpIndeterminatedProgressBarState.class.st @@ -10,12 +10,14 @@ Examples ProgressBarIndeterminated new " Class { - #name : #SpIndeterminatedProgressBarState, - #superclass : #SpProgressBarState, - #category : #'Spec2-Core-Utils' + #name : 'SpIndeterminatedProgressBarState', + #superclass : 'SpProgressBarState', + #category : 'Spec2-Core-Utils', + #package : 'Spec2-Core', + #tag : 'Utils' } -{ #category : #'api - events' } +{ #category : 'api - events' } SpIndeterminatedProgressBarState >> whenValueChangedDo: aBlock [ "Value cannot change in indeterminate state" ] diff --git a/src/Spec2-Core/SpIndexTableColumn.class.st b/src/Spec2-Core/SpIndexTableColumn.class.st index 4546ca58d..9c6f85fec 100644 --- a/src/Spec2-Core/SpIndexTableColumn.class.st +++ b/src/Spec2-Core/SpIndexTableColumn.class.st @@ -12,12 +12,14 @@ SpIndexTableColumn title: 'My index' ``` " Class { - #name : #SpIndexTableColumn, - #superclass : #SpTableColumn, - #category : #'Spec2-Core-Widgets-Table' + #name : 'SpIndexTableColumn', + #superclass : 'SpTableColumn', + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #visiting } +{ #category : 'visiting' } SpIndexTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitIndexColumn: self diff --git a/src/Spec2-Core/SpJob.class.st b/src/Spec2-Core/SpJob.class.st index 202a507d9..bad6dd43c 100644 --- a/src/Spec2-Core/SpJob.class.st +++ b/src/Spec2-Core/SpJob.class.st @@ -19,8 +19,8 @@ job run. See `SpJobPresenter` for a graphical example. " Class { - #name : #SpJob, - #superclass : #Object, + #name : 'SpJob', + #superclass : 'Object', #instVars : [ 'block', 'currentValue', @@ -33,17 +33,19 @@ Class { 'process', 'announcer' ], - #category : #'Spec2-Core-Job' + #category : 'Spec2-Core-Job', + #package : 'Spec2-Core', + #tag : 'Job' } -{ #category : #accessing } +{ #category : 'accessing' } SpJob class >> current [ "Answer the current job or nil if none." ^ CurrentJob value ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpJob class >> empty [ ^ self new @@ -52,7 +54,7 @@ SpJob class >> empty [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpJob class >> newBlock: aBlock [ ^ self new @@ -60,7 +62,7 @@ SpJob class >> newBlock: aBlock [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpJob class >> newTitle: aString block: aBlock [ ^ self new @@ -69,14 +71,14 @@ SpJob class >> newTitle: aString block: aBlock [ yourself ] -{ #category : #private } +{ #category : 'private' } SpJob >> addChild: aJob [ children add: aJob. aJob parent: self ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> announce: anAnnouncementClass [ | announcement | @@ -84,38 +86,38 @@ SpJob >> announce: anAnnouncementClass [ self announcer announce: announcement ] -{ #category : #private } +{ #category : 'private' } SpJob >> announceChange [ isRunning ifFalse: [ ^ self ]. self announce: JobChange ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> announcer [ ^ announcer ifNil: [ announcer := Announcer new ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> block [ ^ block ] -{ #category : #private } +{ #category : 'private' } SpJob >> block: aBlock [ block := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> children [ ^ children copy ] -{ #category : #private } +{ #category : 'private' } SpJob >> cleanupAfterRunning [ isRunning := false. @@ -124,44 +126,44 @@ SpJob >> cleanupAfterRunning [ parent ifNotNil: [ :job | job removeChild: self ] ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> current [ ^ self currentValue ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> current: aNumber [ self currentValue: aNumber ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> currentValue [ ^ currentValue ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> currentValue: aNumber [ currentValue := aNumber. self announceChange ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> decrement [ self currentValue: self currentValue - 1 ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> increment [ self currentValue: self currentValue + 1 ] -{ #category : #initialization } +{ #category : 'initialization' } SpJob >> initialize [ super initialize. @@ -173,25 +175,25 @@ SpJob >> initialize [ children := OrderedCollection new ] -{ #category : #testing } +{ #category : 'testing' } SpJob >> isRunning [ ^ isRunning ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> label [ ^ self title ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> label: aString [ self title: aString ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> lookup: lookupBlock ifNone: noneBlock [ "Detect a job that satisfies the lookupBlock, or value noneBlock if none satisfies. The lookup starts at myself, following recursevely through my parent." @@ -203,19 +205,19 @@ SpJob >> lookup: lookupBlock ifNone: noneBlock [ ifNotNil: [ parent lookup: lookupBlock ifNone: noneBlock ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> max [ ^ max ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> max: aNumber [ self migrateProgressWhileUpdatingBounds: [ max := aNumber ]. ] -{ #category : #private } +{ #category : 'private' } SpJob >> migrateProgressWhileUpdatingBounds: aBlockChangingBounds [ "Keep the progress value consistent while we change min / max" | progress | @@ -224,32 +226,32 @@ SpJob >> migrateProgressWhileUpdatingBounds: aBlockChangingBounds [ self progress: progress. ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> min [ ^ min ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> min: aNumber [ self migrateProgressWhileUpdatingBounds: [ min := aNumber ]. self announceChange ] -{ #category : #private } +{ #category : 'private' } SpJob >> parent [ ^ parent ] -{ #category : #private } +{ #category : 'private' } SpJob >> parent: aJob [ parent := aJob. ] -{ #category : #private } +{ #category : 'private' } SpJob >> prepareForRunning [ isRunning := true. @@ -257,7 +259,7 @@ SpJob >> prepareForRunning [ self announce: JobStart ] -{ #category : #progress } +{ #category : 'progress' } SpJob >> progress [ "Avoid negative progress and divideByZero." @@ -266,7 +268,7 @@ SpJob >> progress [ ifFalse: [ (currentValue - min) / (max - min) ] ] -{ #category : #progress } +{ #category : 'progress' } SpJob >> progress: aNormalizedFloat [ "Set the progress: 0.0 - 1.0" @@ -274,19 +276,19 @@ SpJob >> progress: aNormalizedFloat [ self announceChange ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> progressPercent: aNumber [ self currentValue: aNumber ] -{ #category : #private } +{ #category : 'private' } SpJob >> removeChild: aJob [ children remove: aJob. ] -{ #category : #running } +{ #category : 'running' } SpJob >> run [ [ @@ -295,44 +297,44 @@ SpJob >> run [ ensure: [ self cleanupAfterRunning ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> title [ ^ title ] -{ #category : #accessing } +{ #category : 'accessing' } SpJob >> title: anObject [ title := anObject. self announceChange ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> value [ ^ self currentValue ] -{ #category : #compatibility } +{ #category : 'compatibility' } SpJob >> value: aNumber [ self currentValue: aNumber ] -{ #category : #events } +{ #category : 'events' } SpJob >> whenChangedDo: aBlock [ self announcer when: JobChange do: aBlock ] -{ #category : #events } +{ #category : 'events' } SpJob >> whenEndDo: aBlock [ self announcer when: JobEnd do: aBlock ] -{ #category : #events } +{ #category : 'events' } SpJob >> whenStartDo: aBlock [ self announcer when: JobStart do: aBlock diff --git a/src/Spec2-Core/SpJobListPresenter.class.st b/src/Spec2-Core/SpJobListPresenter.class.st index 7c9768440..eeb1e5e25 100644 --- a/src/Spec2-Core/SpJobListPresenter.class.st +++ b/src/Spec2-Core/SpJobListPresenter.class.st @@ -2,15 +2,17 @@ A presenter to stack jobs. " Class { - #name : #SpJobListPresenter, - #superclass : #SpPresenter, + #name : 'SpJobListPresenter', + #superclass : 'SpPresenter', #instVars : [ 'refreshRateInMs' ], - #category : #'Spec2-Core-Job' + #category : 'Spec2-Core-Job', + #package : 'Spec2-Core', + #tag : 'Job' } -{ #category : #examples } +{ #category : 'examples' } SpJobListPresenter class >> example [ | jobList | @@ -33,7 +35,7 @@ SpJobListPresenter class >> example [ ^ nil ] -{ #category : #private } +{ #category : 'private' } SpJobListPresenter >> addJobPresenter: aJob [ | presenter | @@ -48,13 +50,13 @@ SpJobListPresenter >> addJobPresenter: aJob [ window resize: 500@(layout children size * self jobPresenterHeight) ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpJobListPresenter >> initializePresenters [ self layout: SpBoxLayout newTopToBottom ] -{ #category : #initialization } +{ #category : 'initialization' } SpJobListPresenter >> initializeWindow: aWindowPresenter [ aWindowPresenter @@ -64,13 +66,13 @@ SpJobListPresenter >> initializeWindow: aWindowPresenter [ centered ] -{ #category : #private } +{ #category : 'private' } SpJobListPresenter >> jobPresenterHeight [ ^ 70 ] -{ #category : #api } +{ #category : 'api' } SpJobListPresenter >> pushJob: aJob [ aJob whenStartDo: [ :ann | self addJobPresenter: ann job ]. @@ -79,12 +81,12 @@ SpJobListPresenter >> pushJob: aJob [ aJob run ] -{ #category : #api } +{ #category : 'api' } SpJobListPresenter >> refreshRateInMs: anInteger [ refreshRateInMs := anInteger. ] -{ #category : #private } +{ #category : 'private' } SpJobListPresenter >> removeJobPresenter: aJob [ | presenter | diff --git a/src/Spec2-Core/SpJobPresenter.class.st b/src/Spec2-Core/SpJobPresenter.class.st index 380c67eb4..7a043e9f7 100644 --- a/src/Spec2-Core/SpJobPresenter.class.st +++ b/src/Spec2-Core/SpJobPresenter.class.st @@ -15,18 +15,20 @@ SpJobPresenter new ``` " Class { - #name : #SpJobPresenter, - #superclass : #SpPresenter, + #name : 'SpJobPresenter', + #superclass : 'SpPresenter', #traits : 'SpTModel', #classTraits : 'SpTModel classTrait', #instVars : [ 'progressBar', 'progressLabel' ], - #category : #'Spec2-Core-Job' + #category : 'Spec2-Core-Job', + #package : 'Spec2-Core', + #tag : 'Job' } -{ #category : #examples } +{ #category : 'examples' } SpJobPresenter class >> example [ | job | @@ -43,7 +45,7 @@ SpJobPresenter class >> example [ run ] -{ #category : #initialization } +{ #category : 'initialization' } SpJobPresenter >> initializePresenters [ self layout: (SpBoxLayout newTopToBottom @@ -54,7 +56,7 @@ SpJobPresenter >> initializePresenters [ yourself) ] -{ #category : #initialization } +{ #category : 'initialization' } SpJobPresenter >> initializeWindow: aWindowPresenter [ aWindowPresenter @@ -64,25 +66,25 @@ SpJobPresenter >> initializeWindow: aWindowPresenter [ centered ] -{ #category : #private } +{ #category : 'private' } SpJobPresenter >> jobChanged: ann [ self updatePresenter ] -{ #category : #private } +{ #category : 'private' } SpJobPresenter >> jobEnd: ann [ self updatePresenter ] -{ #category : #private } +{ #category : 'private' } SpJobPresenter >> jobStart: ann [ self updatePresenter ] -{ #category : #'accessing - model' } +{ #category : 'accessing - model' } SpJobPresenter >> model: aModel [ model := aModel. @@ -90,13 +92,13 @@ SpJobPresenter >> model: aModel [ self updatePresenter ] -{ #category : #private } +{ #category : 'private' } SpJobPresenter >> refreshRateInMs: anInteger [ progressBar withAdapterDo: [ :progressAdapter | progressAdapter refreshRateInMs: anInteger ] ] -{ #category : #running } +{ #category : 'running' } SpJobPresenter >> run [ self open. @@ -104,14 +106,14 @@ SpJobPresenter >> run [ self withWindowDo: [ :window | window close ] ] -{ #category : #'accessing - model' } +{ #category : 'accessing - model' } SpJobPresenter >> setModelBeforeInitialization: aModel [ model := aModel. self updateSubscriptions ] -{ #category : #initialization } +{ #category : 'initialization' } SpJobPresenter >> updatePresenter [ | currentJob | @@ -121,7 +123,7 @@ SpJobPresenter >> updatePresenter [ progressBar fixedAt: model progress ] -{ #category : #private } +{ #category : 'private' } SpJobPresenter >> updateSubscriptions [ model announcer weak diff --git a/src/Spec2-Core/SpKeyDownEventDefinition.class.st b/src/Spec2-Core/SpKeyDownEventDefinition.class.st index 5fde61df5..f0ec9846f 100644 --- a/src/Spec2-Core/SpKeyDownEventDefinition.class.st +++ b/src/Spec2-Core/SpKeyDownEventDefinition.class.st @@ -2,12 +2,14 @@ I define a key down event " Class { - #name : #SpKeyDownEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpKeyDownEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpKeyDownEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installKeyDownEvent: self to: aWidget diff --git a/src/Spec2-Core/SpKeyUpEventDefinition.class.st b/src/Spec2-Core/SpKeyUpEventDefinition.class.st index c55a57be9..192dc4239 100644 --- a/src/Spec2-Core/SpKeyUpEventDefinition.class.st +++ b/src/Spec2-Core/SpKeyUpEventDefinition.class.st @@ -2,12 +2,14 @@ I define a key up event " Class { - #name : #SpKeyUpEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpKeyUpEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpKeyUpEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installKeyUpEvent: self to: aWidget diff --git a/src/Spec2-Core/SpLabelPresenter.class.st b/src/Spec2-Core/SpLabelPresenter.class.st index 7d74c974a..911cac35f 100644 --- a/src/Spec2-Core/SpLabelPresenter.class.st +++ b/src/Spec2-Core/SpLabelPresenter.class.st @@ -4,48 +4,50 @@ A label presenter displays smalls (or medium) amounts of text. _NOTE: In the future, it should be possible to attach another widget to a label, but for now it is not implemented._ " Class { - #name : #SpLabelPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpLabelPresenter', + #superclass : 'SpAbstractWidgetPresenter', #traits : 'SpTDecoratedText', #classTraits : 'SpTDecoratedText classTrait', #instVars : [ '#label => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpLabelPresenter class >> adapterName [ ^ #LabelAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpLabelPresenter class >> documentFactoryMethodSelector [ ^ #newLabel ] -{ #category : #specs } +{ #category : 'specs' } SpLabelPresenter class >> title [ ^ 'Label presenter' ] -{ #category : #testing } +{ #category : 'testing' } SpLabelPresenter >> canTakeKeyboardFocus [ ^ false ] -{ #category : #initialization } +{ #category : 'initialization' } SpLabelPresenter >> defaultColor [ self flag: #TOREMOVE. "This needs to be removed" ^ self theme textColor ] -{ #category : #initialization } +{ #category : 'initialization' } SpLabelPresenter >> initialize [ super initialize. @@ -53,21 +55,21 @@ SpLabelPresenter >> initialize [ self whenLabelChangedDo: [ self changed: #getText ] ] -{ #category : #api } +{ #category : 'api' } SpLabelPresenter >> label [ "Answer the label to be displayed." ^ label ] -{ #category : #api } +{ #category : 'api' } SpLabelPresenter >> label: aString [ "Set the label to be displayed" label := aString ] -{ #category : #localization } +{ #category : 'localization' } SpLabelPresenter >> localeChanged [ super localeChanged. @@ -75,7 +77,7 @@ SpLabelPresenter >> localeChanged [ ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpLabelPresenter >> whenLabelChangedDo: aBlock [ "Inform when label property has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpLabelToolbarDisplayMode.class.st b/src/Spec2-Core/SpLabelToolbarDisplayMode.class.st index f71fb9dc8..5a28c0ec0 100644 --- a/src/Spec2-Core/SpLabelToolbarDisplayMode.class.st +++ b/src/Spec2-Core/SpLabelToolbarDisplayMode.class.st @@ -2,12 +2,14 @@ Display the toolbar with labels only " Class { - #name : #SpLabelToolbarDisplayMode, - #superclass : #SpToolbarDisplayMode, - #category : #'Spec2-Core-Widgets' + #name : 'SpLabelToolbarDisplayMode', + #superclass : 'SpToolbarDisplayMode', + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #configuring } +{ #category : 'configuring' } SpLabelToolbarDisplayMode >> configureButton: aButton item: aToolbarItem [ "ask for label (no icon)" aButton getLabelSelector: #label. @@ -15,18 +17,18 @@ SpLabelToolbarDisplayMode >> configureButton: aButton item: aToolbarItem [ aButton getStateSelector: #state ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabelToolbarDisplayMode >> extent [ ^ (45@25) scaledByDisplayScaleFactor ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabelToolbarDisplayMode >> label [ ^ 'Label' ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabelToolbarDisplayMode >> styleName [ ^ 'toolBar.label' diff --git a/src/Spec2-Core/SpLabeledPresenter.class.st b/src/Spec2-Core/SpLabeledPresenter.class.st index 96f41dd36..13ef5ab3f 100644 --- a/src/Spec2-Core/SpLabeledPresenter.class.st +++ b/src/Spec2-Core/SpLabeledPresenter.class.st @@ -9,17 +9,19 @@ Example: self instantiate: (LabelledPresenter label: 'Email' input: self newTextInput description: 'Email adress to use to send activation and informations emails.') " Class { - #name : #SpLabeledPresenter, - #superclass : #SpPresenter, + #name : 'SpLabeledPresenter', + #superclass : 'SpPresenter', #instVars : [ 'input', 'descriptionPresenter', 'labelPresenter' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #layout } +{ #category : 'layout' } SpLabeledPresenter class >> defaultLayout [ ^ SpBoxLayout newLeftToRight add: #labelPresenter withConstraints: [ :constraints | constraints width: self labelWidth ]; @@ -30,12 +32,12 @@ SpLabeledPresenter class >> defaultLayout [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpLabeledPresenter class >> label: aString input: aPresenter [ ^ self label: aString input: aPresenter description: nil ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpLabeledPresenter class >> label: aString input: aPresenter description: anotherString [ ^ self new label: aString; @@ -44,7 +46,7 @@ SpLabeledPresenter class >> label: aString input: aPresenter description: anothe yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> description: aString [ aString ifNil: [ ^ self ]. @@ -54,44 +56,44 @@ SpLabeledPresenter >> description: aString [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> descriptionPresenter [ ^ descriptionPresenter ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> descriptionPresenter: anObject [ descriptionPresenter := anObject ] -{ #category : #initialization } +{ #category : 'initialization' } SpLabeledPresenter >> initializePresenters [ labelPresenter := self newLabel. descriptionPresenter := self newNullPresenter. "By default it is null" ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> input [ ^ input ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> input: anObject [ input := anObject. self focusOrder add: input ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> label: aString [ labelPresenter label: aString ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> labelPresenter [ ^ labelPresenter ] -{ #category : #accessing } +{ #category : 'accessing' } SpLabeledPresenter >> labelPresenter: anObject [ labelPresenter := anObject ] diff --git a/src/Spec2-Core/SpLinkTableColumn.class.st b/src/Spec2-Core/SpLinkTableColumn.class.st index c848a02a2..865990ff0 100644 --- a/src/Spec2-Core/SpLinkTableColumn.class.st +++ b/src/Spec2-Core/SpLinkTableColumn.class.st @@ -10,16 +10,18 @@ SpIndexTableColumn ``` " Class { - #name : #SpLinkTableColumn, - #superclass : #SpTableColumn, + #name : 'SpLinkTableColumn', + #superclass : 'SpTableColumn', #instVars : [ 'action', 'url' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpLinkTableColumn class >> title: aString evaluated: aBlock action: actionBlock [ ^ self new @@ -29,7 +31,7 @@ SpLinkTableColumn class >> title: aString evaluated: aBlock action: actionBlock yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpLinkTableColumn class >> title: aString evaluated: aBlock url: urlBlock [ ^ self new @@ -39,28 +41,28 @@ SpLinkTableColumn class >> title: aString evaluated: aBlock url: urlBlock [ yourself ] -{ #category : #visiting } +{ #category : 'visiting' } SpLinkTableColumn >> acceptColumnVisitor: aBuilder [ ^ aBuilder visitLinkColumn: self ] -{ #category : #accessing } +{ #category : 'accessing' } SpLinkTableColumn >> action [ ^ action ] -{ #category : #accessing } +{ #category : 'accessing' } SpLinkTableColumn >> action: aBlock [ action := aBlock ] -{ #category : #accessing } +{ #category : 'accessing' } SpLinkTableColumn >> url [ ^ url ] -{ #category : #accessing } +{ #category : 'accessing' } SpLinkTableColumn >> url: anObject [ url := anObject ] diff --git a/src/Spec2-Core/SpListPresenter.class.st b/src/Spec2-Core/SpListPresenter.class.st index 6660b806b..bdbd4483e 100644 --- a/src/Spec2-Core/SpListPresenter.class.st +++ b/src/Spec2-Core/SpListPresenter.class.st @@ -11,8 +11,8 @@ It means many fonctionality related to the selection (selected items, multiple i A list presenter does not offer the possibility to add one item in isolation instead you should use the `items:` setter to set the full list domain object. The responsibility to manage the items displayed by a list presenter is not the one of that list presenter but its users e.g, the presenter you will write and that instantiates and uses the list presenter. This is normal since there is no way that the list presenter could track changes into the domain object representing the list items. " Class { - #name : #SpListPresenter, - #superclass : #SpAbstractListPresenter, + #name : 'SpListPresenter', + #superclass : 'SpAbstractListPresenter', #traits : 'SpTSearchable + SpTDecoratedText', #classTraits : 'SpTSearchable classTrait + SpTDecoratedText classTrait', #instVars : [ @@ -22,22 +22,24 @@ Class { '#display => ObservableSlot', '#icon => ObservableSlot' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #specs } +{ #category : 'specs' } SpListPresenter class >> adapterName [ ^ #ListAdapter ] -{ #category : #specs } +{ #category : 'specs' } SpListPresenter class >> title [ ^ 'List' ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> clickOnSelectedItem [ | item | @@ -45,7 +47,7 @@ SpListPresenter >> clickOnSelectedItem [ ^ item notNil and: [ (item respondsTo: #click) and: [ item click ] ] ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> display [ "Answer the display block that will transform the objects from `SpAbstractListPresenter>>#model` into a displayable string." @@ -53,7 +55,7 @@ SpListPresenter >> display [ ^ display ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> display: aBlock [ "Set the block that will be applied on each of the list items. The result of the block will be used to display the item on the screen. @@ -70,14 +72,14 @@ SpListPresenter >> display: aBlock [ display := aBlock ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> displayIcon [ "Return the block used to return an icon that will be displayed in the list" ^ icon ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> displayIcon: aBlock [ "Set a block which takes an item as argument and returns the icon to display in the list. `aBlock` receives one argument" @@ -85,7 +87,7 @@ SpListPresenter >> displayIcon: aBlock [ icon := aBlock ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> displayValueAt: anIndex [ "Return the effective string that is displayed on the list. Note that it is different from the item, because often an item is an object whose only a facette (e.g., name) is displayed. In such case displayValueAt: return the string of the displayed facette" @@ -93,48 +95,48 @@ SpListPresenter >> displayValueAt: anIndex [ ^ self displayValueFor: (model at: anIndex) ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> displayValueFor: anObject [ ^ self display value: anObject ] -{ #category : #testing } +{ #category : 'testing' } SpListPresenter >> hasHeaderTitle [ "Answer true if the list has a title (See `SpListPresenter>>#headerTitle:`)." ^ headerTitle isEmptyOrNil not ] -{ #category : #testing } +{ #category : 'testing' } SpListPresenter >> hasIcons [ "Answer true if the list has an icon provider (See `SpListPresenter>>#icons:`)." ^ self displayIcon notNil ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> headerTitle [ "Answer the header title." ^ headerTitle ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> headerTitle: aString [ "Set the header title." headerTitle := aString ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> hideHeaderTitle [ "Hide list header." headerTitle := nil ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> iconFor: anItem [ ^ self displayIcon @@ -142,7 +144,7 @@ SpListPresenter >> iconFor: anItem [ cull: self ] -{ #category : #initialization } +{ #category : 'initialization' } SpListPresenter >> initialize [ super initialize. @@ -152,12 +154,12 @@ SpListPresenter >> initialize [ display := [ :object | object asStringOrText ] ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> prepareForFilteredDataSourceWith: items [ model := items ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> registerEvents [ super registerEvents. "Do not use whenAutoDeselectChangedDo: to avoid the deprecation warning." @@ -172,19 +174,19 @@ SpListPresenter >> registerEvents [ self withAdapterDo: [ :anAdapter | anAdapter refreshWidgetHeaderTitle ] ] ] -{ #category : #private } +{ #category : 'private' } SpListPresenter >> resetListSelection [ self selectIndex: 0 ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpListPresenter >> resetSortingBlock [ "Reset the sortering block with the default value which consists in not sorting" self model sortingBlock: nil ] -{ #category : #api } +{ #category : 'api' } SpListPresenter >> updateList [ "Update the list re taking the list defined in `SpAbstractListPresenter>>#model` and filling the list with them (this is useful when the list contained changed internally (like adding element to a collection, etc.). @@ -194,7 +196,7 @@ SpListPresenter >> updateList [ self unselectAll ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpListPresenter >> whenDisplayChangedDo: aBlock [ "Inform when the display block has changed. `aBlock` has three optional arguments: @@ -205,7 +207,7 @@ SpListPresenter >> whenDisplayChangedDo: aBlock [ self property: #display whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpListPresenter >> whenIconsChangedDo: aBlock [ "Inform when the icons block has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpLocationIconProvider.class.st b/src/Spec2-Core/SpLocationIconProvider.class.st index 0e5cc3c9e..2f7a0b901 100644 --- a/src/Spec2-Core/SpLocationIconProvider.class.st +++ b/src/Spec2-Core/SpLocationIconProvider.class.st @@ -5,16 +5,18 @@ It receive locations (directory references) where to find them. Alternatively, it can also look for gtk theme icons (stored by name in the gtk theme). " Class { - #name : #SpLocationIconProvider, - #superclass : #SpIconProvider, + #name : 'SpLocationIconProvider', + #superclass : 'SpIconProvider', #instVars : [ 'icons', 'locations' ], - #category : #'Spec2-Core-IconProvider' + #category : 'Spec2-Core-IconProvider', + #package : 'Spec2-Core', + #tag : 'IconProvider' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpLocationIconProvider class >> newLocation: aLocation [ ^ self new @@ -22,13 +24,13 @@ SpLocationIconProvider class >> newLocation: aLocation [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> addLocation: aReference [ locations := locations copyWith: aReference ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> iconNamed: aName ifAbsent: aBlock [ | icon | @@ -42,13 +44,13 @@ SpLocationIconProvider >> iconNamed: aName ifAbsent: aBlock [ ^ icon ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> icons [ ^ icons ] -{ #category : #initialization } +{ #category : 'initialization' } SpLocationIconProvider >> initialize [ super initialize. @@ -57,13 +59,13 @@ SpLocationIconProvider >> initialize [ self initializeBlankIcon ] -{ #category : #initialization } +{ #category : 'initialization' } SpLocationIconProvider >> initializeBlankIcon [ self setBlankIcon: (Form extent: 16@16 depth: 8) ] -{ #category : #inspecting } +{ #category : 'inspecting' } SpLocationIconProvider >> inspectionIcons [ @@ -74,7 +76,7 @@ SpLocationIconProvider >> inspectionIcons [ yourself ] -{ #category : #utilities } +{ #category : 'utilities' } SpLocationIconProvider >> loadAllIcons [ self locations do: [ :eachLocation | @@ -84,7 +86,7 @@ SpLocationIconProvider >> loadAllIcons [ put: (self loadIcon: each) ] ] ] -{ #category : #utilities } +{ #category : 'utilities' } SpLocationIconProvider >> loadIcon: fileReference [ fileReference exists ifFalse: [ @@ -94,7 +96,7 @@ SpLocationIconProvider >> loadIcon: fileReference [ Form fromBinaryStream: stream ] ] -{ #category : #utilities } +{ #category : 'utilities' } SpLocationIconProvider >> loadIconNamed: aSymbol [ self locations do: [ :each | | ref | @@ -104,19 +106,19 @@ SpLocationIconProvider >> loadIconNamed: aSymbol [ ^ nil ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> locations [ ^ locations ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> menuIconNamed: aName [ ^ self iconNamed: aName ] -{ #category : #accessing } +{ #category : 'accessing' } SpLocationIconProvider >> setBlankIcon: aForm [ "To be able to specify the form that represents a missing icon." diff --git a/src/Spec2-Core/SpMenuBarPresenter.class.st b/src/Spec2-Core/SpMenuBarPresenter.class.st index 69e0e4fa4..6e962d6bd 100644 --- a/src/Spec2-Core/SpMenuBarPresenter.class.st +++ b/src/Spec2-Core/SpMenuBarPresenter.class.st @@ -8,29 +8,31 @@ I'm different from a simple menu in: Tipically, this menu will be presented at the top of a window. " Class { - #name : #SpMenuBarPresenter, - #superclass : #SpMenuPresenter, - #category : #'Spec2-Core-Widgets' + #name : 'SpMenuBarPresenter', + #superclass : 'SpMenuPresenter', + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpMenuBarPresenter class >> adapterName [ ^ #MenuBarAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuBarPresenter class >> addDocumentExtraSections: aBuilder [ "It does not applies here" ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuBarPresenter class >> documentExampleCodeSelector [ ^ #example ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuBarPresenter class >> documentFactoryMethodSelector [ ^ #newMenuBar diff --git a/src/Spec2-Core/SpMenuButtonPresenter.class.st b/src/Spec2-Core/SpMenuButtonPresenter.class.st index 53cce69a4..ca62fef92 100644 --- a/src/Spec2-Core/SpMenuButtonPresenter.class.st +++ b/src/Spec2-Core/SpMenuButtonPresenter.class.st @@ -3,45 +3,47 @@ A presenter to create a menu button (a button who exposes a menu instead having " Class { - #name : #SpMenuButtonPresenter, - #superclass : #SpAbstractButtonPresenter, + #name : 'SpMenuButtonPresenter', + #superclass : 'SpAbstractButtonPresenter', #instVars : [ '#menu => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpMenuButtonPresenter class >> adapterName [ ^ #MenuButtonAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuButtonPresenter class >> documentFactoryMethodSelector [ ^ #newMenuButton ] -{ #category : #specs } +{ #category : 'specs' } SpMenuButtonPresenter class >> title [ ^ 'MenuButton' ] -{ #category : #initialization } +{ #category : 'initialization' } SpMenuButtonPresenter >> initialize [ super initialize. ] -{ #category : #api } +{ #category : 'api' } SpMenuButtonPresenter >> menu [ "Answer the menu (an instance of `SpMenuPresenter` or a block) to show." ^ menu ] -{ #category : #api } +{ #category : 'api' } SpMenuButtonPresenter >> menu: aValuable [ "Set the menu to show. `aValuable` can be an instance of `SpMenuPresenter` or a block to allow dynamic behavior." @@ -49,7 +51,7 @@ SpMenuButtonPresenter >> menu: aValuable [ menu := aValuable ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMenuButtonPresenter >> whenMenuChangedDo: aBlock [ "Inform when menu property has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpMenuGroupPresenter.class.st b/src/Spec2-Core/SpMenuGroupPresenter.class.st index 1163697f9..3062236ed 100644 --- a/src/Spec2-Core/SpMenuGroupPresenter.class.st +++ b/src/Spec2-Core/SpMenuGroupPresenter.class.st @@ -3,28 +3,30 @@ A presenter for grouping menu items. A group is always part of a menu (See `SpMenuPresenter`), and it groups items (See `SpMenuItemPresenter`). " Class { - #name : #SpMenuGroupPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpMenuGroupPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#items', '#autoRefresh => ObservableSlot' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpMenuGroupPresenter class >> adapterName [ ^ #MenuGroupAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuGroupPresenter class >> documentExampleCodeSelector [ ^ #exampleMenuGroup ] -{ #category : #private } +{ #category : 'private' } SpMenuGroupPresenter >> add: aName target: targetObject selector: aSelector [ self flag: #TODO. "This is for compatibility with the old menu builder and needs to be removed!" @@ -35,7 +37,7 @@ SpMenuGroupPresenter >> add: aName target: targetObject selector: aSelector [ ^ self menuItems last ] -{ #category : #api } +{ #category : 'api' } SpMenuGroupPresenter >> addItem: aBlock [ | item | @@ -44,24 +46,24 @@ SpMenuGroupPresenter >> addItem: aBlock [ self addMenuItem: item ] -{ #category : #private } +{ #category : 'private' } SpMenuGroupPresenter >> addMenuItem: aMenuItem [ aMenuItem owner: self. items add: aMenuItem ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuGroupPresenter >> autoRefresh [ ^ autoRefresh ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuGroupPresenter >> autoRefresh: aBoolean [ autoRefresh := aBoolean ] -{ #category : #private } +{ #category : 'private' } SpMenuGroupPresenter >> buildWithLayout: aSpecLayout [ "Build the widget using the spec name provided as argument" | widget| @@ -71,39 +73,39 @@ SpMenuGroupPresenter >> buildWithLayout: aSpecLayout [ ^ widget ] -{ #category : #testing } +{ #category : 'testing' } SpMenuGroupPresenter >> canTakeKeyboardFocus [ "Answer when the presenter can take keyboard focus." ^ false ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuGroupPresenter >> fromSpec: aSpec [ self addItem: [ :item | item fromSpec: aSpec ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpMenuGroupPresenter >> initialize [ super initialize. items := OrderedCollection new asValueHolder ] -{ #category : #testing } +{ #category : 'testing' } SpMenuGroupPresenter >> isEmpty [ "Answer true if the group is empty" ^ items isEmpty ] -{ #category : #api } +{ #category : 'api' } SpMenuGroupPresenter >> menuItems [ ^ items value ] -{ #category : #private } +{ #category : 'private' } SpMenuGroupPresenter >> rootMenu [ ^ self owner rootMenu diff --git a/src/Spec2-Core/SpMenuItemPresenter.class.st b/src/Spec2-Core/SpMenuItemPresenter.class.st index fbb14b484..5d3aa1b58 100644 --- a/src/Spec2-Core/SpMenuItemPresenter.class.st +++ b/src/Spec2-Core/SpMenuItemPresenter.class.st @@ -7,8 +7,8 @@ A menu item can have: an action (See `SpMenuItemPresenter>>#action:`) **OR** it Tipically, you do not call directly `SpMenuItemPresenter`. Instead, you use the builder method provided when building a `SpMenuPresenter` (See example below). " Class { - #name : #SpMenuItemPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpMenuItemPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#name => ObservableSlot', '#icon => ObservableSlot', @@ -18,29 +18,31 @@ Class { '#subMenu', '#state' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpMenuItemPresenter class >> adapterName [ ^ #MenuItemAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuItemPresenter class >> documentExampleCodeSelector [ ^ #exampleShowAtPointer ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> action [ "Answer the action to be executed when the menu item is selected." ^ action ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> action: aBlock [ "Set the action to be executed when the menu item is selected. `aBlock` receives zero arguments." @@ -48,14 +50,14 @@ SpMenuItemPresenter >> action: aBlock [ action := aBlock ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> description [ "Answer the description for the menu item." ^ description ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> description: aString [ "Set a description for the menu item. In some platforms (like Morphic), it can be shown as a tooltip text." @@ -63,33 +65,33 @@ SpMenuItemPresenter >> description: aString [ description := aString ] -{ #category : #testing } +{ #category : 'testing' } SpMenuItemPresenter >> hasShortcut [ ^ self shortcut notNil ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> icon [ "Answer the icon to be shown with the menu item." ^ icon ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> icon: anIcon [ "Set an icon (an instance of `Form`) to be shown with the menu item." icon := anIcon ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuItemPresenter >> iconName: aString [ self icon: (self iconNamed: aString) ] -{ #category : #initialization } +{ #category : 'initialization' } SpMenuItemPresenter >> initialize [ super initialize. @@ -97,13 +99,13 @@ SpMenuItemPresenter >> initialize [ name := '' ] -{ #category : #testing } +{ #category : 'testing' } SpMenuItemPresenter >> isMenuPresenter [ ^ true ] -{ #category : #localization } +{ #category : 'localization' } SpMenuItemPresenter >> localeChanged [ super localeChanged. @@ -111,14 +113,14 @@ SpMenuItemPresenter >> localeChanged [ ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> name [ "Answer the name of the menu item. This will be displayed as label." ^ name ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> name: aString [ "The label of the menu item. In certain backends (Gtk), we allow this label to contain mnemonics using an underscore ($_) @@ -130,7 +132,7 @@ SpMenuItemPresenter >> name: aString [ name := aString ] -{ #category : #private } +{ #category : 'private' } SpMenuItemPresenter >> performMenuActionWith: aMenuItem [ | en | @@ -141,18 +143,18 @@ SpMenuItemPresenter >> performMenuActionWith: aMenuItem [ self action cull: aMenuItem ] -{ #category : #private } +{ #category : 'private' } SpMenuItemPresenter >> rootMenu [ ^ self owner rootMenu ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> shortcut [ ^ shortcut ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> shortcut: aShortcut [ "Set a shortcut (an instance of `KMKeyCombination`) that be shown with the menu item. **IMPORTANT:** Since most menus are added dinamically to its presenters (as part of a @@ -163,26 +165,26 @@ SpMenuItemPresenter >> shortcut: aShortcut [ shortcut := aShortcut ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuItemPresenter >> state [ ^ state ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuItemPresenter >> state: aBoolean [ self flag: #REVIEW. "Maybe not removed but implemented correctly?" state := aBoolean ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> subMenu [ "Answer the submenu that will be displayed with this menu if any, or nil." ^ subMenu ] -{ #category : #api } +{ #category : 'api' } SpMenuItemPresenter >> subMenu: aMenuPresenter [ "Set the submenu that will be displayed with this menu. If a submenu is shown, defined action (See `SpMenuItemPresenter>>#action:`) will be ignored." @@ -192,7 +194,7 @@ SpMenuItemPresenter >> subMenu: aMenuPresenter [ subMenu := aMenuPresenter ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMenuItemPresenter >> whenDescriptionChangedDo: aBlock [ "Inform when description has changed. `aBlock` has three optional arguments: @@ -203,7 +205,7 @@ SpMenuItemPresenter >> whenDescriptionChangedDo: aBlock [ self property: #description whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMenuItemPresenter >> whenIconChangedDo: aBlock [ "Inform when icon has changed. `aBlock` has three optional arguments: @@ -214,7 +216,7 @@ SpMenuItemPresenter >> whenIconChangedDo: aBlock [ self property: #icon whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMenuItemPresenter >> whenNameChangedDo: aBlock [ "Inform when name has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpMenuPresenter.class.st b/src/Spec2-Core/SpMenuPresenter.class.st index 060355372..b1462ff29 100644 --- a/src/Spec2-Core/SpMenuPresenter.class.st +++ b/src/Spec2-Core/SpMenuPresenter.class.st @@ -4,8 +4,8 @@ A menu presenter contains groups of menu items (having one unique group by defau A menu presenter is included in presenters that implement the `#contextMenu:` (See below) method, but it can also be invoked by calling `SpMenuPresenter>>#openWithSpecAt:` " Class { - #name : #SpMenuPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpMenuPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#groups', '#title => ObservableSlot', @@ -14,16 +14,18 @@ Class { '#shortcutGroup', '#defaultGroup' ], - #category : #'Spec2-Core-Widgets' + #category : 'Spec2-Core-Widgets', + #package : 'Spec2-Core', + #tag : 'Widgets' } -{ #category : #specs } +{ #category : 'specs' } SpMenuPresenter class >> adapterName [ ^ #MenuAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuPresenter class >> addDocumentExtraSections: aBuilder [ aBuilder newLine. @@ -34,19 +36,19 @@ SpMenuPresenter class >> addDocumentExtraSections: aBuilder [ aBuilder monospace: eachType name ] ] ] ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuPresenter class >> documentExampleCodeSelector [ ^ #exampleShowAtPointer ] -{ #category : #documentation } +{ #category : 'documentation' } SpMenuPresenter class >> documentFactoryMethodSelector [ ^ #newMenu ] -{ #category : #specs } +{ #category : 'specs' } SpMenuPresenter class >> popup [ @@ -54,7 +56,7 @@ SpMenuPresenter class >> popup [ adaptAsPopup: #(presenter)) ] -{ #category : #'api - building' } +{ #category : 'api - building' } SpMenuPresenter >> addAllFromPragma: pragma target: target [ self fromSpec: (PragmaMenuBuilder @@ -62,7 +64,7 @@ SpMenuPresenter >> addAllFromPragma: pragma target: target [ model: target) menuSpec ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> addGroup: aBlock [ "Add a group of items. If you do not want a multiple-group menu, you can use `SpMenuPresenter>>#addItem:` instead." @@ -73,7 +75,7 @@ SpMenuPresenter >> addGroup: aBlock [ self addMenuGroup: group ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> addItem: aBlock [ "Add an item to the menu. When the menu group has not been specified previously, add the item in a default group. @@ -82,43 +84,43 @@ SpMenuPresenter >> addItem: aBlock [ self defaultGroup addItem: aBlock ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> addKeybindingsTo: aPresenter [ "bind keybindings (shortcuts) defined in this menu to aPresenter" aPresenter applyKeyBindingsFromMenu: self ] -{ #category : #private } +{ #category : 'private' } SpMenuPresenter >> addMenuGroup: aMenuGroup [ aMenuGroup owner: self. groups add: aMenuGroup ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuPresenter >> autoRefresh [ ^ autoRefresh ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuPresenter >> autoRefresh: aBoolean [ autoRefresh := aBoolean ] -{ #category : #'api - building' } +{ #category : 'api - building' } SpMenuPresenter >> buildWithSpecAsPopup [ ^ self build ] -{ #category : #testing } +{ #category : 'testing' } SpMenuPresenter >> canTakeKeyboardFocus [ ^ false ] -{ #category : #accessing } +{ #category : 'accessing' } SpMenuPresenter >> defaultGroup [ ^ defaultGroup ifNil: [ @@ -127,7 +129,7 @@ SpMenuPresenter >> defaultGroup [ defaultGroup ] ] -{ #category : #'api - building' } +{ #category : 'api - building' } SpMenuPresenter >> fromSpec: aSpec [ | grps subgroup | @@ -148,35 +150,35 @@ SpMenuPresenter >> fromSpec: aSpec [ group addItem: [ :item | item fromSpec: spec ] ] ] ] ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> icon [ ^ icon ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> icon: anIcon [ icon := anIcon ] -{ #category : #TOREMOVE } +{ #category : 'TOREMOVE' } SpMenuPresenter >> iconName: aSymbol [ self icon: (self iconNamed: aSymbol) ] -{ #category : #initialization } +{ #category : 'initialization' } SpMenuPresenter >> initialize [ super initialize. groups := OrderedCollection new ] -{ #category : #testing } +{ #category : 'testing' } SpMenuPresenter >> isMenuPresenter [ ^ true ] -{ #category : #localization } +{ #category : 'localization' } SpMenuPresenter >> localeChanged [ super localeChanged. @@ -184,12 +186,12 @@ SpMenuPresenter >> localeChanged [ ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> menuGroups [ ^ groups ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> openWithSpecAt: aPosition [ "Open this menu at `aPosition`. `aPosition` os a instance of `Point`" @@ -198,7 +200,7 @@ SpMenuPresenter >> openWithSpecAt: aPosition [ self withAdapterDo: [ :anAdapter | anAdapter openAt: aPosition ] ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> openWithSpecAtPointer [ "Open this menu at cursor position" @@ -206,7 +208,7 @@ SpMenuPresenter >> openWithSpecAtPointer [ self withAdapterDo: [ :anAdapter | anAdapter openAtPointer ] ] -{ #category : #printing } +{ #category : 'printing' } SpMenuPresenter >> printOn: aStream [ super printOn: aStream. self title value @@ -217,7 +219,7 @@ SpMenuPresenter >> printOn: aStream [ nextPutAll: '''' ] ] -{ #category : #accessing } +{ #category : 'accessing' } SpMenuPresenter >> rootMenu [ ^ self owner isMenuPresenter @@ -226,7 +228,7 @@ SpMenuPresenter >> rootMenu [ ] -{ #category : #accessing } +{ #category : 'accessing' } SpMenuPresenter >> shortcutGroup [ "Some platforms use acceleration groups to store shortcut keys. if that's the case, we use this property to access it later (and store @@ -235,18 +237,18 @@ SpMenuPresenter >> shortcutGroup [ ^ shortcutGroup ] -{ #category : #accessing } +{ #category : 'accessing' } SpMenuPresenter >> shortcutGroup: aKeyGroup [ shortcutGroup := aKeyGroup ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> title [ ^ title ] -{ #category : #api } +{ #category : 'api' } SpMenuPresenter >> title: aString [ title := aString ] diff --git a/src/Spec2-Core/SpMillerActivation.class.st b/src/Spec2-Core/SpMillerActivation.class.st index d85370aa3..8957fa441 100644 --- a/src/Spec2-Core/SpMillerActivation.class.st +++ b/src/Spec2-Core/SpMillerActivation.class.st @@ -1,13 +1,15 @@ Class { - #name : #SpMillerActivation, - #superclass : #Object, + #name : 'SpMillerActivation', + #superclass : 'Object', #instVars : [ 'value' ], - #category : #'Spec2-Core-Miller' + #category : 'Spec2-Core-Miller', + #package : 'Spec2-Core', + #tag : 'Miller' } -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpMillerActivation class >> on: anInteger [ ^ self new @@ -15,13 +17,13 @@ SpMillerActivation class >> on: anInteger [ yourself ] -{ #category : #accessing } +{ #category : 'accessing' } SpMillerActivation >> selectedItem [ ^ value ] -{ #category : #accessing } +{ #category : 'accessing' } SpMillerActivation >> value: anInteger [ value := anInteger ] diff --git a/src/Spec2-Core/SpMillerColumnPresenter.class.st b/src/Spec2-Core/SpMillerColumnPresenter.class.st index dd7fa2c57..b7a138446 100644 --- a/src/Spec2-Core/SpMillerColumnPresenter.class.st +++ b/src/Spec2-Core/SpMillerColumnPresenter.class.st @@ -13,18 +13,20 @@ You have to set me: All presenters inside this one should be polymorphic, defining: `whenActivatedDo:`, an event that will invoke a valuable with a selection object (understanding the message `selectedObject`). " Class { - #name : #SpMillerColumnPresenter, - #superclass : #SpPresenter, + #name : 'SpMillerColumnPresenter', + #superclass : 'SpPresenter', #instVars : [ '#newPresenterBlock', '#columnsWillChangeBlock', '#horizontalScrollBar => ObservableSlot', '#columnsChangedBlock' ], - #category : #'Spec2-Core-Miller' + #category : 'Spec2-Core-Miller', + #package : 'Spec2-Core', + #tag : 'Miller' } -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> addPresenter: newSubPresenter [ newSubPresenter whenActivatedDo: [ :selection | @@ -33,21 +35,21 @@ SpMillerColumnPresenter >> addPresenter: newSubPresenter [ layout add: newSubPresenter ] -{ #category : #private } +{ #category : 'private' } SpMillerColumnPresenter >> announceColumnsChanged: index [ columnsChangedBlock ifNil: [ ^ self ]. columnsChangedBlock cull: index ] -{ #category : #private } +{ #category : 'private' } SpMillerColumnPresenter >> announceColumnsWillChange: index [ columnsWillChangeBlock ifNil: [ ^ self ]. columnsWillChangeBlock cull: index ] -{ #category : #private } +{ #category : 'private' } SpMillerColumnPresenter >> changeSelection: selection from: aPresenter [ | selectedPresenterIndex | @@ -58,13 +60,13 @@ SpMillerColumnPresenter >> changeSelection: selection from: aPresenter [ self announceColumnsChanged: selectedPresenterIndex ] -{ #category : #testing } +{ #category : 'testing' } SpMillerColumnPresenter >> hasHorizontalScrollBar [ ^ horizontalScrollBar ] -{ #category : #initialization } +{ #category : 'initialization' } SpMillerColumnPresenter >> initialize [ super initialize. @@ -72,43 +74,43 @@ SpMillerColumnPresenter >> initialize [ self withHorizontalScrollBar ] -{ #category : #initialization } +{ #category : 'initialization' } SpMillerColumnPresenter >> initializePresenters [ layout := SpMillerLayout newHorizontal ] -{ #category : #private } +{ #category : 'private' } SpMillerColumnPresenter >> newPresenterFor: aModel [ ^ newPresenterBlock value: aModel ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> pages [ ^ layout presenters ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> presenterBlock: aBlock [ newPresenterBlock := aBlock ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> presenters [ ^ layout presenters ] -{ #category : #model } +{ #category : 'model' } SpMillerColumnPresenter >> pushModel: aModel [ self addPresenter: (self newPresenterFor: aModel) ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> removeAllFrom: aPage [ "remove all columns starting by this page." | index | @@ -118,7 +120,7 @@ SpMillerColumnPresenter >> removeAllFrom: aPage [ self selectPage: index ] -{ #category : #private } +{ #category : 'private' } SpMillerColumnPresenter >> resetTo: anIndex [ "Remove all presenters up to anIndex. 0 means to remove all elements." @@ -126,46 +128,46 @@ SpMillerColumnPresenter >> resetTo: anIndex [ index <= anIndex ifFalse: [ layout remove: presenter ] ] ] -{ #category : #paginator } +{ #category : 'paginator' } SpMillerColumnPresenter >> scrollByDeltaPercent: percent [ self withAdapterDo: [ :anAdapter | anAdapter scrollByDeltaPercent: percent ] ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> selectPage: aNumber [ self withAdapterDo: [ :anAdapter | anAdapter selectPage: aNumber ] ] -{ #category : #model } +{ #category : 'model' } SpMillerColumnPresenter >> setRootModel: aModel [ self resetTo: 0. self pushModel: aModel ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> size [ ^ self presenters size ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> spacing [ ^ layout spacing ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> spacing: aNumber [ layout spacing: aNumber ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpMillerColumnPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ self pages do: [ :each | @@ -174,43 +176,43 @@ SpMillerColumnPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ excluding: excludes ] ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> visiblePages [ ^ layout visiblePages ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> visiblePages: aNumber [ layout visiblePages: aNumber ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMillerColumnPresenter >> whenColumnsChangedDo: aBlock [ columnsChangedBlock := aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMillerColumnPresenter >> whenColumnsWillChangeDo: aBlock [ columnsWillChangeBlock := aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMillerColumnPresenter >> whenHorizontalScrollBarChangedDo: aBlock [ self property: #horizontalScrollBar whenChangedDo: aBlock ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> withHorizontalScrollBar [ horizontalScrollBar := true ] -{ #category : #api } +{ #category : 'api' } SpMillerColumnPresenter >> withoutHorizontalScrollBar [ horizontalScrollBar := false diff --git a/src/Spec2-Core/SpMillerPaginatorPresenter.class.st b/src/Spec2-Core/SpMillerPaginatorPresenter.class.st index 741da7faa..a9bd4eefb 100644 --- a/src/Spec2-Core/SpMillerPaginatorPresenter.class.st +++ b/src/Spec2-Core/SpMillerPaginatorPresenter.class.st @@ -3,23 +3,25 @@ A presenter that chains a miller list (`SpMillerColumnPresenter`) along with a p This is the most common usage of paginator, and there are several places where we want to use a miller list with pagination and this common presenter will be provifing basic functionality pre-made for consumption. " Class { - #name : #SpMillerPaginatorPresenter, - #superclass : #SpPresenter, + #name : 'SpMillerPaginatorPresenter', + #superclass : 'SpPresenter', #instVars : [ 'millerList', 'paginator', 'paginatorContainerLayout' ], - #category : #'Spec2-Core-Widgets-Advanced' + #category : 'Spec2-Core-Widgets-Advanced', + #package : 'Spec2-Core', + #tag : 'Widgets-Advanced' } -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> addPresenter: aPresenter [ self millerListPresenter addPresenter: aPresenter ] -{ #category : #initialization } +{ #category : 'initialization' } SpMillerPaginatorPresenter >> initializePresenters [ self layout: (SpBoxLayout newTopToBottom @@ -35,50 +37,50 @@ SpMillerPaginatorPresenter >> initializePresenters [ self updatePaginator: 1 ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> millerListPresenter [ ^ millerList ] -{ #category : #private } +{ #category : 'private' } SpMillerPaginatorPresenter >> newPaginator [ ^ self instantiate: SpPaginatorPresenter ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> pages [ ^ millerList pages ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> paginatorPresenter [ ^ paginator ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> removeAllFrom: aPresenter [ millerList removeAllFrom: aPresenter. self updatePaginator: ((millerList pages size - millerList visiblePages + 1) max: 1) ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> selectPage: aNumber [ self millerListPresenter selectPage: aNumber ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> spacing: aNumber [ self millerListPresenter spacing: aNumber ] -{ #category : #private } +{ #category : 'private' } SpMillerPaginatorPresenter >> updatePaginator: pageSelected [ millerList pages size > 1 @@ -97,7 +99,7 @@ SpMillerPaginatorPresenter >> updatePaginator: pageSelected [ paginator := nil ] ] -{ #category : #api } +{ #category : 'api' } SpMillerPaginatorPresenter >> visiblePages: aNumber [ self millerListPresenter visiblePages: 1. diff --git a/src/Spec2-Core/SpMillerPresenter.class.st b/src/Spec2-Core/SpMillerPresenter.class.st index 51892fc75..49146aa46 100644 --- a/src/Spec2-Core/SpMillerPresenter.class.st +++ b/src/Spec2-Core/SpMillerPresenter.class.st @@ -2,12 +2,14 @@ I'm a kind of API that a `SpMillerPresenter` should implement: basically one single method `whenActivedDo:`. " Class { - #name : #SpMillerPresenter, - #superclass : #SpPresenter, - #category : #'Spec2-Core-Miller' + #name : 'SpMillerPresenter', + #superclass : 'SpPresenter', + #category : 'Spec2-Core-Miller', + #package : 'Spec2-Core', + #tag : 'Miller' } -{ #category : #initialization } +{ #category : 'initialization' } SpMillerPresenter >> whenActivatedDo: aBlock [ self subclassResponsibility diff --git a/src/Spec2-Core/SpModalWindowPresenter.class.st b/src/Spec2-Core/SpModalWindowPresenter.class.st index bf1084b9e..9d7d8c991 100644 --- a/src/Spec2-Core/SpModalWindowPresenter.class.st +++ b/src/Spec2-Core/SpModalWindowPresenter.class.st @@ -30,21 +30,23 @@ SomePresenter >> initializeDialogWindow: aDialogPresenter ``` " Class { - #name : #SpModalWindowPresenter, - #superclass : #SpDialogWindowPresenter, + #name : 'SpModalWindowPresenter', + #superclass : 'SpDialogWindowPresenter', #instVars : [ '#closeOnBackdropClick => ObservableSlot' ], - #category : #'Spec2-Core-Windows' + #category : 'Spec2-Core-Windows', + #package : 'Spec2-Core', + #tag : 'Windows' } -{ #category : #specs } +{ #category : 'specs' } SpModalWindowPresenter class >> adapterName [ ^ #ModalWindowAdapter ] -{ #category : #api } +{ #category : 'api' } SpModalWindowPresenter >> closeOnBackdropClick [ "Answer if the user will be able to click on the backdrop to close the modal launching the cancel action." @@ -52,7 +54,7 @@ SpModalWindowPresenter >> closeOnBackdropClick [ ^ closeOnBackdropClick ] -{ #category : #api } +{ #category : 'api' } SpModalWindowPresenter >> closeOnBackdropClick: aBoolean [ "Set when the user will be able to click on the backdrop to close the modal launching the cancel action." @@ -60,7 +62,7 @@ SpModalWindowPresenter >> closeOnBackdropClick: aBoolean [ closeOnBackdropClick := aBoolean ] -{ #category : #initialization } +{ #category : 'initialization' } SpModalWindowPresenter >> initialize [ super initialize. diff --git a/src/Spec2-Core/SpMouseDoubleClickDefinition.class.st b/src/Spec2-Core/SpMouseDoubleClickDefinition.class.st index 886802eeb..15c8b204d 100644 --- a/src/Spec2-Core/SpMouseDoubleClickDefinition.class.st +++ b/src/Spec2-Core/SpMouseDoubleClickDefinition.class.st @@ -2,12 +2,14 @@ I define a double click event " Class { - #name : #SpMouseDoubleClickDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseDoubleClickDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseDoubleClickDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseDoubleClickEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMouseDownEventDefinition.class.st b/src/Spec2-Core/SpMouseDownEventDefinition.class.st index b75c781e6..8b6e4db1a 100644 --- a/src/Spec2-Core/SpMouseDownEventDefinition.class.st +++ b/src/Spec2-Core/SpMouseDownEventDefinition.class.st @@ -2,12 +2,14 @@ I define a mouse down event " Class { - #name : #SpMouseDownEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseDownEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseDownEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseDownEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMouseEnterEventDefinition.class.st b/src/Spec2-Core/SpMouseEnterEventDefinition.class.st index 77b3f2118..de23afed3 100644 --- a/src/Spec2-Core/SpMouseEnterEventDefinition.class.st +++ b/src/Spec2-Core/SpMouseEnterEventDefinition.class.st @@ -2,12 +2,14 @@ I define a mouse enter event " Class { - #name : #SpMouseEnterEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseEnterEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseEnterEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseEnterEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMouseLeaveEventDefinition.class.st b/src/Spec2-Core/SpMouseLeaveEventDefinition.class.st index 3e38c5bd4..2bc797f75 100644 --- a/src/Spec2-Core/SpMouseLeaveEventDefinition.class.st +++ b/src/Spec2-Core/SpMouseLeaveEventDefinition.class.st @@ -2,12 +2,14 @@ I define a key down event " Class { - #name : #SpMouseLeaveEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseLeaveEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseLeaveEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseLeaveEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMouseMoveEventDefinition.class.st b/src/Spec2-Core/SpMouseMoveEventDefinition.class.st index a8480ea0e..5cbef9efe 100644 --- a/src/Spec2-Core/SpMouseMoveEventDefinition.class.st +++ b/src/Spec2-Core/SpMouseMoveEventDefinition.class.st @@ -2,12 +2,14 @@ I define a mouse move event " Class { - #name : #SpMouseMoveEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseMoveEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseMoveEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseMoveEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMouseUpEventDefinition.class.st b/src/Spec2-Core/SpMouseUpEventDefinition.class.st index 91042438b..6956e6223 100644 --- a/src/Spec2-Core/SpMouseUpEventDefinition.class.st +++ b/src/Spec2-Core/SpMouseUpEventDefinition.class.st @@ -2,12 +2,14 @@ I define a mouse up event " Class { - #name : #SpMouseUpEventDefinition, - #superclass : #SpBaseEventDefinition, - #category : #'Spec2-Core-Base-Event' + #name : 'SpMouseUpEventDefinition', + #superclass : 'SpBaseEventDefinition', + #category : 'Spec2-Core-Base-Event', + #package : 'Spec2-Core', + #tag : 'Base-Event' } -{ #category : #installing } +{ #category : 'installing' } SpMouseUpEventDefinition >> installOn: anAdapter target: aWidget [ anAdapter installMouseUpEvent: self to: aWidget diff --git a/src/Spec2-Core/SpMultipleSelectionMode.class.st b/src/Spec2-Core/SpMultipleSelectionMode.class.st index de5e56602..7af2d398e 100644 --- a/src/Spec2-Core/SpMultipleSelectionMode.class.st +++ b/src/Spec2-Core/SpMultipleSelectionMode.class.st @@ -2,15 +2,17 @@ Implement multiple selection mode (Users can select multiple element of list or table) " Class { - #name : #SpMultipleSelectionMode, - #superclass : #SpAbstractSelectionMode, + #name : 'SpMultipleSelectionMode', + #superclass : 'SpAbstractSelectionMode', #instVars : [ '#selectedIndexes => ObservableSlot' ], - #category : #'Spec2-Core-Widgets-Table' + #category : 'Spec2-Core-Widgets-Table', + #package : 'Spec2-Core', + #tag : 'Widgets-Table' } -{ #category : #private } +{ #category : 'private' } SpMultipleSelectionMode >> basicSelectIndex: indexToSelect [ "Adding to the selection an out of range should not change selection" @@ -19,54 +21,54 @@ SpMultipleSelectionMode >> basicSelectIndex: indexToSelect [ self selectIndexes: (self selectedIndexes copyWith: indexToSelect) ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> includesIndex: anIndex [ ^ self selectedIndexes includes: anIndex ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> includesIndexes: aCollection [ ^ aCollection allSatisfy: [ :anIndex | self selectedIndexes includes: anIndex ] ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> includesItem: anItem [ ^ self selectedItems includes: anItem ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> includesItems: aCollection [ ^ aCollection allSatisfy: [ :anItem | self selectedItems includes: anItem ] ] -{ #category : #initialization } +{ #category : 'initialization' } SpMultipleSelectionMode >> initialize [ super initialize. selectedIndexes := OrderedCollection new ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> isEmpty [ ^ self selectedIndexes isEmpty ] -{ #category : #testing } +{ #category : 'testing' } SpMultipleSelectionMode >> isMultipleSelection [ ^ true ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectAll [ "Select all items." self selectIndexes: (1 to: self model size) ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectIndexes: aCollectionOfIndexes [ "Select items at positions included in `aCollectionOfIndexes`." | indexes | @@ -83,14 +85,14 @@ SpMultipleSelectionMode >> selectIndexes: aCollectionOfIndexes [ ^ selectedIndexes := indexes ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectItems: aCollection [ "Select items included in `aCollection` if they are included in model list." self selectIndexes: (aCollection collect: [ :anItem | self indexOfItem: anItem ]) ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectedIndex [ "Answer the first selected index." @@ -99,14 +101,14 @@ SpMultipleSelectionMode >> selectedIndex [ ifEmpty: [ 0 ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectedIndexes [ "Answer a collection with indexes of all selected items." ^ selectedIndexes ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectedItem [ "Answer first selected item." @@ -115,39 +117,39 @@ SpMultipleSelectionMode >> selectedItem [ ifEmpty: [ nil ] ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> selectedItems [ "Answer a collection with all selected items." ^ self widget itemsAt: self selectedIndexes ] -{ #category : #private } +{ #category : 'private' } SpMultipleSelectionMode >> selectedItemsSortedByIndex [ ^ self widget itemsAt: self selectedIndexes sort ] -{ #category : #private } +{ #category : 'private' } SpMultipleSelectionMode >> selectionHolder [ ^ self observablePropertyNamed: #selectedIndexes ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> unselectAll [ "Remove all selections." self selectIndexes: #() ] -{ #category : #'api - selection' } +{ #category : 'api - selection' } SpMultipleSelectionMode >> unselectIndex: anIndex [ "Unselect item at position `anInteger`." self selectIndexes: (self selectedIndexes copyWithout: anIndex) ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpMultipleSelectionMode >> whenChangedDo: aBlock [ "Inform when selection has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpNotebookPage.class.st b/src/Spec2-Core/SpNotebookPage.class.st index 196db46f2..3f2960798 100644 --- a/src/Spec2-Core/SpNotebookPage.class.st +++ b/src/Spec2-Core/SpNotebookPage.class.st @@ -5,8 +5,8 @@ A page can have a title, an icon and some other interesting properties. An important member is `SpNotebookPage>>#presenterProvider`, which contains a block to retrieve the content of the page, which can be resolved lazily. " Class { - #name : #SpNotebookPage, - #superclass : #Object, + #name : 'SpNotebookPage', + #superclass : 'Object', #traits : 'TObservable', #classTraits : 'TObservable classTrait', #instVars : [ @@ -19,14 +19,16 @@ Class { '#activePresenter => WeakSlot', '#labelPresenter' ], - #category : #'Spec2-Core-Widgets-Tab' + #category : 'Spec2-Core-Widgets-Tab', + #package : 'Spec2-Core', + #tag : 'Widgets-Tab' } -{ #category : #documentation } +{ #category : 'documentation' } SpNotebookPage class >> addDocumentExtraSections: aBuilder [ ] -{ #category : #documentation } +{ #category : 'documentation' } SpNotebookPage class >> addDocumentSectionFactoryMethod: aBuilder [ | selector | @@ -43,13 +45,13 @@ SpNotebookPage class >> addDocumentSectionFactoryMethod: aBuilder [ aBuilder text: '.' ] -{ #category : #documentation } +{ #category : 'documentation' } SpNotebookPage class >> documentFactoryMethodSelector [ ^ #newNotebookPage ] -{ #category : #documentation } +{ #category : 'documentation' } SpNotebookPage class >> documentSections [ ^ OrderedDictionary newFromPairs: { @@ -61,7 +63,7 @@ SpNotebookPage class >> documentSections [ (self methods select: [ :method | method protocolName = #'api - events' ]) } ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpNotebookPage class >> title: aString icon: anIcon provider: aBlock [ ^ self new @@ -71,7 +73,7 @@ SpNotebookPage class >> title: aString icon: anIcon provider: aBlock [ yourself ] -{ #category : #'instance creation' } +{ #category : 'instance creation' } SpNotebookPage class >> title: aString provider: aBlock [ ^ self new @@ -80,35 +82,35 @@ SpNotebookPage class >> title: aString provider: aBlock [ yourself ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> activePresenter [ "Answer current active presenter fot this page (it may be nil, if page has not been displayed yet)" ^ activePresenter ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> beCloseable [ "Set the page as closeable, make a closing button to appear with the title." closeable := true ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> icon [ "Answer the icon (an instance of `Form`) to show with title" ^ icon ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> icon: anIcon [ "Set the icon (an instance of `Form`) to show with title" icon := anIcon ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotebookPage >> initialize [ self class initializeSlots: self. @@ -116,14 +118,14 @@ SpNotebookPage >> initialize [ closeable := false ] -{ #category : #testing } +{ #category : 'testing' } SpNotebookPage >> isCloseable [ "Answer when the page is closeable or not" ^ closeable ] -{ #category : #accessing } +{ #category : 'accessing' } SpNotebookPage >> labelPresenterFor: ownerPresenter [ "There is one, and *just one* active label presenter for each page. The only case I can think that can be changed is if owner changed (if we move the page from @@ -137,7 +139,7 @@ SpNotebookPage >> labelPresenterFor: ownerPresenter [ ^ labelPresenter ] -{ #category : #'private - factory' } +{ #category : 'private - factory' } SpNotebookPage >> newLabelPresenterFor: ownerPresenter [ "override this to implement custom labels" @@ -146,33 +148,33 @@ SpNotebookPage >> newLabelPresenterFor: ownerPresenter [ on: self ] -{ #category : #accessing } +{ #category : 'accessing' } SpNotebookPage >> owner [ ^ owner ] -{ #category : #accessing } +{ #category : 'accessing' } SpNotebookPage >> owner: anObject [ owner := anObject ] -{ #category : #private } +{ #category : 'private' } SpNotebookPage >> pageTitleChanged [ self owner ifNil: [ ^ self ]. self owner pageTitleChanged: self ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> presenterProvider [ "Answer the presenter provider (tipically a block, but any valuable could work)." ^ presenterProvider ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> presenterProvider: aBlock [ "Set the presenter provider (tipically a block, but any valuable could work). The block will be executed before showing the page contents." @@ -180,21 +182,21 @@ SpNotebookPage >> presenterProvider: aBlock [ presenterProvider := aBlock ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> removeFromNotebook [ "Remove this page from the notebook." owner removePage: self ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> resetContent [ "force a redraw of contents of this page (next time it is selected)" self owner updatePageContent: self ] -{ #category : #private } +{ #category : 'private' } SpNotebookPage >> retrievePresenter [ "refresh all the time, because content may have change" @@ -204,21 +206,21 @@ SpNotebookPage >> retrievePresenter [ ^ activePresenter ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> title [ "Answer the title to show in the notebook" ^ title ] -{ #category : #api } +{ #category : 'api' } SpNotebookPage >> title: aString [ "Set the title to show in the notebook" title := aString ] -{ #category : #private } +{ #category : 'private' } SpNotebookPage >> unsubscribe: anObject [ | observableSlots | @@ -231,13 +233,13 @@ SpNotebookPage >> unsubscribe: anObject [ slotValue unsubscribe: anObject ] ]. ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPage >> whenIconChangedDo: aBlock [ self property: #icon whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPage >> whenRetrievedDo: aBlock [ "Inform when a page has been retrived, allowing extra settings. `aBlock` is a block with one orgument (the presenter retrieved)" @@ -245,7 +247,7 @@ SpNotebookPage >> whenRetrievedDo: aBlock [ retrievedBlock := aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPage >> whenTitleChangedDo: aBlock [ self property: #title whenChangedDo: aBlock diff --git a/src/Spec2-Core/SpNotebookPageLabelPresenter.class.st b/src/Spec2-Core/SpNotebookPageLabelPresenter.class.st index 69d131c2c..a3eb46bac 100644 --- a/src/Spec2-Core/SpNotebookPageLabelPresenter.class.st +++ b/src/Spec2-Core/SpNotebookPageLabelPresenter.class.st @@ -3,18 +3,20 @@ A presenter that acts as tab label for the notebook page. It is possible to put any widget in as label, this is just the ""default"" implementation. " Class { - #name : #SpNotebookPageLabelPresenter, - #superclass : #SpPresenter, + #name : 'SpNotebookPageLabelPresenter', + #superclass : 'SpPresenter', #traits : 'SpTModel', #classTraits : 'SpTModel classTrait', #instVars : [ 'labelPresenter', 'iconPresenter' ], - #category : #'Spec2-Core-Widgets-Tab' + #category : 'Spec2-Core-Widgets-Tab', + #package : 'Spec2-Core', + #tag : 'Widgets-Tab' } -{ #category : #initialization } +{ #category : 'initialization' } SpNotebookPageLabelPresenter >> initializePresenters [ self layout: (SpBoxLayout newLeftToRight @@ -46,13 +48,13 @@ SpNotebookPageLabelPresenter >> initializePresenters [ "self eventHandler whenDoubleClickDo: [ :event | 'ok' crTrace ]." ] -{ #category : #accessing } +{ #category : 'accessing' } SpNotebookPageLabelPresenter >> label [ ^ labelPresenter label ] -{ #category : #'accessing - model' } +{ #category : 'accessing - model' } SpNotebookPageLabelPresenter >> model: aModel [ (model notNil @@ -63,19 +65,19 @@ SpNotebookPageLabelPresenter >> model: aModel [ self updatePresenter ] -{ #category : #subscription } +{ #category : 'subscription' } SpNotebookPageLabelPresenter >> unsubscribePage: aPage [ aPage unsubscribe: self ] -{ #category : #'private - updating' } +{ #category : 'private - updating' } SpNotebookPageLabelPresenter >> updateIcon [ iconPresenter image: self model icon ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotebookPageLabelPresenter >> updatePresenter [ self model @@ -83,7 +85,7 @@ SpNotebookPageLabelPresenter >> updatePresenter [ whenIconChangedDo: [ self updateIcon ] ] -{ #category : #'private - updating' } +{ #category : 'private - updating' } SpNotebookPageLabelPresenter >> updateTitle [ labelPresenter label: self model title diff --git a/src/Spec2-Core/SpNotebookPresenter.class.st b/src/Spec2-Core/SpNotebookPresenter.class.st index 1fb843495..0fa0c47ef 100644 --- a/src/Spec2-Core/SpNotebookPresenter.class.st +++ b/src/Spec2-Core/SpNotebookPresenter.class.st @@ -3,28 +3,30 @@ I'm a presenter for a tabbed notebook container. This is a container whos children are pages (instances of `SpNotebookPage`), which have a title and a content. " Class { - #name : #SpNotebookPresenter, - #superclass : #SpAbstractWidgetPresenter, + #name : 'SpNotebookPresenter', + #superclass : 'SpAbstractWidgetPresenter', #instVars : [ '#pagesHolder', '#selectedPage => ObservableSlot' ], - #category : #'Spec2-Core-Widgets-Tab' + #category : 'Spec2-Core-Widgets-Tab', + #package : 'Spec2-Core', + #tag : 'Widgets-Tab' } -{ #category : #specs } +{ #category : 'specs' } SpNotebookPresenter class >> adapterName [ ^ #NotebookAdapter ] -{ #category : #documentation } +{ #category : 'documentation' } SpNotebookPresenter class >> documentFactoryMethodSelector [ ^ #newNotebook ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> addPage: aPage [ "Add a page (an instance of `SpNotebookPage`) to the notebook." @@ -32,14 +34,14 @@ SpNotebookPresenter >> addPage: aPage [ pagesHolder add: aPage ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> addPageTitle: aString provider: aBlock [ "A convenience method to directly add a page with a provider." ^ self addPage: (SpNotebookPage title: aString provider: aBlock) ] -{ #category : #initialization } +{ #category : 'initialization' } SpNotebookPresenter >> initialize [ super initialize. @@ -47,26 +49,26 @@ SpNotebookPresenter >> initialize [ pagesHolder whenChangedDo: [ self pagesChanged ] ] -{ #category : #private } +{ #category : 'private' } SpNotebookPresenter >> pageAt: index [ ^ self pages at: index ] -{ #category : #private } +{ #category : 'private' } SpNotebookPresenter >> pageTitleChanged: aPage [ self changed: #updatePageTitle: with: { aPage } ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> pages [ "Answer all pages in the notebook." ^ pagesHolder value ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> pages: aCollection [ "Set all pages of the notebook. `aCollection` contains instances of `SpNotebookPage`." @@ -76,13 +78,13 @@ SpNotebookPresenter >> pages: aCollection [ pagesHolder valueChanged: nil ] -{ #category : #private } +{ #category : 'private' } SpNotebookPresenter >> pagesChanged [ self changed: #updatePages ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> removeAll [ "Remove all pages in notebook" @@ -90,28 +92,28 @@ SpNotebookPresenter >> removeAll [ pagesHolder removeAll ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> removePage: aPage [ "Remove the page `aPage` from the notebook." pagesHolder remove: aPage ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> removePageAt: anIndex [ "Remove the page at index `anIndex`." pagesHolder removeAt: anIndex ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> resetAllPageContents [ "Resets all page contents, forcing a refresh next time a page is selected." self pages do: [ :each | each resetContent ] ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> selectPage: aPage [ "Selects the page `aPage` from the notebook, switching to show it." @@ -119,21 +121,21 @@ SpNotebookPresenter >> selectPage: aPage [ selectedPage := aPage ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> selectPageIndex: aNumber [ "Select the page with the index `aNumber`." self selectPage: (self pages at: aNumber) ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> selectedPage [ "Answer current selected page." ^ selectedPage ] -{ #category : #api } +{ #category : 'api' } SpNotebookPresenter >> selectedPageIndex [ "Answer the index of selected page" | page | @@ -144,7 +146,7 @@ SpNotebookPresenter >> selectedPageIndex [ ^ self pages indexOf: page ] -{ #category : #'private - traversing' } +{ #category : 'private - traversing' } SpNotebookPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ excludes add: self. @@ -156,14 +158,14 @@ SpNotebookPresenter >> traverseInFocusOrderDo: aBlock excluding: excludes [ excluding: excludes ] -{ #category : #private } +{ #category : 'private' } SpNotebookPresenter >> updatePageContent: aPage [ self withAdapterDo: [ :anAdapter | anAdapter updatePageContent: aPage ] ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPresenter >> whenPageAddedDo: aBlock [ "Inform when a page has been added. `aBlock` receives one argument (the added page)" @@ -171,7 +173,7 @@ SpNotebookPresenter >> whenPageAddedDo: aBlock [ pagesHolder whenAddedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPresenter >> whenPageRemovedDo: aBlock [ "Inform when a page has been removed. `aBlock` receives one argument (the removed page)" @@ -179,7 +181,7 @@ SpNotebookPresenter >> whenPageRemovedDo: aBlock [ pagesHolder whenRemovedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPresenter >> whenPagesChangedDo: aBlock [ "Inform when pages has been changed. `aBlock` has three optional arguments: @@ -190,7 +192,7 @@ SpNotebookPresenter >> whenPagesChangedDo: aBlock [ pagesHolder whenChangedDo: aBlock ] -{ #category : #'api - events' } +{ #category : 'api - events' } SpNotebookPresenter >> whenSelectedPageChangedDo: aBlock [ "Inform when selected page has changed. `aBlock` has three optional arguments: diff --git a/src/Spec2-Core/SpNullApplication.class.st b/src/Spec2-Core/SpNullApplication.class.st index e457ca6d9..9beb2719a 100644 --- a/src/Spec2-Core/SpNullApplication.class.st +++ b/src/Spec2-Core/SpNullApplication.class.st @@ -3,12 +3,14 @@ I'm a default application for the case where no application is defined. I'm meant to provide backwards compatibility and I SHOULD NOT BE USED REGULARLY. " Class { - #name : #SpNullApplication, - #superclass : #SpApplication, - #category : #'Spec2-Core-Base' + #name : 'SpNullApplication', + #superclass : 'SpApplication', + #category : 'Spec2-Core-Base', + #package : 'Spec2-Core', + #tag : 'Base' } -{ #category : #'class initialization' } +{ #category : 'class initialization' } SpNullApplication class >> reset [