ProjectView.st
author Claus Gittinger <cg@exept.de>
Sat, 25 Nov 1995 19:04:47 +0100
changeset 217 a4b6b0d44c3b
parent 175 d067e08b6058
child 259 c651fecef457
permissions -rw-r--r--
repository added
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
88
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     1
"
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     3
	      All Rights Reserved
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     4
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     5
 This software is furnished under a license and may be used
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     6
 only in accordance with the terms of that license and with the
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
     9
 other person.  No title to or ownership of the software is
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    10
 hereby transferred.
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    11
"
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    12
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    13
StandardSystemView subclass:#ProjectView
45
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
    14
	 instanceVariableNames:'myProject toggle'
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
    15
	 classVariableNames:'ActiveProjectView'
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
    16
	 poolDictionaries:''
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
    17
	 category:'Interface-Smalltalk'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    18
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    19
88
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    20
!ProjectView class methodsFor:'documentation'!
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    21
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    22
copyright
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    23
"
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    24
 COPYRIGHT (c) 1994 by Claus Gittinger
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    25
	      All Rights Reserved
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    26
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    27
 This software is furnished under a license and may be used
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    28
 only in accordance with the terms of that license and with the
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    30
 be provided or otherwise made available to, or used by, any
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    31
 other person.  No title to or ownership of the software is
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    32
 hereby transferred.
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    33
"
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    34
! !
a38a2e87687b *** empty log message ***
claus
parents: 85
diff changeset
    35
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    36
!ProjectView class methodsFor:'instance creation'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    37
571fd5eee315 Initial revision
claus
parents:
diff changeset
    38
for:aProject
571fd5eee315 Initial revision
claus
parents:
diff changeset
    39
    |newView|
571fd5eee315 Initial revision
claus
parents:
diff changeset
    40
571fd5eee315 Initial revision
claus
parents:
diff changeset
    41
    newView := super new.
571fd5eee315 Initial revision
claus
parents:
diff changeset
    42
    newView setProject:aProject.
571fd5eee315 Initial revision
claus
parents:
diff changeset
    43
    ^ newView
571fd5eee315 Initial revision
claus
parents:
diff changeset
    44
571fd5eee315 Initial revision
claus
parents:
diff changeset
    45
    "ProjectView for:(Project new)"
571fd5eee315 Initial revision
claus
parents:
diff changeset
    46
! !
571fd5eee315 Initial revision
claus
parents:
diff changeset
    47
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    48
!ProjectView methodsFor:'initialization'!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    49
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    50
addToCurrentProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    51
    "ignored here"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    52
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    53
    ^ self
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    54
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    55
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    56
initialize
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    57
    super initialize.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    58
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    59
    "/
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    60
    "/ create the toggle ...
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    61
    "/
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    62
    toggle := Toggle in:self.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    63
    toggle borderWidth:0.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    64
    toggle pressAction:[self showProject].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    65
    toggle releaseAction:[self hideProject].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    66
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    67
    "/
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    68
    "/ and give it a menu
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    69
    "/
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    70
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    71
    toggle middleButtonMenu:(
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    72
        PopUpMenu
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    73
                labels:(resources array:
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    74
                           #('rename ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    75
                             'changes'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    76
                             'browse'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    77
                             'fileOut directory ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    78
                             'repository directory ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    79
                             'package ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    80
"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    81
                             'properties'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    82
"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    83
                             '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    84
                             'save project code'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    85
                             'build'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    86
                             '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    87
                             'show'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    88
                             'hide'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    89
                             '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    90
                             'remove package'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    91
                             'destroy'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    92
                            )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    93
                        )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    94
             selectors:#(renameProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    95
                         browseChanges
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    96
                         browsePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    97
                         projectDirectory
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    98
                         projectRepository
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
    99
                         projectPackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   100
"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   101
                         browseProps
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   102
"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   103
                         nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   104
                         saveProjectFiles
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   105
                         buildProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   106
                         nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   107
                         showProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   108
                         hideProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   109
                         nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   110
                         removePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   111
                         destroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   112
                        )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   113
              receiver:self
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   114
    )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   115
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   116
    "Created: 25.11.1995 / 18:06:32 / cg"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   117
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   118
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   119
initializeMenu
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   120
    |labels selectors|
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   121
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   122
    SourceCodeManager isNil ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   123
        labels := #(
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   124
                        'rename ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   125
                        'changes'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   126
                        'browse'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   127
                        'fileOut directory ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   128
                        'package ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   129
                        '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   130
                        'show'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   131
                        'hide'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   132
                        '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   133
                        'remove package classes/methods'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   134
                        'destroy'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   135
                   ).
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   136
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   137
         selectors := #(        
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   138
                        renameProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   139
                        browseChanges
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   140
                        browsePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   141
                        projectDirectory
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   142
                        projectPackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   143
                        nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   144
                        showProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   145
                        hideProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   146
                        nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   147
                        removePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   148
                        destroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   149
                    )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   150
    ] ifFalse:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   151
        labels := #(
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   152
                        'rename ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   153
                        'changes'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   154
                        'browse'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   155
                        'fileOut directory ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   156
                        'repository directory ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   157
                        'package ...'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   158
"/                        '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   159
"/                        'save project code'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   160
"/                        'build'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   161
                        '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   162
                        'show'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   163
                        'hide'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   164
                        '-'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   165
                        'remove package classes/methods'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   166
                        'destroy'
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   167
                   ).
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   168
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   169
         selectors := #(        
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   170
                        renameProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   171
                        browseChanges
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   172
                        browsePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   173
                        projectDirectory
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   174
                        projectRepository
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   175
                        projectPackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   176
"/                        nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   177
"/                        saveProjectFiles
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   178
"/                        buildProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   179
                        nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   180
                        showProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   181
                        hideProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   182
                        nil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   183
                        removePackage
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   184
                        destroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   185
                    )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   186
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   187
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   188
    toggle middleButtonMenu:(
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   189
        PopUpMenu
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   190
                labels:labels
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   191
                selectors:selectors
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   192
                receiver:self
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   193
    )
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   194
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   195
    "Created: 25.11.1995 / 18:06:32 / cg"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   196
    "Modified: 25.11.1995 / 18:18:36 / cg"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   197
! !
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   198
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   199
!ProjectView methodsFor:'menu actions'!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   200
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   201
browseChanges
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   202
    |b|
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   203
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   204
    b := ChangeSetBrowser openOn:(myProject changeSet).
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   205
    b label:'Changes in ' , myProject name
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   206
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   207
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   208
browsePackage
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   209
    "launch browsers for all classes/methods which are defined in this package"
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   210
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   211
    self topView withWaitCursorDo:[
105
claus
parents: 93
diff changeset
   212
	|classes packageName methods methodList|
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   213
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   214
	packageName := myProject packageName.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   215
	classes := myProject classes.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   216
	classes notNil ifTrue:[
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   217
	    SystemBrowser browseClasses:classes
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   218
				  title:'classes in package ' , packageName.
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   219
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   220
	    classes := classes asIdentitySet.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   221
	    classes addAll:(classes collect:[:c | c class]).
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   222
	] ifFalse:[
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   223
	    classes := #()
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   224
	].
105
claus
parents: 93
diff changeset
   225
"/        SystemBrowser browseMethodsWhere:[:cls :mthd :sel |
claus
parents: 93
diff changeset
   226
"/                                    mthd package = packageName
claus
parents: 93
diff changeset
   227
"/                                    and:[(classes includes:cls) not]
claus
parents: 93
diff changeset
   228
"/                                  ] 
claus
parents: 93
diff changeset
   229
"/                            title:'individual methods in package ' , packageName.
claus
parents: 93
diff changeset
   230
claus
parents: 93
diff changeset
   231
	methods := myProject individualMethods.
claus
parents: 93
diff changeset
   232
	methodList := methods collect:[:m | 
claus
parents: 93
diff changeset
   233
					|who|
claus
parents: 93
diff changeset
   234
claus
parents: 93
diff changeset
   235
					who := m who.
claus
parents: 93
diff changeset
   236
					(who at:1) name , ' ' , (who at:2)
claus
parents: 93
diff changeset
   237
				      ].
claus
parents: 93
diff changeset
   238
	SystemBrowser browseMethods:methodList
claus
parents: 93
diff changeset
   239
			      title:'individual methods in package ' , packageName.
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   240
    ]
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   241
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   242
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   243
browseProps
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   244
    "will look better, once property inspector runs ..."
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   245
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   246
    myProject properties inspect
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   247
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   248
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   249
buildProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   250
    self topView withWaitCursorDo:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   251
	|dir|
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   252
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   253
	self saveProjectFiles.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   254
	(self confirm:'make object files in: ' ,  dir , ' ?') ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   255
	    myProject buildProject.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   256
	]
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   257
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   258
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   259
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   260
destroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   261
    (myProject views notNil
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   262
    and:[myProject views notEmpty]) ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   263
	|box|
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   264
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   265
	box := YesNoBox new.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   266
	box title:'Destroying a project will discard all changes made
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   267
for that project and destroy all views opened for it.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   268
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   269
Do you really want to do this ?'.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   270
	box okText:'yes'.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   271
	(box confirm) ifFalse:[^ self]
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   272
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   273
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   274
    self doDestroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   275
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   276
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   277
destroyProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   278
    |box|
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   279
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   280
    box := YesNoBox new.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   281
    box title:'Destroying a project will discard all changes made
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   282
for that project and destroy all views opened for it.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   283
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   284
Do you really want to do this ?'.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   285
    box okText:'yes'.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   286
    box yesAction:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   287
	self doDestroyProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   288
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   289
    box showAtPointer
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   290
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   291
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   292
doDestroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   293
    self hideProject.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   294
    myProject := nil.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   295
    super destroy
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   296
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   297
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   298
hideProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   299
    myProject hideViews.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   300
    ActiveProjectView := nil.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   301
    toggle turnOff.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   302
    Project setDefaultProject.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   303
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   304
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   305
projectDirectory
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   306
    |box d|
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   307
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   308
    box := FilenameEnterBox new.
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   309
    box directoriesOnly.
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   310
    box title:(resources string:'Directory of project (fileOuts will go there):').
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   311
    (d := myProject directory) notNil ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   312
	box initialText:d
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   313
    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   314
    box action:[:dirName |
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   315
	(OperatingSystem isDirectory:dirName) ifFalse:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   316
	    (OperatingSystem isValidPath:dirName) ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   317
		self warn:(resources string:'%1 is not a valid directory' with:dirName).
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   318
		^ self
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   319
	    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   320
	    (self confirm:(resources string:'%1 does not exist\\create ?' with:dirName) withCRs) ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   321
		(OperatingSystem recursiveCreateDirectory:dirName) ifFalse:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   322
		    self warn:(resources string:'cannot create %1' with:dirName)
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   323
		]
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   324
	    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   325
	].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   326
	"did it work ?"
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   327
	(OperatingSystem isDirectory:dirName) ifTrue:[
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   328
	    myProject directory:dirName
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   329
	].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   330
    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   331
    box showAtPointer
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   332
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   333
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   334
projectPackage
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   335
    self topView withWaitCursorDo:[
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   336
	|box p existingPackages|
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   337
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   338
	existingPackages := Set new.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   339
	Smalltalk allClassesDo:[:aClass |
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   340
	    |p|
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   341
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   342
	    (p := aClass package) notNil ifTrue:[
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   343
		existingPackages add:(p asString)
110
claus
parents: 106
diff changeset
   344
	    ].
claus
parents: 106
diff changeset
   345
	    aClass methodArray do:[:aMethod |
claus
parents: 106
diff changeset
   346
		(p := aMethod package) notNil ifTrue:[
claus
parents: 106
diff changeset
   347
		    existingPackages add:(p asString)
claus
parents: 106
diff changeset
   348
		]
claus
parents: 106
diff changeset
   349
	    ].
claus
parents: 106
diff changeset
   350
	    aClass class methodArray do:[:aMethod |
claus
parents: 106
diff changeset
   351
		(p := aMethod package) notNil ifTrue:[
claus
parents: 106
diff changeset
   352
		    existingPackages add:(p asString)
claus
parents: 106
diff changeset
   353
		]
claus
parents: 106
diff changeset
   354
	    ].
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   355
	].
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   356
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   357
	box := ListSelectionBox title:'Package (new classes/methods will be put into that):'.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   358
	box list:(existingPackages asOrderedCollection sort).
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   359
	(p := myProject packageName) notNil ifTrue:[
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   360
	    box initialText:p
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   361
	].
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   362
	box action:[:packageName |
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   363
	    myProject packageName:packageName
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   364
	].
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   365
	box showAtPointer
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   366
    ]
110
claus
parents: 106
diff changeset
   367
!
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   368
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   369
projectRepository
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   370
    |box d|
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   371
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   372
    box := FilenameEnterBox new.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   373
    box directoriesOnly.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   374
    box title:(resources string:'Relative path of repository (source containers will go there):').
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   375
    (d := myProject repositoryDirectory) notNil ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   376
        box initialText:d
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   377
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   378
    box action:[:dirName |
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   379
        myProject repositoryDirectory:dirName
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   380
    ].
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   381
    box showAtPointer
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   382
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   383
    "Created: 25.11.1995 / 18:07:51 / cg"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   384
    "Modified: 25.11.1995 / 18:19:46 / cg"
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   385
!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   386
110
claus
parents: 106
diff changeset
   387
removePackage
claus
parents: 106
diff changeset
   388
    "remove all classes and individual methods from the system.
claus
parents: 106
diff changeset
   389
     Currently, this cannot fully restore the state to before
claus
parents: 106
diff changeset
   390
     the time the package was loaded (redefined methods are lost).
claus
parents: 106
diff changeset
   391
     In the future, we may keep a backref of overwritten methods
claus
parents: 106
diff changeset
   392
     and restore them from their source ..."
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   393
110
claus
parents: 106
diff changeset
   394
    |classesToRemove methodsToRemove theProject|
claus
parents: 106
diff changeset
   395
claus
parents: 106
diff changeset
   396
    (myProject isNil
claus
parents: 106
diff changeset
   397
    or:[(theProject := myProject packageName) isNil]) ifTrue:[
claus
parents: 106
diff changeset
   398
	self warn:'No current package'.
claus
parents: 106
diff changeset
   399
	^ self
claus
parents: 106
diff changeset
   400
    ].
claus
parents: 106
diff changeset
   401
claus
parents: 106
diff changeset
   402
    classesToRemove := IdentitySet new.
claus
parents: 106
diff changeset
   403
    methodsToRemove := IdentitySet new.
claus
parents: 106
diff changeset
   404
claus
parents: 106
diff changeset
   405
    Smalltalk allClassesDo:[:aClass |
claus
parents: 106
diff changeset
   406
	|p|
claus
parents: 106
diff changeset
   407
claus
parents: 106
diff changeset
   408
	(p := aClass package) notNil ifTrue:[
claus
parents: 106
diff changeset
   409
	    p = theProject  ifTrue:[
claus
parents: 106
diff changeset
   410
		classesToRemove add:aClass
claus
parents: 106
diff changeset
   411
	    ]
claus
parents: 106
diff changeset
   412
	].
claus
parents: 106
diff changeset
   413
    ].
claus
parents: 106
diff changeset
   414
    Smalltalk allClassesDo:[:aClass |
claus
parents: 106
diff changeset
   415
	|p|
claus
parents: 106
diff changeset
   416
claus
parents: 106
diff changeset
   417
	(classesToRemove includes:aClass) ifFalse:[
claus
parents: 106
diff changeset
   418
	    aClass methodArray do:[:aMethod |
claus
parents: 106
diff changeset
   419
		(p := aMethod package) notNil ifTrue:[
claus
parents: 106
diff changeset
   420
		    p = theProject  ifTrue:[
claus
parents: 106
diff changeset
   421
			methodsToRemove add:aMethod
claus
parents: 106
diff changeset
   422
		    ]
claus
parents: 106
diff changeset
   423
		]
claus
parents: 106
diff changeset
   424
	    ].
claus
parents: 106
diff changeset
   425
	    aClass class methodArray do:[:aMethod |
claus
parents: 106
diff changeset
   426
		(p := aMethod package) notNil ifTrue:[
claus
parents: 106
diff changeset
   427
		    p = theProject  ifTrue:[
claus
parents: 106
diff changeset
   428
			methodsToRemove add:aMethod
claus
parents: 106
diff changeset
   429
		    ]
claus
parents: 106
diff changeset
   430
		]
claus
parents: 106
diff changeset
   431
	    ].
claus
parents: 106
diff changeset
   432
	].
claus
parents: 106
diff changeset
   433
    ].
claus
parents: 106
diff changeset
   434
claus
parents: 106
diff changeset
   435
    (classesToRemove isEmpty
claus
parents: 106
diff changeset
   436
    and:[methodsToRemove isEmpty]) ifTrue:[
claus
parents: 106
diff changeset
   437
	self warn:('Nothing found in ' , theProject).
claus
parents: 106
diff changeset
   438
	^ self
claus
parents: 106
diff changeset
   439
    ].
claus
parents: 106
diff changeset
   440
claus
parents: 106
diff changeset
   441
    (self confirm:('About to remove '
claus
parents: 106
diff changeset
   442
		 , classesToRemove size printString
claus
parents: 106
diff changeset
   443
		 , ' classes and '
claus
parents: 106
diff changeset
   444
		 , methodsToRemove size printString
claus
parents: 106
diff changeset
   445
		 , ' additional methods.\\Are you certain you want this ?') withCRs)
claus
parents: 106
diff changeset
   446
	ifTrue:[
claus
parents: 106
diff changeset
   447
	    classesToRemove do:[:aClass |
claus
parents: 106
diff changeset
   448
		('PROJECT: removing ' , aClass name) infoPrintNL.
claus
parents: 106
diff changeset
   449
		Smalltalk removeClass:aClass.   
claus
parents: 106
diff changeset
   450
	    ].
claus
parents: 106
diff changeset
   451
	    methodsToRemove do:[:aMethod |
claus
parents: 106
diff changeset
   452
		|where|
claus
parents: 106
diff changeset
   453
claus
parents: 106
diff changeset
   454
		('PROJECT: removing ' , aMethod displayString) infoPrintNL.
claus
parents: 106
diff changeset
   455
		where := aMethod who.
claus
parents: 106
diff changeset
   456
		where isNil ifTrue:[
claus
parents: 106
diff changeset
   457
		    'PROJECT: oops, some method is gone' infoPrintNL.
claus
parents: 106
diff changeset
   458
		] ifFalse:[
claus
parents: 106
diff changeset
   459
		    (where at:1) removeSelector:(where at:2)
claus
parents: 106
diff changeset
   460
		]
claus
parents: 106
diff changeset
   461
	    ]
claus
parents: 106
diff changeset
   462
    ].
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   463
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   464
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   465
renameProject
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   466
    |box|
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   467
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   468
    box := EnterBox new.
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   469
    box title:'new name of project:'.
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   470
    box okText:'rename'.
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   471
    box initialText:(myProject name).
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   472
    box action:[:newName |
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   473
	myProject name:newName.
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   474
	self setProject:myProject.
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   475
	self windowGroup process name:'Project: ' , newName.
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   476
    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   477
    box showAtPointer
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   478
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   479
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   480
saveProjectFiles
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   481
    self topView withWaitCursorDo:[
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   482
	|dir|
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   483
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   484
	dir := myProject directory.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   485
	(self confirm:'create source files in: ' ,  dir , ' ?') ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   486
	    myProject createProjectFiles.
85
d9713a3ca092 *** empty log message ***
claus
parents: 57
diff changeset
   487
	]
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   488
    ].
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   489
!
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   490
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   491
showProject
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   492
    ActiveProjectView notNil ifTrue:[
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   493
	ActiveProjectView hideProject
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   494
    ].
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   495
    ActiveProjectView := self.
110
claus
parents: 106
diff changeset
   496
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   497
    myProject showViews.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   498
    Project current:myProject.
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   499
    toggle turnOn
57
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   500
! !
36e13831b62d *** empty log message ***
claus
parents: 52
diff changeset
   501
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   502
!ProjectView methodsFor:'private accessing'!
571fd5eee315 Initial revision
claus
parents:
diff changeset
   503
571fd5eee315 Initial revision
claus
parents:
diff changeset
   504
setProject:aProject
571fd5eee315 Initial revision
claus
parents:
diff changeset
   505
    |name e|
571fd5eee315 Initial revision
claus
parents:
diff changeset
   506
571fd5eee315 Initial revision
claus
parents:
diff changeset
   507
    name := aProject name.
571fd5eee315 Initial revision
claus
parents:
diff changeset
   508
    self label:name.
17
58c360f199be *** empty log message ***
claus
parents: 9
diff changeset
   509
    self iconLabel:name.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   510
    toggle label:'Project: ' , name.
571fd5eee315 Initial revision
claus
parents:
diff changeset
   511
    toggle resize.
571fd5eee315 Initial revision
claus
parents:
diff changeset
   512
    myProject := aProject.
571fd5eee315 Initial revision
claus
parents:
diff changeset
   513
    e := (toggle width @ toggle height).
29
8a72e10043f6 *** empty log message ***
claus
parents: 17
diff changeset
   514
    drawableId isNil ifTrue:[
45
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   515
	self minExtent:e.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   516
	self maxExtent:e.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   517
	self open
29
8a72e10043f6 *** empty log message ***
claus
parents: 17
diff changeset
   518
    ] ifFalse:[
45
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   519
	self unrealize.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   520
	self minExtent:e.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   521
	self maxExtent:e.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   522
	self extent:e.
950b84ba89e6 *** empty log message ***
claus
parents: 40
diff changeset
   523
	self rerealize
29
8a72e10043f6 *** empty log message ***
claus
parents: 17
diff changeset
   524
    ]
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   525
! !
217
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   526
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   527
!ProjectView class methodsFor:'documentation'!
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   528
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   529
version
a4b6b0d44c3b repository added
Claus Gittinger <cg@exept.de>
parents: 175
diff changeset
   530
^ '$Header: /cvs/stx/stx/libtool/ProjectView.st,v 1.21 1995-11-25 18:04:47 cg Exp $'! !