FileApplicationNoteBook.st
changeset 4375 05dd38dadc66
parent 4360 959719f86629
child 4392 feb0bffd27b8
equal deleted inserted replaced
4374:085d4a95c004 4375:05dd38dadc66
   351         self listOfApplications removeIndex:applIndex.
   351         self listOfApplications removeIndex:applIndex.
   352         self privateTabList removeIndex:applIndex.
   352         self privateTabList removeIndex:applIndex.
   353         self privateTabList isEmpty ifTrue:[
   353         self privateTabList isEmpty ifTrue:[
   354             self viewNoteBookApplicationHolder value:false.
   354             self viewNoteBookApplicationHolder value:false.
   355             self enableViewNoteBookApplication value:false.
   355             self enableViewNoteBookApplication value:false.
       
   356             self changeFileBrowserTitleTo:'FileBrowser V2'.
       
   357 
   356         ] ifFalse:[
   358         ] ifFalse:[
   357             historyList notEmpty ifTrue:[
   359             historyList notEmpty ifTrue:[
   358                 self selectedEditorPage value:(self selectionHistoryList last).
   360                 self selectedEditorPage value:(self selectionHistoryList last).
   359             ]
   361             ]
   360         ]
   362         ]
   399         itemClass := self class classFor:aApplItem.
   401         itemClass := self class classFor:aApplItem.
   400         (itemClass canOpenItem:aItem).
   402         (itemClass canOpenItem:aItem).
   401     ] ifNone:[nil].
   403     ] ifNone:[nil].
   402     applItem isNil ifTrue:[ ^ self openDefaultApplicationByItem:aItem].
   404     applItem isNil ifTrue:[ ^ self openDefaultApplicationByItem:aItem].
   403     applItem notNil ifTrue:[
   405     applItem notNil ifTrue:[
   404         |  itemType |
   406         |  itemType appl|
   405         itemType := self class typeFor:applItem.
   407         itemType := self class typeFor:applItem.
   406         itemClass := self class classFor:applItem.
   408         itemClass := self class classFor:applItem.
   407         (self openApplicationClass:itemClass withItem:aItem withType:itemType) isNil ifTrue:[
   409         appl := self openApplicationClass:itemClass withItem:aItem withType:itemType.
   408             ^ self openDefaultApplicationByItem:aItem.            
   410         appl notNil ifTrue:[ ^ appl].
   409         ].
   411         ^ self openDefaultApplicationByItem:aItem.            
   410     ].
   412     ].
   411 !
   413 !
   412 
   414 
   413 openApplicationClass:aClass withItem:aItem withType:aType
   415 openApplicationClass:aClass withItem:aItem withType:aType
   414 
   416 
  1362     "set the value of the instance variable 'item' (automatically generated)"
  1364     "set the value of the instance variable 'item' (automatically generated)"
  1363 
  1365 
  1364     | classSelector|
  1366     | classSelector|
  1365     
  1367     
  1366     super item:aItem.
  1368     super item:aItem.
       
  1369     self removeErrorOutput.
  1367     classSelector := self class classSelectorFor:aItem.
  1370     classSelector := self class classSelectorFor:aItem.
  1368     (classSelector notNil and:[(Archiver respondsTo:classSelector) notNil]) ifTrue:[
  1371     (classSelector notNil and:[(Archiver respondsTo:classSelector) notNil]) ifTrue:[
  1369         self makeProcessFor:[
  1372         self makeProcessFor:[
  1370             self archiver:((Archiver perform:classSelector) with:(self fileName)).
  1373             self archiver:((Archiver perform:classSelector) with:(self fileName)).
  1371             self setColumnsForArchiver.
  1374             self setColumnsForArchiver.
  1636             archiverColumns do:[:colDescr |
  1639             archiverColumns do:[:colDescr |
  1637                 | itemStream |
  1640                 | itemStream |
  1638                 itemWordCount := colDescr second.
  1641                 itemWordCount := colDescr second.
  1639                 itemWriter := ((colDescr first) asString, ':') asSymbol.
  1642                 itemWriter := ((colDescr first) asString, ':') asSymbol.
  1640                 itemStream := WriteStream on:''.
  1643                 itemStream := WriteStream on:''.
  1641                 index to:(index + itemWordCount - 1) do:[:i|
  1644                 itemWordCount == #rest ifTrue:[
  1642                     itemStream nextPutAll:(words at:i).
  1645                     index to:(words size) do:[:i|
  1643                     itemStream space.
  1646                         itemStream nextPutAll:(words at:i).
       
  1647                         itemStream space.
       
  1648                     ].
       
  1649                 ] ifFalse:[
       
  1650                     index to:(index + itemWordCount - 1) do:[:i|
       
  1651                         itemStream nextPutAll:(words at:i).
       
  1652                         itemStream space.
       
  1653                     ].
       
  1654                     index := index + itemWordCount.
  1644                 ].
  1655                 ].
  1645                 item perform:itemWriter with:(itemStream contents).
  1656                 item perform:itemWriter with:(itemStream contents).
  1646                 itemStream close.
  1657                 itemStream close.
  1647                 index := index + itemWordCount.
       
  1648             ].
  1658             ].
  1649             ((archiverColumns collect:[:el| el first]) includes:#permissions) ifTrue:[
  1659             ((archiverColumns collect:[:el| el first]) includes:#permissions) ifTrue:[
  1650                 (item permissions startsWith:$d) ifTrue:[
  1660                 (item permissions startsWith:$d) ifTrue:[
  1651                     key := #directory.
  1661                     key := #directory.
  1652                     item isDirectory:true.
  1662                     item isDirectory:true.
  4712 ! !
  4722 ! !
  4713 
  4723 
  4714 !FileApplicationNoteBook class methodsFor:'documentation'!
  4724 !FileApplicationNoteBook class methodsFor:'documentation'!
  4715 
  4725 
  4716 version
  4726 version
  4717     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.41 2002-12-10 11:03:59 cg Exp $'
  4727     ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.42 2002-12-13 11:22:14 penk Exp $'
  4718 ! !
  4728 ! !