initial checkin
authorClaus Gittinger <cg@exept.de>
Fri, 01 Jul 2011 15:14:35 +0200
changeset 9969 c02850f71ad2
parent 9968 07185068e8ec
child 9970 adb58666157b
initial checkin
BookmarkAddMenuBuilder.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BookmarkAddMenuBuilder.st	Fri Jul 01 15:14:35 2011 +0200
@@ -0,0 +1,84 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+"{ Package: 'stx:libtool' }"
+
+BookmarkMenuBuilder subclass:#BookmarkAddMenuBuilder
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-Bookmarks'
+!
+
+!BookmarkAddMenuBuilder class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
+
+!BookmarkAddMenuBuilder methodsFor:'visiting'!
+
+visitBookmark:anObject
+
+    "Nothing to do"
+
+    "Created: / 02-06-2011 / 21:43:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitFolder:anObject
+
+    | addItem item submenu |
+
+    addItem := self menuItemAddBookmark: anObject. 
+
+    anObject parent isNil
+        ifTrue:[
+            stack top addItem: addItem.
+            anObject children ? #() do: [:child|self visit: child].
+        ] ifFalse:[
+            item := MenuItem labeled: anObject label.
+            stack top addItem: item.
+            submenu := Menu new.
+            item submenu: submenu.
+            stack push: submenu.
+            stack top addItem: addItem.
+            anObject children ? #() do: [:child|self visit: child].
+            stack pop
+    ].
+
+    "Created: / 02-06-2011 / 21:50:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 21-06-2011 / 08:00:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+visitSeparator:anObject
+
+    "Created: / 03-06-2011 / 17:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!BookmarkAddMenuBuilder class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libtool/BookmarkAddMenuBuilder.st,v 1.1 2011-07-01 13:14:35 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id§'
+! !