-
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.
- Loading branch information
Showing
24 changed files
with
126 additions
and
6 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
9 changes: 9 additions & 0 deletions
9
...chTextEditing-Core.package/RichTextEditorModel.class/instance/buildLoadFileButtonWith..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,9 @@ | ||
toolbuilder | ||
buildLoadFileButtonWith: aBuilder | ||
|
||
^ aBuilder pluggableButtonSpec new | ||
model: self; | ||
frame: (0.25 @ 0.04 corner: 0.375 @ 0.1); | ||
label: 'Load File'; | ||
action: #loadFileWithDialog; | ||
yourself |
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
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
10 changes: 10 additions & 0 deletions
10
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/loadFileFrom..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,10 @@ | ||
saving and loading | ||
loadFileFrom: filePath | ||
|
||
| filestream text document | | ||
filestream := StandardFileStream readOnlyFileNamed: filePath. | ||
text := Text fromString: filestream contents. | ||
document := self documentClass fromText: text withStructures: (self documentClass initialTextStructures). | ||
self setDocument: document. | ||
filestream close | ||
|
6 changes: 6 additions & 0 deletions
6
...ges/RichTextEditing-Core.package/RichTextEditorModel.class/instance/loadFileWithDialog.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,6 @@ | ||
saving and loading | ||
loadFileWithDialog | ||
|
||
| filePath | | ||
filePath := self selectFilePath. | ||
filePath ifNotNil: [self loadFileFrom: filePath] |
5 changes: 5 additions & 0 deletions
5
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/selectFilePath.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,5 @@ | ||
saving and loading | ||
selectFilePath | ||
|
||
^ UIManager default | ||
chooseFileMatching: nil |
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
Empty file.
8 changes: 8 additions & 0 deletions
8
...ckage/RichTextEditorFileManipulationTests.class/instance/createTestFileWithContent.at..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,8 @@ | ||
utilities | ||
createTestFileWithContent: aString at: filePath | ||
|
||
| new_file | | ||
new_file := StandardFileStream fileNamed: filePath. | ||
new_file nextPutAll: aString. | ||
self file: new_file. | ||
new_file close |
4 changes: 4 additions & 0 deletions
4
...iting-Tests.package/RichTextEditorFileManipulationTests.class/instance/exampleFilePath.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 @@ | ||
utilities | ||
exampleFilePath | ||
|
||
^ 'test_file.txt' |
6 changes: 6 additions & 0 deletions
6
...RichTextEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/file..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,6 @@ | ||
utilities | ||
file: aFile | ||
|
||
file := aFile | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
.../RichTextEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/file.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,6 @@ | ||
utilities | ||
file | ||
|
||
^ file | ||
|
||
|
5 changes: 5 additions & 0 deletions
5
...xtEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/fileContent.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,5 @@ | ||
utilities | ||
fileContent | ||
|
||
^ 'This is the content of the file | ||
This is another line! ÄÖÜ' |
5 changes: 5 additions & 0 deletions
5
...RichTextEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/setUp.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,5 @@ | ||
utilities | ||
setUp | ||
|
||
super setUp. | ||
self setupFile |
4 changes: 4 additions & 0 deletions
4
...TextEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/setupFile.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 @@ | ||
utilities | ||
setupFile | ||
|
||
self createTestFileWithContent: self fileContent at: self exampleFilePath |
5 changes: 5 additions & 0 deletions
5
...hTextEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/tearDown.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,5 @@ | ||
utilities | ||
tearDown | ||
|
||
super tearDown. | ||
self tearDownFile |
4 changes: 4 additions & 0 deletions
4
...tEditing-Tests.package/RichTextEditorFileManipulationTests.class/instance/tearDownFile.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 @@ | ||
utilities | ||
tearDownFile | ||
|
||
FileDirectory deleteFilePath: self file fullName |
5 changes: 5 additions & 0 deletions
5
...kage/RichTextEditorFileManipulationTests.class/instance/testUS84loadFileFromFilesystem.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,5 @@ | ||
acceptance-tests | ||
testUS84loadFileFromFilesystem | ||
|
||
self editorModel loadFileFrom: self exampleFilePath. | ||
self assert: (self fileContent) equals: (self editorModel bufferDocument text string) |
14 changes: 14 additions & 0 deletions
14
...TextEditing-Tests.package/RichTextEditorFileManipulationTests.class/methodProperties.json
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,14 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"createTestFileWithContent:at:" : "frc 6/8/2020 15:03", | ||
"exampleFilePath" : "frc 6/8/2020 14:31", | ||
"file" : "frc 6/8/2020 15:00", | ||
"file:" : "frc 6/8/2020 14:59", | ||
"fileContent" : "frc 6/8/2020 14:50", | ||
"setUp" : "frc 6/12/2020 16:55", | ||
"setupFile" : "frc 6/8/2020 14:31", | ||
"tearDown" : "frc 6/12/2020 16:56", | ||
"tearDownFile" : "frc 6/8/2020 15:04", | ||
"testUS84loadFileFromFilesystem" : "frc 6/12/2020 16:55" } } |
14 changes: 14 additions & 0 deletions
14
...s/RichTextEditing-Tests.package/RichTextEditorFileManipulationTests.class/properties.json
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,14 @@ | ||
{ | ||
"category" : "RichTextEditing-Tests", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"file" ], | ||
"name" : "RichTextEditorFileManipulationTests", | ||
"pools" : [ | ||
], | ||
"super" : "RichTextEditorTestCase", | ||
"type" : "normal" } |
4 changes: 4 additions & 0 deletions
4
...tEditing-Tests.package/RichTextEditorTests.class/instance/testUS84LoadFileButtonExists.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 @@ | ||
tests | ||
testUS84LoadFileButtonExists | ||
|
||
self assert: (self buttonWithLabelExists: 'Load File') |
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
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