BookmarkAddMenuBuilder.st
author Stefan Vogel <sv@exept.de>
Fri, 17 May 2019 17:11:44 +0200
changeset 18767 0478d93cdb75
parent 13437 0dd16168581b
child 13491 b3afe831ff0a
permissions -rw-r--r--
#REFACTORING by stefan Sanitize BlockValues class: Tools::Inspector2 changed: #toolbarBackgroundHolder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10086
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     2
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     3
 Copyright (c) 2009-2010 eXept Software AG
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10086
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     5
 Permission is hereby granted, free of charge, to any person
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     6
 obtaining a copy of this software and associated documentation
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     7
 files (the 'Software'), to deal in the Software without
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     8
 restriction, including without limitation the rights to use,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
     9
 copy, modify, merge, publish, distribute, sublicense, and/or sell
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    10
 copies of the Software, and to permit persons to whom the
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    11
 Software is furnished to do so, subject to the following
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    12
 conditions:
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    13
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    14
 The above copyright notice and this permission notice shall be
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    15
 included in all copies or substantial portions of the Software.
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    16
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    17
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    18
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    19
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    20
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    21
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    22
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    23
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    24
 OTHER DEALINGS IN THE SOFTWARE.
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
BookmarkMenuBuilder subclass:#BookmarkAddMenuBuilder
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
	instanceVariableNames:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	classVariableNames:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	poolDictionaries:''
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	category:'Interface-Bookmarks'
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!BookmarkAddMenuBuilder class methodsFor:'documentation'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
copyright
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
10086
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    39
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    40
 Copyright (c) 2009-2010 eXept Software AG
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    41
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    42
 Permission is hereby granted, free of charge, to any person
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    43
 obtaining a copy of this software and associated documentation
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    44
 files (the 'Software'), to deal in the Software without
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    45
 restriction, including without limitation the rights to use,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    46
 copy, modify, merge, publish, distribute, sublicense, and/or sell
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    47
 copies of the Software, and to permit persons to whom the
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    48
 Software is furnished to do so, subject to the following
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    49
 conditions:
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
10086
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    51
 The above copyright notice and this permission notice shall be
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    52
 included in all copies or substantial portions of the Software.
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    53
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    54
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    55
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    56
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    57
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    58
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    59
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    60
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46835bdcd38c copyright
Claus Gittinger <cg@exept.de>
parents: 9969
diff changeset
    61
 OTHER DEALINGS IN THE SOFTWARE.
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
! !
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!BookmarkAddMenuBuilder methodsFor:'visiting'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
visitBookmark:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    "Nothing to do"
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    "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
    72
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
visitFolder:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    | addItem item submenu |
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    addItem := self menuItemAddBookmark: anObject. 
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    anObject parent isNil
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        ifTrue:[
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
            stack top addItem: addItem.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
            anObject children ? #() do: [:child|self visit: child].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
        ] ifFalse:[
13437
0dd16168581b class: BookmarkMenuBuilder
Claus Gittinger <cg@exept.de>
parents: 10086
diff changeset
    85
            item := MenuItem label: anObject label.
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
            stack top addItem: item.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
            submenu := Menu new.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
            item submenu: submenu.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
            stack push: submenu.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
            stack top addItem: addItem.
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
            anObject children ? #() do: [:child|self visit: child].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
            stack pop
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    ].
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "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
    96
    "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
    97
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
visitSeparator:anObject
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
    "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
   102
! !
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
!BookmarkAddMenuBuilder class methodsFor:'documentation'!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
version_CVS
13437
0dd16168581b class: BookmarkMenuBuilder
Claus Gittinger <cg@exept.de>
parents: 10086
diff changeset
   107
    ^ '$Header: /cvs/stx/stx/libtool/BookmarkAddMenuBuilder.st,v 1.3 2013-08-31 17:41:47 cg Exp $'
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
!
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
version_SVN
13437
0dd16168581b class: BookmarkMenuBuilder
Claus Gittinger <cg@exept.de>
parents: 10086
diff changeset
   111
    ^ '$Id: BookmarkAddMenuBuilder.st,v 1.3 2013-08-31 17:41:47 cg Exp $'
9969
c02850f71ad2 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
! !
13437
0dd16168581b class: BookmarkMenuBuilder
Claus Gittinger <cg@exept.de>
parents: 10086
diff changeset
   113