From fc1fae6d3b885c3ef22f50c94a3676e70eaf2fb5 Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Fri, 10 Nov 2023 11:29:50 +0100 Subject: [PATCH] Move over all remaining ZTimestamp-GT extensions --- .../ZTimestamp-GT/ZSubTimezone.extension.st | 14 -- .../ZTimestampFormat.extension.st | 16 -- .../ZTimestamp-GT/ZTimezone.extension.st | 169 ------------------ 3 files changed, 199 deletions(-) delete mode 100644 repository/ZTimestamp-GT/ZSubTimezone.extension.st delete mode 100644 repository/ZTimestamp-GT/ZTimestampFormat.extension.st delete mode 100644 repository/ZTimestamp-GT/ZTimezone.extension.st diff --git a/repository/ZTimestamp-GT/ZSubTimezone.extension.st b/repository/ZTimestamp-GT/ZSubTimezone.extension.st deleted file mode 100644 index d2989bf..0000000 --- a/repository/ZTimestamp-GT/ZSubTimezone.extension.st +++ /dev/null @@ -1,14 +0,0 @@ -Extension { #name : #ZSubTimezone } - -{ #category : #'*ZTimestamp-GT' } -ZSubTimezone >> gtViewDetailsIn: composite [ - - ^ composite columnedList - title: 'Details'; - items: [ {('abbreviation' -> self abbreviation). - ('offset' -> self offset). - ('daylight saving' -> self isDaylightSaving) } ]; - column: 'Key' text: #key; - column: 'Value' text: #value; - send: #value -] diff --git a/repository/ZTimestamp-GT/ZTimestampFormat.extension.st b/repository/ZTimestamp-GT/ZTimestampFormat.extension.st deleted file mode 100644 index 254fafd..0000000 --- a/repository/ZTimestamp-GT/ZTimestampFormat.extension.st +++ /dev/null @@ -1,16 +0,0 @@ -Extension { #name : #ZTimestampFormat } - -{ #category : #'*ZTimestamp-GT' } -ZTimestampFormat >> gtViewDetailsIn: composite [ - - ^ composite columnedList - title: 'Details'; - items: [ {('specification by example' -> self specification). - ('now utc' -> (self format: ZTimestamp now)). - ('now local' -> (self format: DateAndTime now)). - ('elements' -> (self specificationElements)). - ('timezone' -> (self timezone ifNil: [ #'N/A' ])) } ]; - column: 'Key' text: #key; - column: 'Value' text: #value; - send: #value -] diff --git a/repository/ZTimestamp-GT/ZTimezone.extension.st b/repository/ZTimestamp-GT/ZTimezone.extension.st deleted file mode 100644 index fd748ad..0000000 --- a/repository/ZTimestamp-GT/ZTimezone.extension.st +++ /dev/null @@ -1,169 +0,0 @@ -Extension { #name : #ZTimezone } - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtActionReloadAllTimezonesFor: anAction [ - - - ^ anAction button - icon: BrGlamorousVectorIcons refresh; - tooltip: 'Reload and cache all timezones'; - priority: 10; - action: [ self reloadAll ] -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtSpotterCachedTimezonesFor: aSearch [ - - ^ aSearch list - priority: 10; - title: 'Cached timezones'; - items: [ self timezones values - sorted: [ :aTimezone | aTimezone id ] ascending ]; - itemName: [ :aTimezone | aTimezone id ]; - filterBySubstring -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtSpotterTimezoneIdentifiersFor: aSearch [ - - ^ aSearch list - priority: 11; - title: 'Timezone identifiers'; - items: [ self timezoneIdentifiers sorted: #yourself ascending ]; - itemName: [ :id | id ]; - send: [ :id | ZTimezone id: id ]; - filterBySubstring -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtViewCachedTimezonesFor: aView [ - - - ^ aView columnedList - title: 'Cached 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 cached timezones by id'; - id: GtPharoSearchCodeButtonId; - objectActOn: [ :anActOnEvent :anItem :theButton | - | targetTimezone | - targetTimezone := anActOnEvent objectToSend. - (targetTimezone isKindOf: ZTimezone) - ifTrue: [ - | columnedList | - - columnedList := theButton phlow viewContent - allChildrenBreadthFirstDetect: [ :child | - child isKindOf: BrColumnedList ] - ifFound: [ :child | child ]. - columnedList scrollToItem: targetTimezone. - columnedList selectOne: (columnedList items - indexOf: targetTimezone). - - anActOnEvent beActed ] ]; - asElement ] - tooltip: 'Search cached timezones by id' -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtViewCurrentTimezoneIn: composite [ - - - ^ composite columnedList - title: 'Current'; - priority: 11; - items: [ { ('image default' -> self current id) } ]; - column: 'Key' text: #key; - column: 'Value' text: #value; - send: [ self current ]; - actionDropdownButtonLabel: 'Set' - tooltip: 'Set the defult image timezone' - content: [ :aButton :aTab | - BrSimpleList new - items: ZTimezone timezoneIdentifiers sorted; - stencil: [ :aString | - BrLabel new - aptitude: BrGlamorousLabelAptitude new + - BrGlamorousListItemAptitude; - text: aString; - when: BlClickEvent do: [ :anEvent | - ZTimezone current: (ZTimezone id: aString). - self inform: ('image timezone set to {1}' format: { aString }). - aTab viewContentElement phlow update. - anEvent target fireEvent: BrDropdownHideWish new] ] ] -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone >> gtViewDetailsIn: composite [ - - ^ composite columnedList - title: 'Details'; - items: [ {('id' -> self id). - ('now' -> (ZTimestampFormat isoNanoTZ timezone: self; format: ZTimestamp now)). - ('current offset' -> (self offsetForTimestamp: ZTimestamp now)). - ('currently daylight saving' -> (self subzoneForTimestamp: ZTimestamp now) isDaylightSaving). - ('current subzone' -> (self subzoneForTimestamp: ZTimestamp now) description ) } ]; - column: 'Key' text: #key; - column: 'Value' text: #value; - send: #value -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone class >> gtViewTimezoneIdentifiersFor: aView [ - - - ^ aView columnedList - title: 'Timezone identifiers'; - priority: 9; - items: [ self timezoneIdentifiers sorted: #yourself ascending ]; - column: 'Id' text: [ :id | id ]; - send: [ :id | ZTimezone id: id ]; - actionStencil: [ :aButton | - GtSpotterDropdownButtonStencil new - object: self; - tooltip: 'Search timezone identifiers'; - id: GtPharoSearchCodeButtonId; - objectActOn: [ :anActOnEvent :anItem :theButton | - | targetTimezone | - targetTimezone := anActOnEvent objectToSend. - (targetTimezone isKindOf: ZTimezone) - ifTrue: [ - | columnedList | - - columnedList := theButton phlow viewContent - allChildrenBreadthFirstDetect: [ :child | - child isKindOf: BrColumnedList ] - ifFound: [ :child | child ]. - columnedList scrollToItem: targetTimezone id. - columnedList selectOne: (columnedList items - indexOf: targetTimezone id) ]. - anActOnEvent beActed ]; - asElement ] - tooltip: 'Search timezone identifiers' -] - -{ #category : #'*ZTimestamp-GT' } -ZTimezone >> gtViewTransitionsIn: composite [ - - ^ composite columnedList - title: 'Transitions'; - items: [ self resolvedTransitions ]; - column: 'Start absolute' - text: [ :association | association key ]; - column: 'Start local' - text: [ :association | - ((ZTimestampFormat fromString: '2001-02-03 T 16:05:06+00:00') timezone: self; format: association key - 1 second) , - ' > ' , - ((ZTimestampFormat fromString: '16:05:06+00:00') timezone: self; format: association key) ]; - column: ('Start ' , ZCurrentTimezone value id) - text: [ :association | ZTimestampFormat isoTZ useCurrentTimezone; format: association key ]; - column: 'Subzone' text: [ :association | association value description ] -]