BookmarkAddMenuBuilder.st
author Claus Gittinger <cg@exept.de>
Sun, 03 Jul 2011 19:50:05 +0200
changeset 10071 1bf516aac0b8
parent 9969 c02850f71ad2
child 10086 46835bdcd38c
permissions -rw-r--r--
changed: #copyright
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool' }"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
BookmarkMenuBuilder subclass:#BookmarkAddMenuBuilder
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Bookmarks'
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!BookmarkAddMenuBuilder class methodsFor:'documentation'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2006 by eXept Software AG
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
! !
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!BookmarkAddMenuBuilder methodsFor:'visiting'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
visitBookmark:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    "Nothing to do"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    "Created: / 02-06-2011 / 21:43:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
visitFolder:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    | addItem item submenu |
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    addItem := self menuItemAddBookmark: anObject. 
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    anObject parent isNil
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        ifTrue:[
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
            stack top addItem: addItem.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
            anObject children ? #() do: [:child|self visit: child].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        ] ifFalse:[
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
            item := MenuItem labeled: anObject label.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
            stack top addItem: item.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
            submenu := Menu new.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
            item submenu: submenu.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
            stack push: submenu.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
            stack top addItem: addItem.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
            anObject children ? #() do: [:child|self visit: child].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
            stack pop
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    ].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    "Created: / 02-06-2011 / 21:50:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    "Modified: / 21-06-2011 / 08:00:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
visitSeparator:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "Created: / 03-06-2011 / 17:12:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
! !
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
!BookmarkAddMenuBuilder class methodsFor:'documentation'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
version_CVS
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ^ '$Header: /cvs/stx/stx/libtool/BookmarkAddMenuBuilder.st,v 1.1 2011-07-01 13:14:35 cg Exp $'
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
version_SVN
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    ^ '§Id§'
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
! !