-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor SCMView class to fit idioms and stuileguide
- Loading branch information
Belana Zwadsich
committed
Jun 26, 2022
1 parent
483132b
commit 74ecfc1
Showing
22 changed files
with
70 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
initialization | ||
createWith: aSCMCalendarManager | ||
|
||
^ self new | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
as yet unclassified | ||
defaults | ||
defaultView | ||
|
||
^ #agenda |
4 changes: 4 additions & 0 deletions
4
packages/SCM-Core.package/SCMView.class/instance/agendaDaysPerPage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defaults | ||
agendaDaysPerPage | ||
|
||
^ 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
actions | ||
loading | ||
clear | ||
|
||
self submorphs copy | ||
|
4 changes: 2 additions & 2 deletions
4
packages/SCM-Core.package/SCMView.class/instance/configureLayout.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/SCM-Core.package/SCMView.class/instance/defaultBorderWidth.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defaults | ||
defaultBorderWidth | ||
|
||
^ 0 |
2 changes: 1 addition & 1 deletion
2
packages/SCM-Core.package/SCMView.class/instance/getNextWrapped.withLimit..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
actions | ||
accessing | ||
getNextWrapped: anIndex withLimit: anInteger | ||
|
||
^ (anIndex \\\ anInteger) + 1 |
6 changes: 3 additions & 3 deletions
6
packages/SCM-Core.package/SCMView.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
actions | ||
initialization | ||
initialize | ||
|
||
super initialize. | ||
self | ||
configureLayout | ||
startDate: DateAndTime today asDate "better than 'Date today' because it sets the right time zone!" | ||
configureLayout; | ||
startDate: self today |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
actions | ||
loading | ||
load: aSCMViewType | ||
|
||
self currentView: aSCMViewType. | ||
|
4 changes: 2 additions & 2 deletions
4
packages/SCM-Core.package/SCMView.class/instance/loadAgendaView.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
actions | ||
loading | ||
loadAgendaView | ||
|
||
self addMorph: ((self viewTypes at: #agenda) | ||
createWithEvents: (self calendarManager activeEventsAfter: self startDate maxEvents: self defaultMaxEvents) | ||
createWithEvents: self retrieveAgendaEvents | ||
andStartDate: self startDate) |
4 changes: 2 additions & 2 deletions
4
packages/SCM-Core.package/SCMView.class/instance/loadNextView.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
actions | ||
loading | ||
loadNextView | ||
|
||
| viewTypesKeys index | | ||
|
||
viewTypesKeys := self viewTypes keysInOrder. | ||
index := viewTypesKeys indexOf: self currentView. | ||
self load: (viewTypesKeys | ||
at: (self getNextWrapped: index withLimit: viewTypesKeys size)) | ||
at: (self getNextWrapped: index withLimit: viewTypesKeys size)) |
6 changes: 3 additions & 3 deletions
6
packages/SCM-Core.package/SCMView.class/instance/loadWeekView.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
actions | ||
loading | ||
loadWeekView | ||
|
||
self addMorph: ((self viewTypes at: #week) | ||
createWithEvents: (self calendarManager activeEventsInWeek) | ||
andStartDate: self startDate asWeek asDate next) | ||
createWithEvents: self retrieveWeekEvents | ||
andStartDate: self monday) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
monday | ||
|
||
^ self startDate asWeek asDate next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
actions | ||
loading | ||
reload | ||
|
||
self clear. | ||
|
4 changes: 4 additions & 0 deletions
4
packages/SCM-Core.package/SCMView.class/instance/retrieveAgendaEvents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
loading | ||
retrieveAgendaEvents | ||
|
||
^ self calendarManager activeEventsAfter: self startDate maxEvents: self defaultMaxEvents |
4 changes: 4 additions & 0 deletions
4
packages/SCM-Core.package/SCMView.class/instance/retrieveWeekEvents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
loading | ||
retrieveWeekEvents | ||
|
||
^ self calendarManager activeEventsInWeek |
6 changes: 3 additions & 3 deletions
6
packages/SCM-Core.package/SCMView.class/instance/showNextPage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
actions | ||
navigating | ||
showNextPage | ||
|
||
| dayIncrease | | ||
|
||
self currentView = #agenda | ||
ifTrue: [dayIncrease := 1] | ||
ifFalse: [dayIncrease := 7]. | ||
ifTrue: [dayIncrease := self agendaDaysPerPage] | ||
ifFalse: [dayIncrease := self weekDaysPerPage]. | ||
self startDate: (self startDate addDays: dayIncrease). | ||
self reload |
7 changes: 3 additions & 4 deletions
7
packages/SCM-Core.package/SCMView.class/instance/showPreviousPage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
actions | ||
navigating | ||
showPreviousPage | ||
|
||
| dayDecrease | | ||
|
||
self currentView = #agenda | ||
ifTrue: [dayDecrease := 1] | ||
ifFalse: [dayDecrease := 7]. | ||
|
||
ifTrue: [dayDecrease := self agendaDaysPerPage] | ||
ifFalse: [dayDecrease := self weekDaysPerPage]. | ||
self startDate: (self startDate subtractDays: dayDecrease). | ||
self reload |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
actions | ||
navigating | ||
switch | ||
|
||
self clear. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
today | ||
" 'asDate' is necessary for the right time zone" | ||
|
||
^ DateAndTime today asDate |
4 changes: 4 additions & 0 deletions
4
packages/SCM-Core.package/SCMView.class/instance/weekDaysPerPage.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
defaults | ||
weekDaysPerPage | ||
|
||
^ 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters