Skip to content

Commit

Permalink
ZTimestamp>>#gtPreviewFor: added using new parts+legends elements
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvc committed Mar 27, 2024
1 parent 2898cff commit d14916e
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/GToolkit4ZTimestamp/ZTimestamp.extension.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,77 @@
Extension { #name : #ZTimestamp }

{ #category : #'*GToolkit4ZTimestamp' }
ZTimestamp >> gtPreviewFor: aView [
<gtView>
^ aView explicit
title: 'Preview';
priority: 1;
stencil: [ | container |
container := BlElement new
layout: BlLinearLayout horizontal;
padding: (BlInsets all: 5);
constraintsDo: [ :c |
c horizontal fitContent.
c vertical fitContent ].
container addChild: (self
newLabel: (self year printStringPadded: 4)
withLegend: 'year'
primary: true).
container addChild: (self
newLabel: '-'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self monthIndex printStringPadded: 2)
withLegend: 'month'
primary: true).
container addChild: (self
newLabel: '-'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self dayOfMonth printStringPadded: 2)
withLegend: 'day'
primary: true).
container addChild: (self
newLabel: 'T'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self hours printStringPadded: 2)
withLegend: 'hours'
primary: true).
container addChild: (self
newLabel: ':'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self minutes printStringPadded: 2)
withLegend: 'minutes'
primary: true).
container addChild: (self
newLabel: ':'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self seconds printStringPadded: 2)
withLegend: 'seconds'
primary: true).
container addChild: (self
newLabel: '.'
withLegend: nil
primary: false).
container addChild: (self
newLabel: (self formatNanoseconds: self nanoSecond)
withLegend: 'nanoseconds'
primary: false).
container addChild: (self
newLabel: 'Z'
withLegend: nil
primary: false).
container ]
]

{ #category : #'*GToolkit4ZTimestamp' }
ZTimestamp >> gtViewDetailsIn: composite [
<gtView>
Expand Down

0 comments on commit d14916e

Please sign in to comment.