Skip to content

Commit

Permalink
Revert "Revert "Us84""
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkrypt0 committed Jun 15, 2020
1 parent 29426e3 commit 418a1b8
Show file tree
Hide file tree
Showing 24 changed files with 126 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildLoadButtonWith: aBuilder

^ aBuilder pluggableButtonSpec new
model: self;
frame: (0.25 @ 0 corner: 0.375 @ 0.1);
frame: (0.25 @ 0 corner: 0.375 @ 0.05);
label: 'Load';
action: #loadDocumentFromSaver;
yourself
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildStructureListWith: aBuilder
^ aBuilder pluggableMultiSelectionListSpec new
name: 'structureList';
model: self;
frame: (0 @ 0.1 corner: 0.3 @ 0.9);
frame: (0 @ 0.1 corner: 0.3 @ 0.8);
list: #textStructureSymbols;
getSelectionList: #getStructureSelectionAt:;
setSelectionList: #structureSelectionAt:put:;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ buildWith: aBuilder
self buildSaveAsButtonWith: aBuilder.
self buildSaveButtonWith: aBuilder.
self buildLoadButtonWith: aBuilder.
self buildLoadFileButtonWith: aBuilder.
self buildUndoButtonWith: aBuilder.
self buildRedoButtonWith: aBuilder.
self buildStructureListWith: aBuilder.
Expand Down
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

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]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
saving and loading
selectFilePath

^ UIManager default
chooseFileMatching: nil
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
"buildHelpButtonWith:" : "kh 6/1/2020 14:21",
"buildInfoButtonWith:" : "kh 6/1/2020 14:21",
"buildInspectDocumentButtonWith:" : "ls 6/26/2019 18:57",
"buildLoadButtonWith:" : "ls 6/26/2019 21:13",
"buildLoadButtonWith:" : "frc 6/4/2020 18:11",
"buildLoadFileButtonWith:" : "frc 6/8/2020 14:24",
"buildManageStructuresButtonWith:" : "frc 5/25/2020 14:54",
"buildNewButtonWith:" : "lh 7/24/2019 20:03",
"buildRedoButtonWith:" : "MB 5/22/2019 21:04",
"buildSaveAsButtonWith:" : "ls 6/26/2019 19:02",
"buildSaveButtonWith:" : "ls 6/26/2019 18:54",
"buildStructureListWith:" : "OS 6/3/2020 23:50",
"buildStructureListWith:" : "frc 6/4/2020 18:42",
"buildTextFieldWith:" : "tok 5/31/2020 20:20",
"buildUndoButtonWith:" : "MB 5/22/2019 21:03",
"buildWith:" : "kh 5/25/2020 16:36",
"buildWith:" : "frc 6/4/2020 18:11",
"chosenDocument" : "AG 7/25/2019 13:13",
"createNewStructure:" : "ls 7/24/2019 15:11",
"currentSaveName" : "ls 6/26/2019 17:58",
Expand Down Expand Up @@ -59,6 +60,8 @@
"label" : "ls 5/11/2019 12:23",
"label:" : "ls 6/26/2019 17:46",
"loadDocumentFromSaver" : "lh 7/24/2019 18:11",
"loadFileFrom:" : "frc 6/12/2020 16:53",
"loadFileWithDialog" : "tok 6/15/2020 12:33",
"noUnacceptedEdits" : "ls 7/24/2019 21:08",
"okToChange" : "ls 6/12/2019 22:15",
"openNewEditor" : "ls 6/12/2019 18:10",
Expand All @@ -75,6 +78,7 @@
"saveText:" : "ls 6/26/2019 18:33",
"saver" : "ls 6/26/2019 21:15",
"saves" : "ls 6/26/2019 21:15",
"selectFilePath" : "frc 6/4/2020 18:26",
"selectInvisibly" : "lh 7/24/2019 18:02",
"selectedStructures" : "MB 6/19/2019 17:36",
"selectedStructures:" : "AG 7/25/2019 11:18",
Expand Down
Empty file.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
utilities
exampleFilePath

^ 'test_file.txt'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
utilities
file: aFile

file := aFile


Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
utilities
file

^ file


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! ÄÖÜ'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
utilities
setUp

super setUp.
self setupFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
utilities
setupFile

self createTestFileWithContent: self fileContent at: self exampleFilePath
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
utilities
tearDown

super tearDown.
self tearDownFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
utilities
tearDownFile

FileDirectory deleteFilePath: self file fullName
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)
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" } }
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" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tests
testUS84LoadFileButtonExists

self assert: (self buttonWithLabelExists: 'Load File')
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@
"testUS63InfoButtonExists" : "6/1/2020 14:03:20",
"testUS67HelpBrowserIsOpended" : "kh 5/25/2020 22:44",
"testUS67HelpButtonExists" : "kh 5/25/2020 22:35",
"testUS84LoadFileButtonExists" : "frc 6/11/2020 20:56",
"text" : "MB 7/25/2019 11:02" } }
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"testUS23TriangleIsStillVisibleWhenSaveDialogIsCancelled" : "AG 6/21/2019 14:16",
"testUS23TriangleReappearsWhenEditing" : "AG 6/21/2019 14:33",
"testUS23WhenTriangleIsVisibleCtrlSCanBePressedForSaveDialog" : "lh 7/24/2019 16:19",
"testUS36StructureIsNotExtendable" : "lh 6/5/2019 22:03",
"testUS36StructureIsExtendable" : "frc 6/4/2020 18:21",
"testUS49ApplySelectedStructureWithoutASelectionToNextTextBeginning" : "MB 7/25/2019 10:33",
"testUS49ApplySelectedStructureWithoutASelectionToNextTextEnd" : "MB 7/25/2019 10:33",
"testUS49ApplySelectedStructureWithoutASelectionToNextTextMiddle" : "MB 7/25/2019 10:33",
Expand Down

0 comments on commit 418a1b8

Please sign in to comment.