From 08d48aed12a67f1376b3edfecaabed8539d35fa2 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 19 Dec 2016 18:24:06 +0000 Subject: [PATCH] Node links: Openning them in the browser. There is still variations to explore, if the link contains a file or a reference to an image. --- repository/Grafoscopio/GrafoscopioNode.class.st | 6 ++++++ repository/Grafoscopio/GrafoscopioNotebook.class.st | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index a5e3ad0..8d7d3be 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -696,6 +696,12 @@ GrafoscopioNode >> title [ ^ header ] +{ #category : #operation } +GrafoscopioNode >> visitLastLink [ + links ifNil: [ self inform: 'This node has no associated links to visit'. ^ self ]. + [WebBrowser openOn: self lastLink] fork. +] + { #category : #'add/remove nodes' } GrafoscopioNode >> visitedGoTo: aCollection [ "Stores the current node in a collection and recursively stores its children" diff --git a/repository/Grafoscopio/GrafoscopioNotebook.class.st b/repository/Grafoscopio/GrafoscopioNotebook.class.st index 1627d41..4752946 100644 --- a/repository/Grafoscopio/GrafoscopioNotebook.class.st +++ b/repository/Grafoscopio/GrafoscopioNotebook.class.st @@ -289,6 +289,12 @@ GrafoscopioNotebook >> newWindowMainMenu [ description: 'Togle: code <--> text'; icon: MendaIcons new smalltalkCodeIcon; action: [ self toggleCodeNode ] ]. + group addItem: [ :item | + item + name: nil; + description: 'Visit link'; + icon: Smalltalk ui icons glamorousRight; + action: [ self visitNodeLink ] ]. group addItem: [ :item | item name: nil; @@ -612,6 +618,12 @@ GrafoscopioNotebook >> updateForSpecialHeader [ self updateBodyFor: currentNode ] +{ #category : #'editing nodes' } +GrafoscopioNotebook >> visitNodeLink [ + + tree highlightedItem content visitLastLink. +] + { #category : #accessing } GrafoscopioNotebook >> windowMainMenu [ ^ windowMainMenu