Skip to content

Commit

Permalink
ZTimezone class side GT extensions by Andrei Chis
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Sep 23, 2023
1 parent 54de99d commit 9f9607f
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions repository/ZTimestamp-GT/ZTimezone.extension.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
Extension { #name : #ZTimezone }

{ #category : #'*ZTimestamp-GT' }
ZTimezone class >> gtActionReloadAllTimezonesFor: anAction [
<gtClassAction>

^ anAction button
icon: BrGlamorousVectorIcons refresh;
tooltip: 'Reload all timezones';
priority: 10;
action: [ self reloadAll ]
]

{ #category : #'*ZTimestamp-GT' }
ZTimezone class >> gtSpotterTimezonesFor: aSearch [
<gtSearch>

^ 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 [
<gtView>
Expand All @@ -13,6 +37,40 @@ ZTimezone >> gtViewDetailsIn: composite [
send: #value
]

{ #category : #'*ZTimestamp-GT' }
ZTimezone class >> gtViewTimezonesFor: aView [
<gtView>
<gtClassView>
^ 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 [
<gtView>
Expand Down

0 comments on commit 9f9607f

Please sign in to comment.