diff --git a/src/Pyramid-Bloc/PyramidTreePlugin.class.st b/src/Pyramid-Bloc/PyramidTreePlugin.class.st index 81fbcdd6..f861a61e 100644 --- a/src/Pyramid-Bloc/PyramidTreePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidTreePlugin.class.st @@ -12,25 +12,17 @@ Class { #category : #'Pyramid-Bloc-plugin-tree-library' } -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin class >> columnNameAndType: aPyramidTreePlugin [ ^ SpCompositeTableColumn new - " sortFunction: PyramidElementIdSortFunction new;" - title: 'Elements'; + title: 'Element'; + addColumn: (SpImageTableColumn evaluated: [ :aBlElement | aBlElement asIcon ]); - addColumn: (SpStringTableColumn new - title: 'Class'; - evaluated: [ :aBlElement | aBlElement class name ]; - yourself); - addColumn: (SpStringTableColumn new - title: 'Identity'; - evaluated: [ :aBlElement | aBlElement identityHash printString ]; - displayColor: [ :aBlElement | Color gray ]; - yourself); - addColumn: (SpStringTableColumn new - title: 'Identifier'; + + addColumn: (SpStringTableColumn new + title: 'Id'; beEditable; onAcceptEdition: [ :aBlElement :newIdString | self @@ -43,14 +35,26 @@ PyramidTreePlugin class >> columnNameAndType: aPyramidTreePlugin [ ifFalse: [ aBlElement id asSymbol ] ]; displayColor: [ :aBlElement | Smalltalk ui theme textColor ]; yourself); + + addColumn: (SpStringTableColumn new + title: 'Class'; + evaluated: [ :aBlElement | aBlElement class name ]; + yourself); + + addColumn: (SpStringTableColumn new + title: 'Hash num'; + evaluated: [ :aBlElement | aBlElement identityHash printString ]; + displayColor: [ :aBlElement | Color gray ]; + yourself); + yourself ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin class >> columnVisibility: aPyramidTreePlugin [ ^ SpCompositeTableColumn new - title: 'Visibility'; + title: ''; "no title" "sortFunction: PyramidVisibilitySortFunction new;" width: 80; addColumn: (SpImageTableColumn evaluated: [ :aBlElement | @@ -73,11 +77,11 @@ PyramidTreePlugin class >> columnVisibility: aPyramidTreePlugin [ yourself ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin class >> columnZIndex: aPyramidTreePlugin [ ^ SpStringTableColumn new - title: 'z'; + title: 'Z'; "sortFunction: PyramidElevationSortFunction new;" evaluated: [ :aBlElement | aBlElement elevation elevation printString ]; @@ -109,8 +113,8 @@ PyramidTreePlugin >> addPanelsOn: aPyramidSimpleWindow [ aPyramidSimpleWindow at: #tabLeft addItem: [ :builder | builder makeTab: self treePresenter - label: 'Tree' - icon: (self iconNamed: #catalog) + label: 'Elements tree' + icon: (self iconNamed: #hierarchy) order: 1 ]. aPyramidSimpleWindow @@ -149,7 +153,8 @@ PyramidTreePlugin >> initialize [ libraryPresenterForRoot: self libraryPresenterForRoot; yourself. - self initializeTreeColumns. + + self initializeTreeColumns ] { #category : #initialization } @@ -176,19 +181,19 @@ PyramidTreePlugin >> initializeTreeColumns [ self treePresenter updateTree ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin >> libraryPresenterForElement [ ^ libraryPresenterForElement ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin >> libraryPresenterForRoot [ ^ libraryPresenterForRoot ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePlugin >> menuAddAndDeleteOn: aBuilder [ aBuilder diff --git a/src/Pyramid-Bloc/PyramidTreePresenter.class.st b/src/Pyramid-Bloc/PyramidTreePresenter.class.st index 0dc85a12..a4db4a49 100644 --- a/src/Pyramid-Bloc/PyramidTreePresenter.class.st +++ b/src/Pyramid-Bloc/PyramidTreePresenter.class.st @@ -15,21 +15,22 @@ Class { #category : #'Pyramid-Bloc-plugin-tree-library' } -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> actionAddNewElement [ -(PyramidPopoverFactory - makeWithPresenter: self libraryPresenterForRoot - relativeTo: self buttonAddToRoots - position: SpPopoverPosition right) popup + + (PyramidPopoverFactory + makeWithPresenter: self libraryPresenterForRoot + relativeTo: self buttonAddToRoots + position: SpPopoverPosition right) popup ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> actionEditorMenu [ ^ self editorMenuBuilder menuFor: self projectModel selection. ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> actionSelectionChanged: aCollection [ self projectModel ifNil: [ ^ self ]. @@ -76,24 +77,24 @@ PyramidTreePresenter >> editorMenuBuilder: anObject [ PyramidTreePresenter >> initializePresenters [ shouldUpdateSelection := true. + tree := SpTreeTablePresenter new beMultipleSelection; beResizable; roots: { }; children: [ :each | each children ]; contextMenu: [ self actionEditorMenu ]; - whenSelectionChangedDo: [ :selection | - self actionSelectionChanged: selection ]; + whenSelectionChangedDo: [ :selection | self actionSelectionChanged: selection ]; expandAll. columns := OrderedCollection new. buttonAddToRoots := SpButtonPresenter new - label: 'Add new element'; + label: 'Add element'; icon: (self iconNamed: #add); action: [ self actionAddNewElement ]; help: - 'Add a new element on the roots of the design.'; + 'Add a new element instance in the current Space root.'; yourself ] @@ -124,27 +125,27 @@ PyramidTreePresenter >> projectModel: anObject [ ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> pyramidElementsChanged [ self updateRoots. self selectionHaveChanged ifTrue: [ self updateSelection ]. ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> pyramidRootsChanged [ self updateRoots . self updateSelection ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> pyramidSelectionChanged [ self updateSelection ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> selectionHaveChanged [ self tree selectedItems size = self projectModel selection size ifFalse: [ @@ -174,7 +175,7 @@ PyramidTreePresenter >> tree [ ^ tree ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> updateRoots [ self shouldUpdateSelection: false. @@ -182,7 +183,7 @@ PyramidTreePresenter >> updateRoots [ self tree roots: self projectModel roots asArray ] ensure: [ self shouldUpdateSelection: true ] ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> updateSelection [ self projectModel ifNil: [ ^ self ]. @@ -195,7 +196,7 @@ PyramidTreePresenter >> updateSelection [ ensure: [ self shouldUpdateSelection: true ] ] -{ #category : #'as yet unclassified' } +{ #category : #private } PyramidTreePresenter >> updateTree [ self tree columns: { }.