-
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
34 changed files
with
152 additions
and
29 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/RichTextEditing-Core.package/RichTextDocument.class/instance/^equals.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,7 @@ | ||
comparing | ||
= aRichTextDocument | ||
|
||
^ (self textStructures = aRichTextDocument textStructures) | ||
and: [self text = aRichTextDocument text] | ||
and: [self name = aRichTextDocument name] | ||
and: [self timeLastSaved = aRichTextDocument timeLastSaved] |
2 changes: 1 addition & 1 deletion
2
packages/RichTextEditing-Core.package/RichTextDocument.class/instance/openInEditor.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 @@ | ||
initialize-release | ||
openInEditor | ||
|
||
^ self class editorClass openWith: self | ||
^ self class editorClass open: self |
1 change: 1 addition & 0 deletions
1
packages/RichTextEditing-Core.package/RichTextDocument.class/instance/timeLastSaved.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,5 @@ | ||
accessing | ||
timeLastSaved | ||
|
||
self timestampLastSaved ifNil: [^ nil]. | ||
^ self timestampLastSaved second |
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
packages/RichTextEditing-Core.package/RichTextEditorModel.class/class/open..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 @@ | ||
instance creation | ||
open: aRichTextDocument | ||
|
||
| instance | | ||
instance := self new. | ||
ToolBuilder default open: instance. | ||
instance setDocument: aRichTextDocument. | ||
|
||
^ instance |
10 changes: 5 additions & 5 deletions
10
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/importFileFrom..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 @@ | ||
import-export | ||
importFileFrom: filePath | ||
importFileFrom: aFilePath | ||
|
||
| filestream text document | | ||
filestream := StandardFileStream readOnlyFileNamed: filePath. | ||
text := Text fromString: filestream contents. | ||
| fileStream text document | | ||
fileStream := StandardFileStream readOnlyFileNamed: aFilePath. | ||
text := Text fromString: fileStream contents. | ||
document := self documentClass fromText: text withStructures: (self documentClass initialTextStructures). | ||
self setDocument: document. | ||
filestream close | ||
fileStream close | ||
|
7 changes: 7 additions & 0 deletions
7
.../RichTextEditing-Core.package/RichTextEditorModel.class/instance/importObjectFileFrom..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,7 @@ | ||
import-export | ||
importObjectFileFrom: aFilePath | ||
|
||
| stream | | ||
stream := ReferenceStream fileNamed: aFilePath. | ||
self setDocument: stream next. | ||
stream close |
6 changes: 6 additions & 0 deletions
6
...TextEditing-Core.package/RichTextEditorModel.class/instance/importObjectFileWithDialog.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 @@ | ||
import-export | ||
importObjectFileWithDialog | ||
|
||
| filePath | | ||
filePath := self selectFilePath. | ||
filePath ifNotNil: [self importObjectFileFrom: filePath] |
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
2 changes: 1 addition & 1 deletion
2
...es/RichTextEditing-Core.package/RichTextEditorModel.class/instance/openStructureEditor.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 @@ | ||
initialize-release | ||
openStructureEditor | ||
|
||
RichTextStructureEditor openWith: self bufferDocument | ||
RichTextStructureEditor open: self bufferDocument |
2 changes: 1 addition & 1 deletion
2
...ges/RichTextEditing-Core.package/RichTextEditorModel.class/instance/openTemplateChoser.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 @@ | ||
text structure | ||
openTemplateChoser | ||
|
||
RichTextStructureEditor openWith: self bufferDocument | ||
RichTextStructureEditor open: self bufferDocument |
4 changes: 2 additions & 2 deletions
4
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/update..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
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
1 change: 1 addition & 0 deletions
1
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.class/README.md
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 @@ | ||
I am a RichTextObjectExportStrategy and I export a document to a file by serializing it using a ReferenceStream. |
6 changes: 6 additions & 0 deletions
6
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.class/class/export.to..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 @@ | ||
export | ||
export: aRichTextDocument to: aFilePath | ||
|
||
(ReferenceStream fileNamed: aFilePath) | ||
nextPut: aRichTextDocument; | ||
close |
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.class/class/fileEnding.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 @@ | ||
export | ||
fileEnding | ||
|
||
^ '.obj' |
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.class/class/label.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 @@ | ||
export | ||
label | ||
|
||
^ #Object |
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.class/class/template.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 @@ | ||
export | ||
template | ||
|
||
self shouldBeImplemented |
8 changes: 8 additions & 0 deletions
8
...ges/RichTextEditing-Core.package/RichTextObjectExportStrategy.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,8 @@ | ||
{ | ||
"class" : { | ||
"export:to:" : "kh 7/27/2020 12:38", | ||
"fileEnding" : "kh 7/27/2020 12:15", | ||
"label" : "kh 7/27/2020 12:15", | ||
"template" : "kh 7/27/2020 12:15" }, | ||
"instance" : { | ||
} } |
14 changes: 14 additions & 0 deletions
14
packages/RichTextEditing-Core.package/RichTextObjectExportStrategy.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-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "kh 8/7/2020 09:08", | ||
"instvars" : [ | ||
], | ||
"name" : "RichTextObjectExportStrategy", | ||
"pools" : [ | ||
], | ||
"super" : "RichTextExportStrategy", | ||
"type" : "normal" } |
9 changes: 9 additions & 0 deletions
9
packages/RichTextEditing-Core.package/RichTextStructureEditor.class/class/open..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 @@ | ||
instance creation | ||
open: aRichTextDocument | ||
|
||
| instance | | ||
instance := self basicNew document: aRichTextDocument. | ||
instance initialize. | ||
aRichTextDocument textStructuresDo: [:each | each addDependent: instance]. | ||
|
||
^ ToolBuilder default open: instance |
1 change: 1 addition & 0 deletions
1
packages/RichTextEditing-Core.package/RichTextStructureEditor.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
11 changes: 11 additions & 0 deletions
11
...xtEditing-Tests.package/RichTextEditorImportExportTests.class/instance/exampleDocument.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,11 @@ | ||
resources | ||
exampleDocument | ||
|
||
| document | | ||
document := RichTextDocument new. | ||
document text: self exampleExportContent asText. | ||
document addAttribute: document textStructures first | ||
from: 1 | ||
to: self exampleExportContent size. | ||
|
||
^ document |
5 changes: 5 additions & 0 deletions
5
...ting-Tests.package/RichTextEditorImportExportTests.class/instance/exportVariantExists..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 | ||
exportVariantExists: aRichTextExportStrategyClass | ||
|
||
^ (self answer: aRichTextExportStrategyClass | ||
inDialog: [self editorModel selectExportStrategy]) notNil |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ resources | |
setUp | ||
|
||
super setUp. | ||
self setupFile | ||
self setupPlainTextFile |
5 changes: 5 additions & 0 deletions
5
...diting-Tests.package/RichTextEditorImportExportTests.class/instance/setupPlainTextFile.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 @@ | ||
resources | ||
setupPlainTextFile | ||
|
||
self createTestFileWithContent: self exampleContent at: self exampleImportFilePath. | ||
self fileDirectory: (FileDirectory forFileName: self exampleExportFilePath) |
4 changes: 4 additions & 0 deletions
4
...e/RichTextEditorImportExportTests.class/instance/testUS143ExportAsObjectExistsInDialog.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 @@ | ||
acceptance-tests | ||
testUS143ExportAsObjectExistsInDialog | ||
|
||
self assert: (self exportVariantExists: RichTextObjectExportStrategy) |
7 changes: 7 additions & 0 deletions
7
...ackage/RichTextEditorImportExportTests.class/instance/testUS143ExportImportObjectEqual.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,7 @@ | ||
acceptance-tests | ||
testUS143ExportImportObjectEqual | ||
|
||
self editorModel setDocument: self exampleDocument. | ||
self chooseExportStrategy: RichTextObjectExportStrategy. | ||
self answer: self exampleExportFilePath inDialog: [self editorModel importObjectFileWithDialog]. | ||
self assert: self exampleDocument equals: self document |
2 changes: 1 addition & 1 deletion
2
...tance/testUS84importFileFromFilesystem.st → ...tance/testUS84ImportFileFromFilesystem.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,5 +1,5 @@ | ||
acceptance-tests | ||
testUS84importFileFromFilesystem | ||
testUS84ImportFileFromFilesystem | ||
|
||
self answer: self exampleImportFilePath inDialog: [self editorModel importFileWithDialog]. | ||
self assert: (self exampleContent) equals: (self editorModel bufferDocument text string) |
2 changes: 1 addition & 1 deletion
2
...RichTextEditorImportExportTests.class/instance/testUS87ExportAsPlainTextExistsInDialog.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 @@ | ||
acceptance-tests | ||
testUS87ExportAsPlainTextExistsInDialog | ||
|
||
self assert: (self exportOptionExists: RichTextPlainTextExportStrategy) | ||
self assert: (self exportVariantExists: RichTextPlainTextExportStrategy) |
2 changes: 1 addition & 1 deletion
2
.../RichTextEditorImportExportTests.class/instance/testUS88ExportAsMarkdownExistsInDialog.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 @@ | ||
acceptance-tests | ||
testUS88ExportAsMarkdownExistsInDialog | ||
|
||
self assert: (self exportOptionExists: RichTextMarkdownExportStrategy) | ||
self assert: (self exportVariantExists: RichTextMarkdownExportStrategy) |
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
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