From VisualWorks®, 7.5 of April 16, 2007 on August 8, 2007 at 2:52:30 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>STSAllWidgets</name> <environment>Seaside</environment> <super>Seaside.WAFrameComponent</super> <private>false</private> none <imports></imports> <category>Seaside-Examples-Test</category> <attributes> <package>Seaside-WidgetTests</package> </attributes> </class> <class> <name>STSManyWidgets</name> <environment>Seaside</environment> <super>Seaside.WAComponent</super> <private>false</private> none a b c d e f g h <imports></imports> <category>STSTutorial-Library</category> <attributes> <package>Seaside-WidgetTests</package> </attributes> </class> <class> <name>Employee</name> <environment>Seaside</environment> <super>Core.Object</super> <private>false</private> none id firstName lastName <imports></imports> <category>Seaside-Examples-Test</category> <attributes> <package>Seaside-WidgetTests</package> </attributes> </class> <class> <name>STSClassBrowser</name> <environment>Seaside</environment> <super>Seaside.WAComponent</super> <private>false</private> none treeView browser <imports></imports> <category>Seaside-Examples-Test</category> <attributes> <package>Seaside-WidgetTests</package> </attributes> </class> <methods> Seaside.STSAllWidgets <category>initialization</category>
action1 ^ self inform: 'Action 1'.
action2: aString ^ self inform: aString
action3 ^ self inform: 'Action Three'.
actions ^#( action1 action2: action3 )
actionSee | sel component | sel := contents selection. component := contents selectedComponent. sel = 'Mini Calendar' ifTrue: [^self inform: component month]. sel = 'Calendar' ifTrue: [^self inform: component date]. sel = 'Batch' ifTrue: [^self inform: component batch]. sel = 'Date Selection' ifTrue: [^self inform: 'Not applicable']. sel = 'Date Table' ifTrue: [^self inform: 'From ', component startDateSelection printString , ' to ' ,component endDateSelection printString]. sel = 'Nav' ifTrue: [^self inform: 'Not applicable']. sel = 'Path' ifTrue: [^self inform: 'Not applicable']. sel = 'Tree' ifTrue: [^self inform: (component selectedClass isNil ifTrue: ['No class is selected'] ifFalse: ['Current selection: ', component selectedClass printString])]. ^self inform: 'Anomaly - this should not show up'.
addBatchedList self contents add: (WABatchedList new items: #( a b c d e f g h i j k l m n o p); batchSize: 5) label: 'Batch'.
addCalendar #'Seaside.STSCalendar' asQualifiedReference bindingOrNil notNil ifTrue: [self contents add: STSCalendar new label: 'Calendar'].
addClassBrowser | widget | widget := STSClassBrowser new. self contents add: widget label: 'Tree'
addMiniCalendar self contents add: WAMiniCalendar new label: 'Mini Calendar'.
addNavigationBar | widget | widget := WANavigationBar new owner: self; actionsSelector: #actions. self contents add: widget label: 'Nav'.
addPath | widget | widget := WAPath new pushSegment: self name: self printString; pushSegment: contents name: contents printString; pushSegment: contents options name: contents options printString; yourself. self contents add: widget label: 'Path'
addSelectionDateTable | widget | widget := WASelectionDateTable new rows: #('Day name' 'Month name'); startDate: (Date today subtractDays: 5); endDate: (Date today addDays: 5); rowsAndDatesDisplay: [:rowName :date | | cellValue | cellValue := '?'. rowName = 'Day name' ifTrue: [cellValue := date weekday]. rowName = 'Month name' ifTrue: [cellValue := date monthName]. cellValue]; yourself. self contents add: widget label: 'Date Table'.
addTableReport | cols rows widget | cols := OrderedCollection new add: (WAReportColumn selector: #id title: 'Id' onClick: [: v | self inform: 'Employee number is ' , v id , ' (' , v printString, ')']); add: (WAReportColumn selector: #firstName title: 'First name' onClick:[: v | self inform: 'Employee first name is ' , v firstName , ' (' , v printString, ')']); add: (WAReportColumn selector: #lastName title: 'Last name' onClick: [: v | self inform: 'Employee last name is ' , v lastName , ' (' , v printString, ')']); yourself. rows := OrderedCollection new add: (Employee new id: '001'; firstName: 'John'; lastName: 'Dough'); add: (Employee new id: '002'; firstName: 'Harry'; lastName: 'Covert'); add: (Employee new id: '003'; firstName: 'Hans'; lastName: 'Piral'); add: (Employee new id: '004'; firstName: 'Kate'; lastName: 'Himoney'); yourself. widget := WATableReport new columns: cols; rows: rows; rowPeriod: 1; rowColors: #('lightblue' 'lightyellow'). self contents add: widget label: 'Report'.
addWidgets self contents add: STSManyWidgets new label: 'Widgets'.
initialize self contents: WASimpleNavigation new. self addMiniCalendar. self addCalendar. self addBatchedList. self addSelectionDateTable. self addNavigationBar. self addTableReport. self addPath. self addClassBrowser. self addWidgets.
</methods> <methods> Seaside.STSAllWidgets <category>rendering</category>
renderContentOn: html html heading: 'Test Widgets'. html render: contents. (#( nil 'Date Selection' 'Nav' 'Report' 'Path') includes: contents selection) ifFalse: [html break. html anchor callback: [self actionSee]; with: 'See'].
</methods> <methods> Seaside.STSAllWidgets class <category>as yet unclassified</category>
canBeRoot ^ true
initialize self registerAsApplication: 'tests/widgets'
</methods> <methods> Seaside.STSManyWidgets <category>actions</category>
action1 self inform: 'This is action 1'
action2 self inform: 'This is action 2'
</methods> <methods> Seaside.STSManyWidgets <category>initialization</category>
actions ^#( action1 action2 )
children ^Array with: a with: b with: c with: d with: e.
initialize a := WAMiniCalendar new. b := WABatchedList new items: #( a b c d e f g h i j k l m n o p); batchSize: 5. c := WADateSelector new. d := WASelectionDateTable new rows: #('Day name' 'Month name'); startDate: (Date today subtractDays: 5); endDate: (Date today addDays: 5); rowsAndDatesDisplay: [:rowName :date | | cellValue | cellValue := '?'. rowName = 'Day name' ifTrue: [cellValue := date weekday]. rowName = 'Month name' ifTrue: [cellValue := date monthName]. cellValue]. e := WANavigationBar new owner: self; actionsSelector: #actions.
</methods> <methods> Seaside.STSManyWidgets <category>rendering</category>
renderContentOn: html | month items date period | html render: a. html break. html render: b. html break. html render: c. html break. html render: d. html break. html render: e. html break. html anchor callback: [month := a month. items := b batch. date := c date. period := Array with: d startDateSelection with: d endDateSelection. self answer: (Array with: month with: items with: date with: period)]; with: 'Done'.
</methods> <methods> Seaside.STSManyWidgets class <category>testing</category>
canBeRoot ^ true
</methods> <methods> Seaside.Employee <category>accessing</category>
firstName ^firstName
firstName: anObject firstName := anObject
id ^id
id: anObject id := anObject
lastName ^lastName
lastName: anObject lastName := anObject
</methods> <methods> Seaside.Employee <category>printing</category>
printOn: aStream aStream nextPutAll: self id; space; nextPutAll: self firstName; space; nextPutAll: self lastName
</methods> <methods> Seaside.STSClassBrowser <category>accessing</category>
browser ^browser
browser: anObject browser := anObject
</methods> <methods> Seaside.STSClassBrowser <category>initialization</category>
children ^ Array with: treeView with: self browser.
initialize treeView := (WAWebTreeSelectComponent new) backgroundColor: Color lightCyan; rootNodes: (Array with: (WAWebTreeNode for: Object childBlock: [:each | each subclasses])); eventHandler: self; yourself. browser := nil
</methods> <methods> Seaside.STSClassBrowser <category>events</category>
onCollapseNode: aNode
onExpandNode: aNode
onSelectNode: aNode browser isNil ifTrue: [browser := WABrowser fullOnClass: aNode wrappedObject] ifFalse: [browser model selectedClass = aNode wrappedObject ifTrue: [browser := nil] ifFalse: [browser model setClass: aNode wrappedObject selector: nil]]
style ^ ' #Tree-View { height: 650px; width: 250px; overflow: auto; } td { vertical-align: top; } '
</methods> <methods> Seaside.STSClassBrowser <category>accessing-computed</category>
selectedClass ^ self browser isNil ifTrue: [nil] ifFalse: [self browser model selectedClassName]
</methods> <methods> Seaside.STSClassBrowser <category>rendering</category>
renderContentOn: html html table: [html tableRow: [html tableData: [(html div) id: #'Tree-View'; with: treeView]. html tableData: [(html div) id: #Browser; with: browser]]]
</methods> <initialize> Seaside.STSAllWidgets </initialize> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>Object</name> <environment>Core</environment> <super></super> <private>false</private> none <imports></imports> <category>Kernel-Objects</category> <attributes> <package>Kernel-Objects</package> </attributes> </class> <class> <name>WAComponent</name> <environment>Seaside</environment> <super>Seaside.WAPresenter</super> <private>false</private> none decoration <imports></imports> <category>Seaside-Component</category> <attributes> <package>Seaside-Component</package> </attributes> </class> <class> <name>WAFrameComponent</name> <environment>Seaside</environment> <super>Seaside.WAComponent</super> <private>false</private> none contents <imports></imports> <category>Seaside-Components-Frames</category> <attributes> <package>Seaside-Components-Frames</package> </attributes> </class>