-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a view to Browse all component classes in the Molecule menu
- Loading branch information
Showing
3 changed files
with
86 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
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,73 @@ | ||
" | ||
window spec after click on inspect in molActionsMenu | ||
" | ||
Class { | ||
#name : #MolSpBrowseComponentClasses, | ||
#superclass : #SpPresenter, | ||
#instVars : [ | ||
'items', | ||
'table' | ||
], | ||
#category : #'Molecule-IDE-Spec2' | ||
} | ||
|
||
{ #category : #layout } | ||
MolSpBrowseComponentClasses class >> defaultLayout [ | ||
|
||
^ SpBoxLayout newTopToBottom | ||
add: #table | ||
expand: true | ||
fill: true | ||
padding: 10; | ||
yourself | ||
] | ||
|
||
{ #category : #initialization } | ||
MolSpBrowseComponentClasses >> initializePresenters [ | ||
"add table" | ||
table := self newTreeTable. | ||
table addColumn: (SpCompositeTableColumn new | ||
title: 'Double click on a class to browse it...'; | ||
addColumn: ((SpImageTableColumn evaluated: #systemIcon) | ||
width: 20; | ||
yourself); | ||
addColumn: (SpStringTableColumn evaluated: #name); | ||
yourself). | ||
table roots: { MolAbstractComponentImpl . MolComponentImpl }. | ||
table children: [ :e | | users | | ||
e = MolAbstractComponentImpl ifTrue:[ | ||
e subclasses | ||
] ifFalse:[ | ||
users := e users copy asOrderedCollection. | ||
users remove: MolAbstractComponentImpl ifAbsent: [nil]. | ||
users | ||
]. | ||
]. | ||
table beResizable. | ||
table beSingleSelection. | ||
table activateOnDoubleClick. | ||
table whenActivatedDo: [ :selection | selection selectedItem browse ]. | ||
|
||
|
||
] | ||
|
||
{ #category : #initialization } | ||
MolSpBrowseComponentClasses >> initializeWindow: aWindowPresenter [ | ||
|
||
aWindowPresenter | ||
title: 'Browse all Molecule component classes'; | ||
initialExtent: 500 @ 500; | ||
windowIcon: MolIcon moleculeIcon. | ||
] | ||
|
||
{ #category : #accessing } | ||
MolSpBrowseComponentClasses >> items [ | ||
|
||
^ items | ||
] | ||
|
||
{ #category : #accessing } | ||
MolSpBrowseComponentClasses >> items: anObject [ | ||
|
||
items := anObject | ||
] |
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