-
Notifications
You must be signed in to change notification settings - Fork 9
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
1 parent
aafa5a0
commit eb0c530
Showing
7 changed files
with
127 additions
and
26 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
repository/OpenPonk-Core/StDirectoryTreePresenter.extension.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,38 @@ | ||
Extension { #name : 'StDirectoryTreePresenter' } | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StDirectoryTreePresenter >> expandPath: aFileLocator [ | ||
"Expand the receiver's tree to aFileLocator reference" | ||
|
||
| path aPathForSpec currentNode | | ||
self flag: 'Remove (replace by NewTools version) in Pharo 13'. | ||
path := aFileLocator absolutePath segments asOrderedCollection. | ||
aPathForSpec := OrderedCollection with: 1. | ||
|
||
currentNode := directoryTreePresenter roots anyOne. | ||
Smalltalk os isWindows ifTrue: [ | ||
currentNode := currentNode asFileReference parent. | ||
aPathForSpec := OrderedCollection new ]. | ||
|
||
path do: [ :aPart | | ||
| subdirs | | ||
subdirs := currentNode directories sorted: [ :a :b | | ||
a basename caseInsensitiveLessOrEqual: b basename ]. | ||
currentNode := nil. | ||
subdirs doWithIndex: [ :subdir :index | | ||
(currentNode isNil and: [ subdir basename = aPart ]) ifTrue: [ | ||
currentNode := subdir. | ||
aPathForSpec add: index ] ]. | ||
currentNode ifNil: [ ^ self ] ]. | ||
|
||
directoryTreePresenter | ||
selectPath: aPathForSpec | ||
scrollToSelection: true. | ||
|
||
"The Morphic `configureScrolling` is executed **AFTER** the desired scroll was configured from the `StDirectoryTreePresenter`. Furthermore, the `configureScrolling` uses the `desiredVisibleRow` which is always set to 1. This statement updates the desired visible row to the last visible index of whatever the selection is pointing to." | ||
|
||
directoryTreePresenter verticalAlignment lastVisibleRowIndex ifNil: [ | ||
^ self ]. | ||
directoryTreePresenter verticalAlignment desiredVisibleRow: | ||
directoryTreePresenter verticalAlignment lastVisibleRowIndex | ||
] |
40 changes: 40 additions & 0 deletions
40
repository/OpenPonk-Core/StFileBrowserBookmark.extension.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,40 @@ | ||
Extension { #name : 'StFileBrowserBookmark' } | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StFileBrowserBookmark class >> defaultBookmarks [ | ||
|
||
| presets | | ||
self flag: 'Remove (let NewTools to replace it) in Pharo 13'. | ||
presets := { | ||
self home. | ||
self workingDirectory. | ||
self desktop. | ||
self documents. | ||
self downloads }. | ||
|
||
^ OrderedCollection with: (StFileBrowserGroupBookmark | ||
name: 'Bookmarks' | ||
collection: presets | ||
iconName: #book) | ||
] | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StFileBrowserBookmark class >> root [ | ||
|
||
self flag: 'Remove in Pharo 13'. | ||
^ self | ||
name: '/' | ||
location: FileLocator root | ||
icon: (self iconNamed: #smallWindow) | ||
] | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StFileBrowserBookmark class >> windowsDrives [ | ||
|
||
self flag: 'Remove in Pharo 13'. | ||
^ FileLocator root asFileReference directories collect: [ :each | | ||
self | ||
name: each basename | ||
location: each | ||
icon: (self iconNamed: #smallWindow) ] | ||
] |
14 changes: 14 additions & 0 deletions
14
repository/OpenPonk-Core/StFileSystemItemWrapper.extension.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,14 @@ | ||
Extension { #name : 'StFileSystemItemWrapper' } | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StFileSystemItemWrapper class >> roots [ | ||
|
||
self flag: 'Remove (let it be replaced by NewTools version) in Pharo 13'. | ||
^ Smalltalk os isWindows | ||
ifTrue: [ | ||
FileSystem root directories | ||
select: [ :each | each exists and: [ each isReadable ] ] | ||
thenCollect: [ :each | StRootDriveWrapper on: each ] ] | ||
ifFalse: [ | ||
Array with: (StRootDirectoryWrapper on: FileSystem root) ] | ||
] |
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,15 @@ | ||
Extension { #name : 'StPathPresenter' } | ||
|
||
{ #category : '*OpenPonk-Core' } | ||
StPathPresenter >> file: aFile [ | ||
|
||
| parts | | ||
self flag: 'Remove (replace by version in NewTools) in Pharo 13'. | ||
self initializeLayout. | ||
parts := aFile asAbsolute fullPath withParents. | ||
Smalltalk os isWindows ifTrue: [ | ||
parts first isRoot ifTrue: [ parts := parts copyWithoutFirst ] ]. | ||
parts | ||
do: [ :path | self addLinkTo: path ] | ||
separatedBy: [ self addSeparator ] | ||
] |
This file was deleted.
Oops, something went wrong.
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