From 9f9607fcaf796ff47c0ff32da268ba268260f467 Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Sat, 23 Sep 2023 19:19:52 +0200 Subject: [PATCH] ZTimezone class side GT extensions by Andrei Chis --- .../ZTimestamp-GT/ZTimezone.extension.st | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/repository/ZTimestamp-GT/ZTimezone.extension.st b/repository/ZTimestamp-GT/ZTimezone.extension.st index 78c96a5..f777a7f 100644 --- a/repository/ZTimestamp-GT/ZTimezone.extension.st +++ b/repository/ZTimestamp-GT/ZTimezone.extension.st @@ -1,5 +1,29 @@ Extension { #name : #ZTimezone } +{ #category : #'*ZTimestamp-GT' } +ZTimezone class >> gtActionReloadAllTimezonesFor: anAction [ + + + ^ anAction button + icon: BrGlamorousVectorIcons refresh; + tooltip: 'Reload all timezones'; + priority: 10; + action: [ self reloadAll ] +] + +{ #category : #'*ZTimestamp-GT' } +ZTimezone class >> gtSpotterTimezonesFor: aSearch [ + + + ^ aSearch list + priority: 10; + title: 'Timezones'; + items: [ self timezones values + sorted: [ :aTimezone | aTimezone id ] ascending ]; + itemName: [ :aTimezone | aTimezone id ]; + filterBySubstring +] + { #category : #'*ZTimestamp-GT' } ZTimezone >> gtViewDetailsIn: composite [ @@ -13,6 +37,40 @@ ZTimezone >> gtViewDetailsIn: composite [ send: #value ] +{ #category : #'*ZTimestamp-GT' } +ZTimezone class >> gtViewTimezonesFor: aView [ + + + ^ aView columnedList + title: 'Timezones'; + priority: 10; + items: [ self timezones values + sorted: [ :aTimezone | aTimezone id ] ascending ]; + column: 'Id' text: [ :aTimezone | aTimezone id ]; + column: 'Number of subzones' + text: [ :aTimezone | aTimezone subzones size ] + width: 250; + actionStencil: [ :aButton | + GtSpotterDropdownButtonStencil new + object: self; + tooltip: 'Search timezone id'; + id: GtPharoSearchCodeButtonId; + objectActOn: [ :anActOnEvent :anItem :theButton | + (anItem isKindOf: ZTimezone) ifTrue: [ + | columnedList | + + columnedList := theButton phlow viewContent + allChildrenBreadthFirstDetect: [ :child | + child isKindOf: BrColumnedList ] + ifFound: [ :child | child ]. + columnedList scrollToItem: anItem. + columnedList selectOne: (columnedList items indexOf: anItem). + + anActOnEvent beActed ] ]; + asElement ] + tooltip: 'Search timezone id' +] + { #category : #'*ZTimestamp-GT' } ZTimezone >> gtViewTransitionsIn: composite [