forked from pharo-spec/NewTools
-
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.
Merge pull request pharo-spec#671 from pharo-spec/dev-2.0
latest changes
- Loading branch information
Showing
6 changed files
with
118 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
" | ||
This is a JobManager to work with the Jobs package. | ||
This manager will listen to the announcer and fire the events as it corresponds, allowing the user to interact with the joblist tool. | ||
" | ||
Class { | ||
#name : 'StPharoJobManager', | ||
#superclass : 'Object', | ||
#category : 'NewTools-Core-Application', | ||
#package : 'NewTools-Core', | ||
#tag : 'Application' | ||
} | ||
|
||
{ #category : 'private' } | ||
StPharoJobManager class >> application [ | ||
|
||
self flag: #TODO. "Not cool, but well... better than extend the StPharoApplication. | ||
At least this side is contained." | ||
^ StPharoApplication current | ||
] | ||
|
||
{ #category : 'accessing' } | ||
StPharoJobManager class >> disable [ | ||
<script> | ||
|
||
Job jobAnnouncer unsubscribe: self | ||
] | ||
|
||
{ #category : 'accessing' } | ||
StPharoJobManager class >> enable [ | ||
<script> | ||
|
||
Job jobAnnouncer | ||
when: JobStart send: #jobStart: to: self; | ||
when: JobChange send: #jobChanged: to: self; | ||
when: JobEnd send: #jobEnd: to: self | ||
] | ||
|
||
{ #category : 'class initialization' } | ||
StPharoJobManager class >> initialize [ | ||
|
||
self enable | ||
] | ||
|
||
{ #category : 'private' } | ||
StPharoJobManager class >> isHeadless [ | ||
|
||
"this is a huge hack to know if we are running with an UI or not. | ||
I need it because this Jobs are created all around the world, and I need | ||
a control point." | ||
^ Smalltalk isInteractiveGraphic not | ||
] | ||
|
||
{ #category : 'private - events' } | ||
StPharoJobManager class >> jobChanged: ann [ | ||
|
||
self isHeadless ifTrue: [ ^ self ]. | ||
self jobList jobChanged: ann | ||
] | ||
|
||
{ #category : 'private - events' } | ||
StPharoJobManager class >> jobEnd: ann [ | ||
|
||
self isHeadless ifTrue: [ ^ self ]. | ||
self jobList jobEnd: ann. | ||
"this is just a cleanup... because jobs may leak!" | ||
self jobList isEmpty | ||
ifTrue: [ self application removeProperty: #jobList ] | ||
] | ||
|
||
{ #category : 'private' } | ||
StPharoJobManager class >> jobList [ | ||
|
||
^ self application jobList | ||
] | ||
|
||
{ #category : 'private - events' } | ||
StPharoJobManager class >> jobStart: ann [ | ||
|
||
self isHeadless ifTrue: [ ^ self ]. | ||
self jobList jobStart: ann | ||
] |
7 changes: 7 additions & 0 deletions
7
src/NewTools-MethodBrowsers/ClyClassReferencesQuery.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,7 @@ | ||
Extension { #name : 'ClyClassReferencesQuery' } | ||
|
||
{ #category : '*NewTools-MethodBrowsers' } | ||
ClyClassReferencesQuery >> queryElement [ | ||
|
||
^ self printVariables | ||
] |
7 changes: 7 additions & 0 deletions
7
src/NewTools-MethodBrowsers/ClyConstantMethodQuery.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,7 @@ | ||
Extension { #name : 'ClyConstantMethodQuery' } | ||
|
||
{ #category : '*NewTools-MethodBrowsers' } | ||
ClyConstantMethodQuery >> queryElement [ | ||
|
||
^ self description | ||
] |
7 changes: 7 additions & 0 deletions
7
src/NewTools-MethodBrowsers/ClyMessageBasedQuery.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,7 @@ | ||
Extension { #name : 'ClyMessageBasedQuery' } | ||
|
||
{ #category : '*NewTools-MethodBrowsers' } | ||
ClyMessageBasedQuery >> queryElement [ | ||
|
||
^ self selectors anyOne | ||
] |
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 @@ | ||
Extension { #name : 'ClyQuery' } | ||
|
||
{ #category : '*NewTools-MethodBrowsers' } | ||
ClyQuery >> queryElement [ | ||
|
||
^ nil | ||
] |