From cd76787b0f809c85d51bd29a18c8d1b2d6a7f2d2 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 14 Jan 2015 09:41:36 +0000 Subject: [PATCH] Tagged nodes: Support for tagging nodes at right side. Next: custom views according to tags. --- repository/Grafoscopio/GrafoscopioBrowser.class.st | 10 ++++++++-- repository/Grafoscopio/GrafoscopioNode.class.st | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/repository/Grafoscopio/GrafoscopioBrowser.class.st b/repository/Grafoscopio/GrafoscopioBrowser.class.st index 46fe260..84b3093 100644 --- a/repository/Grafoscopio/GrafoscopioBrowser.class.st +++ b/repository/Grafoscopio/GrafoscopioBrowser.class.st @@ -82,6 +82,7 @@ GrafoscopioBrowser >> addTagTo: aNode [ aNode tagAs: (tagsAvailable at: selection) ] ifTrue: [self messageNoTagsAvailable]. + browser update. ] @@ -986,6 +987,11 @@ GrafoscopioBrowser >> treeOn: constructor [ (eachNode header) isNil ifTrue: [ '' ] ifFalse: [ eachNode header ]]; + tags: [:eachNode | + (eachNode tags) isNil + ifFalse: [ (eachNode tags) asSymbol ] + ifTrue: [ #() ] ]; + "Adding nodes" act: [:treePresentation | (treePresentation selection) isNotNil @@ -1061,13 +1067,13 @@ GrafoscopioBrowser >> treeOn: constructor [ treePresentation update] entitled: 'Pegar nodo' categorized: 'Nodo'; "For tags" - act: [self showTagsAvailable] entitled: 'Ver disponibles' categorized: 'Etiquetas'; - act: [self addToTagsAvailable] entitled: 'Agregar a disponibles' categorized: 'Etiquetas'; act: [:treePresentation | (treePresentation selection isNotNil) ifTrue: [self addTagTo: treePresentation selection] ] entitled: 'Agregar al 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" act: [self enableRepository] entitled: 'Activar' categorized: 'Proyecto'; diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index 7990dd4..ce85255 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -453,6 +453,13 @@ GrafoscopioNode >> tagAs: 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' } GrafoscopioNode >> visitedGoTo: aCollection [ "Stores the current node in a collection and recursively stores its children"