|
| 1 | +Class { |
| 2 | + #name : #GtRemotePhlowDeclarativeDetailsInspectableForExamples, |
| 3 | + #superclass : #Object, |
| 4 | + #category : #'GToolkit-RemotePhlow-Examples' |
| 5 | +} |
| 6 | + |
| 7 | +{ #category : #accessing } |
| 8 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> exampleDate [ |
| 9 | + ^ DateAndTime readFrom: '2021-04-06T14:43:50.123456+02:00' readStream |
| 10 | +] |
| 11 | + |
| 12 | +{ #category : #views } |
| 13 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> gtDetailsCustomPrintViewFor: aView [ |
| 14 | + <gtView> |
| 15 | + |
| 16 | + ^aView details |
| 17 | + title: 'Details (custom print)'; |
| 18 | + priority: 37.1; |
| 19 | + row: 'Class' |
| 20 | + value: [ self class name ] |
| 21 | + text: [ :each | |
| 22 | + | text | |
| 23 | + text := each asString asRopedText. |
| 24 | + text bold. |
| 25 | + text highlight: (GtPhlowColor named: #yellow) asColor. |
| 26 | + text ]; |
| 27 | + row: 'String value' value: [ self string ] text: [ :each | each ]; |
| 28 | + row: 'Text value' value: [ self styledPhlowText ]; |
| 29 | + row: 'Date' |
| 30 | + value: [ self exampleDate ] |
| 31 | + text: [ :each | each printString ] |
| 32 | +] |
| 33 | + |
| 34 | +{ #category : #views } |
| 35 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> gtDetailsViewFor: aView [ |
| 36 | + <gtView> |
| 37 | + |
| 38 | + ^aView details |
| 39 | + title: 'Details (default print)'; |
| 40 | + priority: 37; |
| 41 | + row: 'Class' value: [ self class name ]; |
| 42 | + row: 'String value' value: [ self string ]; |
| 43 | + row: 'Date' value: [ self exampleDate ] |
| 44 | +] |
| 45 | + |
| 46 | +{ #category : #views } |
| 47 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> gtDetailsWithErrorsViewFor: aView [ |
| 48 | + <gtView> |
| 49 | + |
| 50 | + ^aView details |
| 51 | + title: 'Details (with errors)'; |
| 52 | + priority: 37.3; |
| 53 | + row: 'No error' value: [ 'hello world' ] text: [ :each | each ]; |
| 54 | + row: 'Error in value' value: [ 1/0 ]; |
| 55 | + row: 'Error in print' value: [ 1 ] text: [ :each | each / 0]; |
| 56 | + row: 'Also no error' value: [ 'hello world' ] text: [ :each | each ]; |
| 57 | + row: 'Error in both' value: [ 1/0 ] text: [ :each | 1 / 0] |
| 58 | +] |
| 59 | + |
| 60 | +{ #category : #accessing } |
| 61 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> string [ |
| 62 | + ^ 'hello world' |
| 63 | +] |
| 64 | + |
| 65 | +{ #category : #accessing } |
| 66 | +GtRemotePhlowDeclarativeDetailsInspectableForExamples >> styledPhlowText [ |
| 67 | + | text | |
| 68 | + text := GtPhlowText forString: 'Now is the time'. |
| 69 | + text glamorousCodeFont. |
| 70 | + (text from: 12 to: 15) fontSize: 20. |
| 71 | + (text from: 5 to: 6) highlight: (GtPhlowColor named: #yellow) . |
| 72 | + (text from: 1 to: 4) bold. |
| 73 | + (text from: 8 to: 10) foreground: (GtPhlowColor named: #red) . |
| 74 | + (text from: 12 to: 12) glamorousRegularFont. |
| 75 | + (text from: 1 to: 6) italic. |
| 76 | + (text from: 8 to: 15) thin. |
| 77 | + ^ text |
| 78 | +] |
0 commit comments