FileApplicationNoteBook.st
changeset 9819 2edda6ff0600
parent 9788 675dca9b2692
child 9882 5956cfea28a8
equal deleted inserted replaced
9818:125d044d2be0 9819:2edda6ff0600
   370         ].
   370         ].
   371 ! !
   371 ! !
   372 
   372 
   373 !FileApplicationNoteBook methodsFor:'actions-app-common'!
   373 !FileApplicationNoteBook methodsFor:'actions-app-common'!
   374 
   374 
   375 changeItem:anItem for:aAppl
   375 changeItem:anItem for:anAppl
   376 
       
   377     | applIndex string isDirectory |
   376     | applIndex string isDirectory |
   378 
   377 
   379     applIndex := self getIndexFor:aAppl.
   378     applIndex := self getIndexFor:anAppl.
   380     anItem notNil ifTrue:[
   379     anItem notNil ifTrue:[
   381         isDirectory := anItem isDirectory or:[anItem linkTargetIsDirectory ].
   380         isDirectory := anItem isDirectory or:[anItem linkTargetIsDirectory ].
   382 
   381 
   383         isDirectory ifFalse:[
   382         isDirectory ifFalse:[
   384             (aAppl changeItem:anItem) ifFalse:[ ^ self].
   383             (anAppl changeItem:anItem) ifFalse:[ ^ self].
   385             self fileHistory add:anItem.
   384             self fileHistory addFirst:anItem.
   386             self enableFileHistory value:true.
   385             self enableFileHistory value:true.
   387         ].
   386         ].
   388     ].
   387     ].
   389     string := aAppl getTabString.
   388     string := anAppl getTabString.
   390     self privateTabList at:applIndex put:(Text fromString:string).
   389     self privateTabList at:applIndex put:(Text fromString:string).
   391     self doSelect:aAppl.
   390     self doSelect:anAppl.
   392 !
   391 !
   393 
   392 
   394 changeModified:aSymbol for:aAppl
   393 changeModified:aSymbol for:aAppl
   395 
   394 
   396     | index text stream|
   395     | index text stream|
   564 
   563 
   565     "do not open unreadable items"
   564     "do not open unreadable items"
   566     checkExisting ifTrue:[
   565     checkExisting ifTrue:[
   567         (anItem notNil and:[anItem isDirectory not and:[anItem fileName isReadable not]]) ifTrue:[
   566         (anItem notNil and:[anItem isDirectory not and:[anItem fileName isReadable not]]) ifTrue:[
   568             Dialog warn:'Can not open unreadable file ', anItem fileName baseName.
   567             Dialog warn:'Can not open unreadable file ', anItem fileName baseName.
   569             AbortSignal raise.
   568             AbortOperationRequest raise.
   570         ].
   569         ].
   571         existingAppl := self tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock.
   570         existingAppl := self tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock.
   572         existingAppl notNil ifTrue:[
   571         existingAppl notNil ifTrue:[
   573             self doSelect:existingAppl.
   572             self doSelect:existingAppl.
   574             ^ existingAppl
   573             ^ existingAppl
   585         newAppl fileEncoding:(self fileEncodingHolder value).    
   584         newAppl fileEncoding:(self fileEncodingHolder value).    
   586         newAppl lockFileEncoding:(self lockFileEncodingHolder value).    
   585         newAppl lockFileEncoding:(self lockFileEncodingHolder value).    
   587     ].
   586     ].
   588     (newAppl item:anItem) ifFalse:[ ^ nil ].
   587     (newAppl item:anItem) ifFalse:[ ^ nil ].
   589     (anItem notNil and:[(anItem isDirectory not) and:[aType ~= #directoryDescription]]) ifTrue:[
   588     (anItem notNil and:[(anItem isDirectory not) and:[aType ~= #directoryDescription]]) ifTrue:[
   590         self fileHistory add:anItem.
   589         self fileHistory addFirst:anItem.
   591         self enableFileHistory value:true.
   590         self enableFileHistory value:true.
   592     ].
   591     ].
   593     self setSameFileIndexFor:newAppl.
   592     self setSameFileIndexFor:newAppl.
   594     self startApplication:newAppl.
   593     self startApplication:newAppl.
   595     ^ newAppl
   594     ^ newAppl
  6301 ! !
  6300 ! !
  6302 
  6301 
  6303 !FileApplicationNoteBook class methodsFor:'documentation'!
  6302 !FileApplicationNoteBook class methodsFor:'documentation'!
  6304 
  6303 
  6305 version
  6304 version
  6306     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.246 2011-02-21 16:22:11 cg Exp $'
  6305     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.247 2011-04-16 20:44:16 stefan Exp $'
  6307 !
  6306 !
  6308 
  6307 
  6309 version_CVS
  6308 version_CVS
  6310     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.246 2011-02-21 16:22:11 cg Exp $'
  6309     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.247 2011-04-16 20:44:16 stefan Exp $'
  6311 ! !
  6310 ! !