Skip to content

Commit

Permalink
Merge pull request #163 from jecisc/93-Add-source-code-in-a-tab-in-th…
Browse files Browse the repository at this point in the history
…e-demo

93-Add-source-code-in-a-tab-in-the-demo
  • Loading branch information
jecisc authored Dec 27, 2018
2 parents 0f9663f + 070d8f2 commit 648a681
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 8 deletions.
22 changes: 20 additions & 2 deletions src/Spec-Examples/SpecDemoPage.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Class {
#instVars : [
'tabManager'
],
#category : #'Spec-Examples-Demo-Support'
#category : #'Spec-Examples-Demo'
}

{ #category : #specs }
Expand All @@ -32,6 +32,23 @@ SpecDemoPage class >> priority [
^ 999
]

{ #category : #initialization }
SpecDemoPage >> codeFor: aClass [
^ TonelWriter sourceCodeOf: aClass
]

{ #category : #initialization }
SpecDemoPage >> codeTab [
^ self newTab
label: 'Code';
icon: (self iconNamed: #changeUpdate);
presenter:
(self newCode
text: (self codeFor: self pageClass);
yourself);
yourself
]

{ #category : #initialization }
SpecDemoPage >> commentFor: aClass [

Expand Down Expand Up @@ -71,7 +88,8 @@ SpecDemoPage >> initializeWidgets [
"tabManager whenTabSelected: [ self updateTitle ]."
tabManager
addTab: self exampleTab;
addTab: self commentTab.
addTab: self commentTab;
addTab: self codeTab.
]

{ #category : #initialization }
Expand Down
28 changes: 28 additions & 0 deletions src/Spec-Examples/SpecDemoSpacerPage.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
Description
--------------------
I am a demo on layout spacers
"
Class {
#name : #SpecDemoSpacerPage,
#superclass : #SpecDemoPage,
#category : #'Spec-Examples-Demo-Layouts'
}

{ #category : #specs }
SpecDemoSpacerPage class >> pageName [
^ 'Spacers in layout'
]

{ #category : #specs }
SpecDemoSpacerPage class >> priority [

^ 50
]

{ #category : #initialization }
SpecDemoSpacerPage >> pageClass [

^ SpecSpacerDemo
]
7 changes: 1 addition & 6 deletions src/Spec-Examples/SpecSpacerDemo.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ I am a simple demo to show how to use spacers in Spec layouts.
"
Class {
#name : #SpecSpacerDemo,
#superclass : #SpecDemoPage,
#superclass : #ComposablePresenter,
#instVars : [
'input2',
'input3',
Expand Down Expand Up @@ -57,11 +57,6 @@ SpecSpacerDemo class >> example [
^ self new openWithSpec
]

{ #category : #initialization }
SpecSpacerDemo class >> pageName [
^ 'Spacers in layout'
]

{ #category : #specs }
SpecSpacerDemo class >> title [
^ 'Spacer demo'
Expand Down

0 comments on commit 648a681

Please sign in to comment.