Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the old morphic-based FileList #16084

Open
wants to merge 10 commits into
base: Pharo13
Choose a base branch
from
1 change: 0 additions & 1 deletion src/BaselineOfBasicTools/BaselineOfBasicTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ BaselineOfBasicTools >> baseline: spec [

spec package: 'Tools-CodeNavigation'.
spec package: 'Tool-Diff'.
spec package: 'Tool-FileList'.
spec package: 'Tool-Finder'.
spec package: 'Tool-Finder-UI'.
spec package: 'Tool-ImageCleaner'.
Expand Down
1 change: 0 additions & 1 deletion src/BaselineOfGeneralTests/BaselineOfGeneralTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ BaselineOfGeneralTests >> baseline: spec [
package: 'System-Support-Tests';
package: 'Text-Diff-Tests';
package: 'Tool-ExternalBrowser-Tests';
package: 'Tool-FileList-Tests';
package: 'Tool-Finder-Tests';
package: 'Tool-Profilers-Tests';
package: 'Tool-ImageCleaner-Tests';
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfIDE/BaselineOfIDE.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ BaselineOfIDE >> postload: loader package: packageSpec [
EpMonitor current enable.

Smalltalk tools register: ExternalChangesBrowser as: #changeList.
Smalltalk tools register: FileList as: #fileList.
Smalltalk tools register: StFileSystemPresenter as: #fileList.
Smalltalk tools register: Finder as: #finder.
Smalltalk tools register: ProcessBrowser as: #processBrowser.

Expand Down
135 changes: 75 additions & 60 deletions src/Polymorph-Widgets/UITheme.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -754,12 +754,12 @@ UITheme >> chooseColorIn: aThemedMorph title: aString color: aColor for: aBlock
UITheme >> chooseDirectoryIn: aThemedMorph title: title path: path [
"Answer the result of a file dialog with the given title, choosing directories only."

| dialog |
dialog := (FileDialogWindow newWithTheme: aThemedMorph theme)
title: title;
answerDirectory.
path ifNotNil: [ dialog selectPath: path ].
^ dialog openModal answer
^ StOpenDirectoryDialog new
defaultFolder: path;
title: (title ifNil: [ 'Choose Directory' translated ]);
jecisc marked this conversation as resolved.
Show resolved Hide resolved
openModal;
selectedEntry

]

{ #category : 'services' }
Expand All @@ -774,40 +774,58 @@ UITheme >> chooseDropListIn: aThemedMorph text: aStringOrText title: aString lis
]

{ #category : 'services' }
UITheme >> chooseExistingFileReferenceIn: aThemedMorph title: title extensions: exts path: path preview: preview [
"Answer the result of a file name chooser dialog with the given title, extensions
path and preview type.
Answer nil or a filename."

| dialog pathFileReference |
pathFileReference := path asFileReference.
dialog := FileDialogWindow basicNew
basicTheme: aThemedMorph theme;
previewType: preview;
fileNameText: pathFileReference basename;
initialize;
title: title;
answerPathName.
exts ifNotNil: [ dialog validExtensions: exts ].
path ifNotNil: [ dialog selectPath: pathFileReference pathString ].
^ dialog openModal answer ifNotNil: #asFileReference
UITheme >> chooseExistingFileReferenceIn: aThemedMorph title: titleString extensions: extensions path: path preview: preview [
"Answer the result of a file name chooser dialog with the given titleString, extensions, path and preview type.
extensions : <Collection> of <String> each one representing a file extension.
path : <String> or <FileReference>. It can be a directory or a file.
If it is a directory, the dialog will open showing it.
If it is a file, the directory where the file resides will be selected and displayed.
preview : <String> or <nil>. If it's a <String>, try to match with a specific previewer subclass of `StFileBrowserAbstractPreviewer`.

Answer nil or the selected <FileReference>."

| pathFileReference newDialog |

newDialog := StOpenFileDialog new
extensions: (extensions ifNil: [ Array empty ]);
title: (titleString ifNil: [ 'Choose File' ]);
yourself.
(pathFileReference := path asFileReference) isFile
ifTrue: [
newDialog
showDirectory: pathFileReference parent;
selectFile: pathFileReference ]
ifFalse: [
newDialog
showDirectory: pathFileReference ].
^ newDialog
openModal;
selectedEntry.
]

{ #category : 'services' }
UITheme >> chooseFileIn: aThemedMorph title: title extensions: exts path: path preview: preview [
"Answer the result of a file open dialog with the given title, extensions path and preview type.
Answer nil or a filename."

| dialog |
dialog := FileDialogWindow basicNew
basicTheme: aThemedMorph theme;
previewType: preview;
initialize;
title: title;
answerFileEntry.
exts ifNotNil: [ dialog validExtensions: exts ].
path ifNotNil: [ dialog selectPath: path ].
^ dialog openModal answer
UITheme >> chooseFileIn: aThemedMorph title: titleString extensions: extensions path: path preview: preview [
"Answer the result of a file name chooser dialog with the given titleString, extensions, path and preview type.
extensions : <Collection> of <String> each one representing a file extension.
path : <String> or <FileReference>. It can be a directory or a file.
If it is a directory, the dialog will open showing it.
If it is a file, the directory where the file resides will be displayed.
preview : <String> or <nil>. If it's a <String>, try to match with a specific previewer subclass of `StFileBrowserAbstractPreviewer`.

Answer nil or the selected <FileReference>."

| pathFileReference newDialog |

newDialog := StOpenFileDialog new
extensions: (extensions ifNil: [ Array empty ]);
title: (titleString ifNil: [ 'Choose File' ]);
yourself.
(pathFileReference := path asFileReference) isFile
ifTrue: [ newDialog showDirectory: pathFileReference parent ]
ifFalse: [ newDialog showDirectory: pathFileReference ].
^ newDialog
openModal;
selectedEntry.
]

{ #category : 'services' }
Expand All @@ -816,37 +834,34 @@ UITheme >> chooseForSaveFileReferenceIn: aThemedMorph title: title extensions: e
path and preview type.
Answer nil or a filename."

| dialog pathFileReference |
| pathFileReference |

pathFileReference := path asFileReference.
dialog := (FileDialogWindow newWithTheme: aThemedMorph theme)
title: title;
fileNameText: pathFileReference basename;
answerSaveFile.
exts ifNotNil: [ dialog validExtensions: exts ].
path ifNotNil: [ dialog selectPath: path ].
^ dialog openModal answer
^ StSaveFileDialog new
setTitle: title;
showDirectory: path parent;
extensions: exts;
selectFile: pathFileReference basename;
openModal;
selectedEntry
]

{ #category : 'services' }
UITheme >> chooseFullFileNameIn: aThemedMorph title: title patterns: patterns path: path preview: preview [
"Answer the result of a file name chooser dialog with the given title, patterns
path and preview type.
Answer nil or a filename."
path and preview type. Answer nil or a filename."

| dialog |
dialog := FileDialogWindow basicNew
basicTheme: aThemedMorph theme;
previewType: preview;
initialize;
title: title;
answerPathName.
patterns
ifNotNil: [ dialog
fileSelectionBlock: [ :de |
(dialog defaultFileSelectionBlock value: de)
and: [ de isDirectory or: [ patterns anySatisfy: [ :pat | pat match: de name ] ] ] ] ].
path ifNotNil: [ dialog selectPath: path ].
^ dialog openModal answer

dialog := StOpenFileDialog new
previewer: StFileBrowserTextBasedContentPreviewer new;
setTitle: title;
yourself.
path ifNotNil: [ dialog showDirectory: path ].
patterns ifNotNil: [ dialog extensions: patterns ].
^ dialog
openModal;
selectedEntry.
]

{ #category : 'services' }
Expand Down
7 changes: 2 additions & 5 deletions src/System-DependenciesTests/SystemDependenciesTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ SystemDependenciesTest >> knownMorphicCoreDependencies [
SystemDependenciesTest >> knownMorphicDependencies [
"ideally this list should be empty"

^ #( #'Refactoring-Critics' #'Refactoring-Environment'
#'Spec2-Core' #'Tool-FileList' #'Athens-Morphic'
#'Tools-CodeNavigation' 'Debugger-Oups' ) "Rubric has a dependency on It"
^ #(#'Refactoring-Critics' #'Refactoring-Environment' #'Spec2-Core' #'Athens-Morphic' #'Tools-CodeNavigation' 'Debugger-Oups')
]

{ #category : 'known dependencies' }
Expand Down Expand Up @@ -126,8 +124,7 @@ SystemDependenciesTest >> knownUIDependencies [

"ideally this list should be empty"

^ #('AST-Core-Tests' 'Athens-Cairo' 'Athens-Core'
#'Athens-Morphic' #'Refactoring-Critics' #'Refactoring-Environment' 'Reflectivity-Tools' #Shout #'Tool-Diff' #'Tool-FileList' #'HeuristicCompletion-Model' 'NECompletion-Morphic' #VariablesLibrary #'Tools-CodeNavigation' #'Spec2-CommonWidgets')
^ #('AST-Core-Tests' 'Athens-Cairo' 'Athens-Core' 'Athens-Morphic' 'Refactoring-Critics' 'Refactoring-Environment' 'Reflectivity-Tools' 'Shout' 'Tool-Diff' 'HeuristicCompletion-Model' 'NECompletion-Morphic' 'VariablesLibrary' 'Tools-CodeNavigation' 'Spec2-CommonWidgets')
]

{ #category : 'accessing' }
Expand Down
6 changes: 3 additions & 3 deletions src/Tool-Registry/PharoCommonTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ PharoCommonTools class >> settingsOn: aBuilder [
(aBuilder pickOne: #fileListTool)
target: Smalltalk;
targetSelector: #tools;
label: 'Filelist';
default: (self environment at: #FileList);
domainValues: Smalltalk tools recentFileListTools]
label: 'FileBrowser';
default: (self environment at: #StFileSystemPresenter);
domainValues: Smalltalk tools recentFileListTools ]
]

{ #category : 'system startup' }
Expand Down