-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renames package. Scopes creation with names is working
- Loading branch information
Showing
17 changed files
with
862 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Extension { #name : 'RPackage' } | ||
|
||
{ #category : '*NewTools-Scopes-Browser' } | ||
RPackage >> scopesIconName [ | ||
^ #package | ||
] |
26 changes: 26 additions & 0 deletions
26
src/NewTools-Scopes-Browser/ScopeAbstractPresenter.class.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,26 @@ | ||
Class { | ||
#name : 'ScopeAbstractPresenter', | ||
#superclass : 'SpPresenter', | ||
#instVars : [ | ||
'model' | ||
], | ||
#category : 'NewTools-Scopes-Browser-GUI', | ||
#package : 'NewTools-Scopes-Browser', | ||
#tag : 'GUI' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
ScopeAbstractPresenter >> announcer [ | ||
^ model announcer | ||
] | ||
|
||
{ #category : 'private - presenters' } | ||
ScopeAbstractPresenter >> newScopeTree [ | ||
^ self instantiate: ScopeTreePresenter | ||
] | ||
|
||
{ #category : 'accessing - model' } | ||
ScopeAbstractPresenter >> setModelBeforeInitialization: aDomainObject [ | ||
|
||
model := aDomainObject | ||
] |
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,23 @@ | ||
Class { | ||
#name : 'ScopeClassNode', | ||
#superclass : 'ScopeNode', | ||
#category : 'NewTools-Scopes-Browser-Nodes', | ||
#package : 'NewTools-Scopes-Browser', | ||
#tag : 'Nodes' | ||
} | ||
|
||
{ #category : 'accessing' } | ||
ScopeClassNode >> children [ | ||
|
||
^ #( ) | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeClassNode >> isClassOrTraitNode [ | ||
^ true | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeClassNode >> scopesIconName [ | ||
^ #class | ||
] |
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,71 @@ | ||
Class { | ||
#name : 'ScopeNamePresenter', | ||
#superclass : 'ScopeAbstractPresenter', | ||
#instVars : [ | ||
'textInput' | ||
], | ||
#category : 'NewTools-Scopes-Browser-GUI', | ||
#package : 'NewTools-Scopes-Browser', | ||
#tag : 'GUI' | ||
} | ||
|
||
{ #category : 'layout' } | ||
ScopeNamePresenter class >> defaultLayout [ | ||
|
||
^ SpBoxLayout newTopToBottom | ||
add: (SpBoxLayout newLeftToRight | ||
add: 'Nombre'; | ||
add: #textInput | ||
expand: true | ||
fill: true | ||
padding: 0; | ||
yourself) | ||
expand: false | ||
] | ||
|
||
{ #category : 'layout' } | ||
ScopeNamePresenter class >> title [ | ||
^ 'Scope name?' | ||
] | ||
|
||
{ #category : 'announcements' } | ||
ScopeNamePresenter >> announceNewScope [ | ||
|
||
self announcer announce: (NewScopeAnnouncement new) | ||
] | ||
|
||
{ #category : 'initialize-release' } | ||
ScopeNamePresenter >> close [ | ||
self window close | ||
] | ||
|
||
{ #category : 'initialization' } | ||
ScopeNamePresenter >> initializePresenters [ | ||
|
||
textInput := self newTextInput. | ||
self initializeTextInput | ||
] | ||
|
||
{ #category : 'initialization' } | ||
ScopeNamePresenter >> initializeTextInput [ | ||
textInput | ||
placeholder: 'Enter the name of the scope'; | ||
autoAccept: false; | ||
whenSubmitDo: [ :text | | ||
self validate. | ||
model newScope label: text. | ||
self announceNewScope. | ||
self close ] | ||
] | ||
|
||
{ #category : 'initialization' } | ||
ScopeNamePresenter >> validate [ | ||
|
||
self assert: textInput text isNotEmpty | ||
] | ||
|
||
{ #category : 'enumerating' } | ||
ScopeNamePresenter >> whenSubmitDo: aBlock [ | ||
|
||
textInput whenSubmitDo: aBlock | ||
] |
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,101 @@ | ||
" | ||
I am wrapper for classes, packages and class hierarchies to be used in the ScopeNodesTree | ||
" | ||
Class { | ||
#name : 'ScopeNode', | ||
#superclass : 'Object', | ||
#instVars : [ | ||
'value', | ||
'packages' | ||
], | ||
#category : 'NewTools-Scopes-Browser-Nodes', | ||
#package : 'NewTools-Scopes-Browser', | ||
#tag : 'Nodes' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
ScopeNode class >> on: aPackageOrClass [ | ||
|
||
self class == ScopeNode ifTrue: [ | ||
self error: 'I am ab abstract class' ]. | ||
|
||
^ self new | ||
value: aPackageOrClass; | ||
yourself | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> <= aNode [ | ||
^ self label <= aNode label | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> = anotherNode [ | ||
|
||
^ (self class = anotherNode class) | ||
and: [ self label = anotherNode label ] | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> basicEqualsTo: aNode [ | ||
|
||
^ self value = aNode value | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> children [ | ||
self subclassResponsibility | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> definedClasses [ | ||
^#() | ||
] | ||
|
||
{ #category : 'testing' } | ||
ScopeNode >> isClassOrTraitNode [ | ||
^ false | ||
] | ||
|
||
{ #category : 'testing' } | ||
ScopeNode >> isPackageNode [ | ||
^ false | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> label [ | ||
^ self value name | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> name [ | ||
^ value name | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> package [ | ||
^ value package | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> printOn: aStream [ | ||
|
||
aStream | ||
nextPutAll: self class name , '(' , self label; | ||
nextPutAll: ')' | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> scopesIconName [ | ||
self subclassResponsibility | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> value [ | ||
^ value | ||
] | ||
|
||
{ #category : 'accessing' } | ||
ScopeNode >> value: aPackageOrClass [ | ||
value := aPackageOrClass | ||
] |
Oops, something went wrong.