Tagged nodes: Support for tagging nodes at right side. Next: custom views according to tags.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2015-01-14 09:41:36 +00:00
parent 0885fedfb9
commit cd76787b0f
2 changed files with 15 additions and 2 deletions

View File

@ -82,6 +82,7 @@ GrafoscopioBrowser >> addTagTo: aNode [
aNode tagAs: (tagsAvailable at: selection) aNode tagAs: (tagsAvailable at: selection)
] ]
ifTrue: [self messageNoTagsAvailable]. ifTrue: [self messageNoTagsAvailable].
browser update.
] ]
@ -986,6 +987,11 @@ GrafoscopioBrowser >> treeOn: constructor [
(eachNode header) isNil (eachNode header) isNil
ifTrue: [ '' ] ifTrue: [ '' ]
ifFalse: [ eachNode header ]]; ifFalse: [ eachNode header ]];
tags: [:eachNode |
(eachNode tags) isNil
ifFalse: [ (eachNode tags) asSymbol ]
ifTrue: [ #() ] ];
"Adding nodes" "Adding nodes"
act: [:treePresentation | act: [:treePresentation |
(treePresentation selection) isNotNil (treePresentation selection) isNotNil
@ -1061,13 +1067,13 @@ GrafoscopioBrowser >> treeOn: constructor [
treePresentation update] entitled: 'Pegar nodo' categorized: 'Nodo'; treePresentation update] entitled: 'Pegar nodo' categorized: 'Nodo';
"For tags" "For tags"
act: [self showTagsAvailable] entitled: 'Ver disponibles' categorized: 'Etiquetas';
act: [self addToTagsAvailable] entitled: 'Agregar a disponibles' categorized: 'Etiquetas';
act: [:treePresentation | act: [:treePresentation |
(treePresentation selection isNotNil) (treePresentation selection isNotNil)
ifTrue: [self addTagTo: treePresentation selection] ] ifTrue: [self addTagTo: treePresentation selection] ]
entitled: 'Agregar al nodo' categorized: 'Etiquetas'; entitled: 'Agregar al nodo' categorized: 'Etiquetas';
act: [self messageNotImplementedYet] entitled: 'Eliminar del nodo' categorized: 'Etiquetas'; act: [self messageNotImplementedYet] entitled: 'Eliminar del nodo' categorized: 'Etiquetas';
act: [self showTagsAvailable] entitled: 'Ver disponibles' categorized: 'Etiquetas';
act: [self addToTagsAvailable] entitled: 'Agregar a disponibles' categorized: 'Etiquetas';
"For projects" "For projects"
act: [self enableRepository] entitled: 'Activar' categorized: 'Proyecto'; act: [self enableRepository] entitled: 'Activar' categorized: 'Proyecto';

View File

@ -453,6 +453,13 @@ GrafoscopioNode >> tagAs: aTag [
tags := aTag. tags := aTag.
] ]
{ #category : #accessing }
GrafoscopioNode >> tags [
"Returns the receiver tags. For the moment is just one... yes silly, but will be extenden properly"
^ tags
]
{ #category : #'add/remove nodes' } { #category : #'add/remove nodes' }
GrafoscopioNode >> visitedGoTo: aCollection [ GrafoscopioNode >> visitedGoTo: aCollection [
"Stores the current node in a collection and recursively stores its children" "Stores the current node in a collection and recursively stores its children"