packages/AbstractPackageBrowser.st
author james
Fri, 09 May 2003 14:24:57 +0200
changeset 1268 9dc8d1b8ce9b
parent 1227 ab88e78f027c
child 1443 6dfdf336b472
permissions -rw-r--r--
Lots and lots of changes... I hope now that any changes to Smalltalk does not result in inconsistancy in the packages. I still need to redesign the class Package as it does too much. More of the responsibilities need to be put on PackagedClass and PackagedMethod. The PackageBrowser has got some nice package pictures!
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
     1
"{ Package: 'stx:libbasic3' }"
ab88e78f027c initial checkin
james
parents:
diff changeset
     2
ab88e78f027c initial checkin
james
parents:
diff changeset
     3
"{ NameSpace: Packages }"
ab88e78f027c initial checkin
james
parents:
diff changeset
     4
ab88e78f027c initial checkin
james
parents:
diff changeset
     5
ApplicationModel subclass:#AbstractPackageBrowser
ab88e78f027c initial checkin
james
parents:
diff changeset
     6
	instanceVariableNames:'applicationAspects'
ab88e78f027c initial checkin
james
parents:
diff changeset
     7
	classVariableNames:''
ab88e78f027c initial checkin
james
parents:
diff changeset
     8
	poolDictionaries:''
ab88e78f027c initial checkin
james
parents:
diff changeset
     9
	category:'Package-Application'
ab88e78f027c initial checkin
james
parents:
diff changeset
    10
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    11
ab88e78f027c initial checkin
james
parents:
diff changeset
    12
ab88e78f027c initial checkin
james
parents:
diff changeset
    13
!AbstractPackageBrowser methodsFor:'accessing'!
ab88e78f027c initial checkin
james
parents:
diff changeset
    14
ab88e78f027c initial checkin
james
parents:
diff changeset
    15
applicationAspects
ab88e78f027c initial checkin
james
parents:
diff changeset
    16
    applicationAspects ifNil:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    17
        applicationAspects := Dictionary new
ab88e78f027c initial checkin
james
parents:
diff changeset
    18
    ].
ab88e78f027c initial checkin
james
parents:
diff changeset
    19
    ^ applicationAspects
ab88e78f027c initial checkin
james
parents:
diff changeset
    20
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    21
ab88e78f027c initial checkin
james
parents:
diff changeset
    22
applicationAspects:something
ab88e78f027c initial checkin
james
parents:
diff changeset
    23
    "set the value of the instance variable 'applicationAspects' (automatically generated)"
ab88e78f027c initial checkin
james
parents:
diff changeset
    24
ab88e78f027c initial checkin
james
parents:
diff changeset
    25
    applicationAspects := something.
ab88e78f027c initial checkin
james
parents:
diff changeset
    26
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    27
ab88e78f027c initial checkin
james
parents:
diff changeset
    28
declareDependents
ab88e78f027c initial checkin
james
parents:
diff changeset
    29
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    30
ab88e78f027c initial checkin
james
parents:
diff changeset
    31
masterApplication:aMasterApplication
ab88e78f027c initial checkin
james
parents:
diff changeset
    32
    aMasterApplication ifNil:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    33
        ^ self.
ab88e78f027c initial checkin
james
parents:
diff changeset
    34
    ].
ab88e78f027c initial checkin
james
parents:
diff changeset
    35
    
ab88e78f027c initial checkin
james
parents:
diff changeset
    36
    self applicationAspects: aMasterApplication applicationAspects.
ab88e78f027c initial checkin
james
parents:
diff changeset
    37
    self declareDependents.
ab88e78f027c initial checkin
james
parents:
diff changeset
    38
    ^ super masterApplication:aMasterApplication.
ab88e78f027c initial checkin
james
parents:
diff changeset
    39
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    40
ab88e78f027c initial checkin
james
parents:
diff changeset
    41
packagesNamed:aCollectionOfPackageNamesOrSymbol 
ab88e78f027c initial checkin
james
parents:
diff changeset
    42
    |aCollectionOfPackageNames|
ab88e78f027c initial checkin
james
parents:
diff changeset
    43
    aCollectionOfPackageNames := aCollectionOfPackageNamesOrSymbol.
ab88e78f027c initial checkin
james
parents:
diff changeset
    44
    aCollectionOfPackageNames isSymbol ifTrue:[
ab88e78f027c initial checkin
james
parents:
diff changeset
    45
        aCollectionOfPackageNames := Array with:aCollectionOfPackageNamesOrSymbol.
ab88e78f027c initial checkin
james
parents:
diff changeset
    46
    ].
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    47
    [(aCollectionOfPackageNamesOrSymbol includes:nil)] whileTrue:[
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    48
        aCollectionOfPackageNamesOrSymbol remove:nil
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    49
    ].
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    50
    
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    51
    ^ self packageManager packagesNamed:aCollectionOfPackageNames
ab88e78f027c initial checkin
james
parents:
diff changeset
    52
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    53
ab88e78f027c initial checkin
james
parents:
diff changeset
    54
packagesSelected
ab88e78f027c initial checkin
james
parents:
diff changeset
    55
    ^ self packagesSelectedHolder value
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    56
!
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    57
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    58
undeclareDependents
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    59
! !
ab88e78f027c initial checkin
james
parents:
diff changeset
    60
ab88e78f027c initial checkin
james
parents:
diff changeset
    61
!AbstractPackageBrowser methodsFor:'accessing - shared'!
ab88e78f027c initial checkin
james
parents:
diff changeset
    62
ab88e78f027c initial checkin
james
parents:
diff changeset
    63
applicationAspectsAt:anIdentifier ifAbsent:aBlock
ab88e78f027c initial checkin
james
parents:
diff changeset
    64
    ^ self applicationAspects at:anIdentifier ifAbsent:aBlock
ab88e78f027c initial checkin
james
parents:
diff changeset
    65
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    66
ab88e78f027c initial checkin
james
parents:
diff changeset
    67
applicationAspectsAt:aSymbol ifAbsentPut:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    68
    ^ self applicationAspects at:aSymbol ifAbsentPut:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    69
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    70
ab88e78f027c initial checkin
james
parents:
diff changeset
    71
applicationAspectsAt:anIdentifier put:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    72
    ^ self applicationAspects at:anIdentifier put:anObject
ab88e78f027c initial checkin
james
parents:
diff changeset
    73
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    74
ab88e78f027c initial checkin
james
parents:
diff changeset
    75
packageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
    76
    ^ self applicationAspectsAt:#packageManager ifAbsent:[nil]
ab88e78f027c initial checkin
james
parents:
diff changeset
    77
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    78
ab88e78f027c initial checkin
james
parents:
diff changeset
    79
packageManager:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
    80
    ^ self applicationAspectsAt:#packageManager put:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
    81
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    82
ab88e78f027c initial checkin
james
parents:
diff changeset
    83
packagesSelectedHolder
ab88e78f027c initial checkin
james
parents:
diff changeset
    84
    ^ self applicationAspectsAt:#packagesSelectedHolder ifAbsent:[ValueHolder new]
ab88e78f027c initial checkin
james
parents:
diff changeset
    85
!
ab88e78f027c initial checkin
james
parents:
diff changeset
    86
ab88e78f027c initial checkin
james
parents:
diff changeset
    87
packagesSelectedHolder:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
    88
    ^ self applicationAspectsAt:#packagesSelectedHolder put:aPackageManager
ab88e78f027c initial checkin
james
parents:
diff changeset
    89
! !
ab88e78f027c initial checkin
james
parents:
diff changeset
    90
ab88e78f027c initial checkin
james
parents:
diff changeset
    91
!AbstractPackageBrowser class methodsFor:'documentation'!
ab88e78f027c initial checkin
james
parents:
diff changeset
    92
ab88e78f027c initial checkin
james
parents:
diff changeset
    93
version
1268
9dc8d1b8ce9b Lots and lots of changes...
james
parents: 1227
diff changeset
    94
    ^ '$Header: /cvs/stx/stx/libbasic3/packages/AbstractPackageBrowser.st,v 1.2 2003-05-09 12:22:34 james Exp $'
1227
ab88e78f027c initial checkin
james
parents:
diff changeset
    95
! !