Skip to content

Commit

Permalink
start fixing #70
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Winger authored and Eric Winger committed Aug 31, 2018
1 parent ea74ac6 commit 94f31c7
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
37 changes: 32 additions & 5 deletions sources/JadeiteProjectsBrowserPresenter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,31 @@ editSaveMethod: classService
["there will be no method selected on a compiler error"
self selectMethodsFrom: classService]!

fileOutMethods
| path suggestedFileName |
suggestedFileName := methodListPresenter selections size = 1
ifTrue:
[methodListPresenter selection className , '_' , methodListPresenter selection selector asString]
ifFalse: [methodListPresenter selections first className , '_methods'].
path := FileSaveDialog new
caption: 'File Out Method';
fileTypes: self fileTypes;
defaultExtension: self defaultFileExtension;
value: suggestedFileName;
overwritePrompt;
showModal.
path ifNotNil: [self fileOutMethodsOnPath: path]!

fileOutMethodsOnPath: path
| file services |
methodListPresenter selections size = 1
ifTrue:
[methodListPresenter selection command: #fileout.
services := self issueCommand: (Array with: methodListPresenter selection).
file := FileStream write: path.
[file nextPutAll: services first answer] ensure: [file close]].
self rowanFixMe "multiple methods"!

filterTabChanged
self isClassSelected
ifFalse:
Expand Down Expand Up @@ -555,7 +580,7 @@ methodMenuBreak: aMenu
methodsMenuStrings

false ifTrue: [ "This helps us find senders"
self browseImplementors; browseImplementorsOf; browseSenders; browseSendersOf; browseHierarchyImplementors; browseHierarchySenders; browseMethodsContaining; browseMethodPragmas; removeMethods; runMethodTests; setEnvironment0; setEnvironment1; setEnvironment2; fileOutMethod; gotoMethodPackage.
self browseImplementors; browseImplementorsOf; browseSenders; browseSendersOf; browseHierarchyImplementors; browseHierarchySenders; browseMethodsContaining; browseMethodPragmas; removeMethods; runMethodTests; setEnvironment0; setEnvironment1; setEnvironment2; fileOutMethods; gotoMethodPackage.
].
^#(
'&Methods'
Expand All @@ -570,7 +595,7 @@ methodsMenuStrings
'Browse Methods &Containing ...//browseMethodsContaining'
'Browse &History//browseMethodHistory'
'BrowseMethod &Pragmas ...//browseMethodPragmas'
'&File out method ...//fileOutMethod'
'&File out methods ...//fileOutMethods'
'-'
'&Remove Method(s) ...//removeMethods'
#('&Method Environment' '&0//setEnvironment0' '&1//setEnvironment1' '&2//setEnvironment2')
Expand Down Expand Up @@ -815,7 +840,7 @@ queryCommand: aCommandQuery
[aCommandQuery
isEnabled: (packageListPresenter selections size = 1 and: [ancestorListPresenter hasSelection]).
^true].
(#(#browseMethodHistory #browseImplementors #browseSenders #fileOutMethod) includes: command)
(#(#browseMethodHistory #browseImplementors #browseSenders #gotoMethodPackage) includes: command)
ifTrue:
[aCommandQuery isEnabled: methodListPresenter selections size = 1.
^true].
Expand All @@ -828,9 +853,9 @@ queryCommand: aCommandQuery
[aCommandQuery isEnabled: globalsPresenter selections notEmpty.
^true].
"(#(#'runMethodTests') includes: command) ifTrue: [aCommandQuery isEnabled: (methodListPresenter selections notEmpty and: [methodListPresenter selections first at: 3]). ^true]."
(#(#gotoMethodPackage) includes: command)
(#( #fileOutMethods) includes: command)
ifTrue:
[aCommandQuery isEnabled: self methodListPresenter selectionOrNil notNil.
[aCommandQuery isEnabled: self methodListPresenter selections notEmpty.
^true].
(#(#gotoClassDefinedPackage) includes: command)
ifTrue:
Expand Down Expand Up @@ -1443,6 +1468,8 @@ writeProject
!JadeiteProjectsBrowserPresenter categoriesFor: #editSaveClassComment!menu handlers!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #editSaveMethod!menu handlers!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #editSaveMethod:!menu handlers support!private! !
!JadeiteProjectsBrowserPresenter categoriesFor: #fileOutMethods!menu handlers!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #fileOutMethodsOnPath:!menu handlers support!private! !
!JadeiteProjectsBrowserPresenter categoriesFor: #filterTabChanged!event handlers!public!updating! !
!JadeiteProjectsBrowserPresenter categoriesFor: #findClass!menu handlers!public! !
!JadeiteProjectsBrowserPresenter categoriesFor: #getViews!public! !
Expand Down
1 change: 1 addition & 0 deletions sources/Rowan UI Base.pax
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ package setPrerequisites: (IdentitySet new
add: '..\Core\Object Arts\Dolphin\MVP\Views\Cards\Dolphin Card Containers';
add: '..\Core\Object Arts\Dolphin\MVP\Presenters\Prompters\Dolphin Choice Prompter';
add: '..\Core\Object Arts\Dolphin\MVP\Views\Common Controls\Dolphin Common Controls';
add: '..\Core\Object Arts\Dolphin\MVP\Dialogs\Common\Dolphin Common Dialogs';
add: '..\Core\Object Arts\Dolphin\MVP\Views\Control Bars\Dolphin Control Bars';
add: '..\Core\Object Arts\Dolphin\MVP\Presenters\Difference\Dolphin Differences Presenter';
add: '..\Core\Object Arts\Dolphin\MVP\Presenters\Prompters\Dolphin Key-Value Prompter';
Expand Down

0 comments on commit 94f31c7

Please sign in to comment.