packages/AbstractPackageBrowser.st
author Claus Gittinger <cg@exept.de>
Sun, 23 Feb 2020 13:23:18 +0100
changeset 4553 2cbcb4f949e6
parent 1443 6dfdf336b472
child 3011 1997ff6e7e55
permissions -rw-r--r--
#REFACTORING by exept class: HistoryManager changed: #addHistory:with:to:inSource:filter:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1443
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     1
"
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     2
 COPYRIGHT (c) 2003 by eXept Software AG
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     3
              All Rights Reserved
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     4
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     5
 This software is furnished under a license and may be used
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     6
 only in accordance with the terms of that license and with the
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     8
 be provided or otherwise made available to, or used by, any
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
     9
 other person.  No title to or ownership of the software is
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    10
 hereby transferred.
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    11
"
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    12
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
ab88e78f027c initial checkin
james
parents:
diff changeset
    14
ab88e78f027c initial checkin
james
parents:
diff changeset
    15
"{ NameSpace: Packages }"
ab88e78f027c initial checkin
james
parents:
diff changeset
    16
ab88e78f027c initial checkin
james
parents:
diff changeset
    17
ApplicationModel subclass:#AbstractPackageBrowser
ab88e78f027c initial checkin
james
parents:
diff changeset
    18
	instanceVariableNames:'applicationAspects'
ab88e78f027c initial checkin
james
parents:
diff changeset
    19
	classVariableNames:''
ab88e78f027c initial checkin
james
parents:
diff changeset
    20
	poolDictionaries:''
ab88e78f027c initial checkin
james
parents:
diff changeset
    21
	category:'Package-Application'
ab88e78f027c initial checkin
james
parents:
diff changeset
    22
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    23
1443
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    24
!AbstractPackageBrowser class methodsFor:'documentation'!
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    25
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    26
copyright
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    27
"
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    28
 COPYRIGHT (c) 2003 by eXept Software AG
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    29
              All Rights Reserved
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    30
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    31
 This software is furnished under a license and may be used
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    32
 only in accordance with the terms of that license and with the
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    33
 inclusion of the above copyright notice.   This software may not
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    34
 be provided or otherwise made available to, or used by, any
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    35
 other person.  No title to or ownership of the software is
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    36
 hereby transferred.
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    37
"
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
    38
! !
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    39
ab88e78f027c initial checkin
james
parents:
diff changeset
    40
!AbstractPackageBrowser methodsFor:'accessing'!
ab88e78f027c initial checkin
james
parents:
diff changeset
    41
ab88e78f027c initial checkin
james
parents:
diff changeset
    42
applicationAspects
ab88e78f027c initial checkin
james
parents:
diff changeset
    43
    applicationAspects ifNil:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    44
        applicationAspects := Dictionary new
ab88e78f027c initial checkin
james
parents:
diff changeset
    45
    ].
ab88e78f027c initial checkin
james
parents:
diff changeset
    46
    ^ applicationAspects
ab88e78f027c initial checkin
james
parents:
diff changeset
    47
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    48
ab88e78f027c initial checkin
james
parents:
diff changeset
    49
applicationAspects:something
ab88e78f027c initial checkin
james
parents:
diff changeset
    50
    "set the value of the instance variable 'applicationAspects' (automatically generated)"
ab88e78f027c initial checkin
james
parents:
diff changeset
    51
ab88e78f027c initial checkin
james
parents:
diff changeset
    52
    applicationAspects := something.
ab88e78f027c initial checkin
james
parents:
diff changeset
    53
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    54
ab88e78f027c initial checkin
james
parents:
diff changeset
    55
declareDependents
ab88e78f027c initial checkin
james
parents:
diff changeset
    56
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    57
ab88e78f027c initial checkin
james
parents:
diff changeset
    58
masterApplication:aMasterApplication
ab88e78f027c initial checkin
james
parents:
diff changeset
    59
    aMasterApplication ifNil:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    60
        ^ self.
ab88e78f027c initial checkin
james
parents:
diff changeset
    61
    ].
ab88e78f027c initial checkin
james
parents:
diff changeset
    62
    
ab88e78f027c initial checkin
james
parents:
diff changeset
    63
    self applicationAspects: aMasterApplication applicationAspects.
ab88e78f027c initial checkin
james
parents:
diff changeset
    64
    self declareDependents.
ab88e78f027c initial checkin
james
parents:
diff changeset
    65
    ^ super masterApplication:aMasterApplication.
ab88e78f027c initial checkin
james
parents:
diff changeset
    66
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    67
ab88e78f027c initial checkin
james
parents:
diff changeset
    68
packagesNamed:aCollectionOfPackageNamesOrSymbol 
ab88e78f027c initial checkin
james
parents:
diff changeset
    69
    |aCollectionOfPackageNames|
ab88e78f027c initial checkin
james
parents:
diff changeset
    70
    aCollectionOfPackageNames := aCollectionOfPackageNamesOrSymbol.
ab88e78f027c initial checkin
james
parents:
diff changeset
    71
    aCollectionOfPackageNames isSymbol ifTrue:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    72
        aCollectionOfPackageNames := Array with:aCollectionOfPackageNamesOrSymbol.
ab88e78f027c initial checkin
james
parents:
diff changeset
    73
    ].
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    74
    [(aCollectionOfPackageNamesOrSymbol includes:nil)] whileTrue:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    75
        aCollectionOfPackageNamesOrSymbol remove:nil
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    76
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    77
    
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    78
    ^ self packageManager packagesNamed:aCollectionOfPackageNames
ab88e78f027c initial checkin
james
parents:
diff changeset
    79
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    80
ab88e78f027c initial checkin
james
parents:
diff changeset
    81
packagesSelected
ab88e78f027c initial checkin
james
parents:
diff changeset
    82
    ^ self packagesSelectedHolder value
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    83
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    84
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    85
undeclareDependents
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    86
! !
ab88e78f027c initial checkin
james
parents:
diff changeset
    87
ab88e78f027c initial checkin
james
parents:
diff changeset
    88
!AbstractPackageBrowser methodsFor:'accessing - shared'!
ab88e78f027c initial checkin
james
parents:
diff changeset
    89
ab88e78f027c initial checkin
james
parents:
diff changeset
    90
applicationAspectsAt:anIdentifier ifAbsent:aBlock
ab88e78f027c initial checkin
james
parents:
diff changeset
    91
    ^ self applicationAspects at:anIdentifier ifAbsent:aBlock
ab88e78f027c initial checkin
james
parents:
diff changeset
    92
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    93
ab88e78f027c initial checkin
james
parents:
diff changeset
    94
applicationAspectsAt:aSymbol ifAbsentPut:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    95
    ^ self applicationAspects at:aSymbol ifAbsentPut:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    96
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    97
ab88e78f027c initial checkin
james
parents:
diff changeset
    98
applicationAspectsAt:anIdentifier put:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    99
    ^ self applicationAspects at:anIdentifier put:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
   100
!
ab88e78f027c initial checkin
james
parents:
diff changeset
   101
ab88e78f027c initial checkin
james
parents:
diff changeset
   102
packageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
   103
    ^ self applicationAspectsAt:#packageManager ifAbsent:[nil]
ab88e78f027c initial checkin
james
parents:
diff changeset
   104
!
ab88e78f027c initial checkin
james
parents:
diff changeset
   105
ab88e78f027c initial checkin
james
parents:
diff changeset
   106
packageManager:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
   107
    ^ self applicationAspectsAt:#packageManager put:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
   108
!
ab88e78f027c initial checkin
james
parents:
diff changeset
   109
ab88e78f027c initial checkin
james
parents:
diff changeset
   110
packagesSelectedHolder
ab88e78f027c initial checkin
james
parents:
diff changeset
   111
    ^ self applicationAspectsAt:#packagesSelectedHolder ifAbsent:[ValueHolder new]
ab88e78f027c initial checkin
james
parents:
diff changeset
   112
!
ab88e78f027c initial checkin
james
parents:
diff changeset
   113
ab88e78f027c initial checkin
james
parents:
diff changeset
   114
packagesSelectedHolder:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
   115
    ^ self applicationAspectsAt:#packagesSelectedHolder put:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
   116
! !
ab88e78f027c initial checkin
james
parents:
diff changeset
   117
ab88e78f027c initial checkin
james
parents:
diff changeset
   118
!AbstractPackageBrowser class methodsFor:'documentation'!
ab88e78f027c initial checkin
james
parents:
diff changeset
   119
ab88e78f027c initial checkin
james
parents:
diff changeset
   120
version
1443
6dfdf336b472 copyright
Claus Gittinger <cg@exept.de>
parents: 1268
diff changeset
   121
    ^ '$Header: /cvs/stx/stx/libbasic3/packages/AbstractPackageBrowser.st,v 1.3 2006-01-10 09:25:27 cg Exp $'
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
   122
! !