FileApplicationNoteBook.st
changeset 10922 ad955bd3b4b1
parent 10761 64a7f27deb22
child 10955 7d8ae8e205b9
--- a/FileApplicationNoteBook.st	Tue Nov 29 15:05:57 2011 +0100
+++ b/FileApplicationNoteBook.st	Tue Nov 29 20:19:48 2011 +0100
@@ -335,11 +335,13 @@
 !FileApplicationNoteBook methodsFor:'accessing-applications'!
 
 getAllApplicationsByClass:aClass andType:aType
-
-    ^ self listOfApplications select:[ : appl  |
-        ((appl class = aClass)
-        "and:[appl type = aType]")
-    ].
+    ^ self listOfApplications 
+        select:[ : appl  | 
+            ((appl class = aClass)
+            "and:[appl type = aType]")
+        ].
+
+    "Modified (format): / 29-11-2011 / 19:08:20 / cg"
 !
 
 getApplicationByType:aType
@@ -550,13 +552,15 @@
     ^ self openApplicationClass:aClass withItem:anItem withType:aType checkExisting:true
 !
 
-openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting
-
-    ^ self  openApplicationClass:aClass 
-            withItem:anItem 
-            withType:aType 
-            checkExisting:checkExisting 
-            preSetItem:nil
+openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting 
+    ^ self 
+        openApplicationClass:aClass
+        withItem:anItem
+        withType:aType
+        checkExisting:checkExisting
+        preSetItem:nil
+
+    "Modified (format): / 29-11-2011 / 19:06:27 / cg"
 !
 
 openApplicationClass:aClass withItem:anItem withType:aType checkExisting:checkExisting preSetItem:aBlock
@@ -574,6 +578,7 @@
             ^ existingAppl
         ].
     ].
+
     newAppl := aClass new.
     newAppl masterApplication:self.
     aBlock notNil ifTrue:[
@@ -593,6 +598,8 @@
     self setSameFileIndexFor:newAppl.
     self startApplication:newAppl.
     ^ newAppl
+
+    "Modified (format): / 29-11-2011 / 19:06:47 / cg"
 !
 
 openDefaultApplicationByItem:anItem
@@ -686,8 +693,6 @@
 !
 
 tryToGetExistingApplFor:aClass withItem:anItem withType:aType preSetItem:aBlock
-
-
     | sameAppls changeAppl selAppl|
 
     aClass wantNewApplicationAnyway ifTrue:[^ nil].
@@ -703,15 +708,11 @@
                 ^ nil
             ] ifFalse:[
                 "/ if item already changed select the application
-                selAppl := sameAppls detect:[ : appl  | 
-                        (appl item = anItem) 
-                ] ifNone:[nil].
+                selAppl := sameAppls detect:[:appl | (appl item = anItem) ] ifNone:[nil].
             ].
         ] ifFalse:[
             "/ keep in same application change the first application of the same class and type - if item not changed otherwise open new
-            sameAppls := sameAppls select:[ : appl  | 
-                (appl isModified not)
-            ].
+            sameAppls := sameAppls select:[:appl | appl isModified not ].
         ].
     ].
     sameAppls size ~~ 0 ifTrue:[
@@ -720,6 +721,7 @@
           third the first
         "
         | nilItemAppls |
+
         nilItemAppls := sameAppls select:[:appl| appl item == nil ].
         nilItemAppls notEmpty ifTrue:[sameAppls := nilItemAppls].
         (sameAppls includes:self selectedApplication) ifTrue:[
@@ -735,6 +737,8 @@
         selAppl := changeAppl.
     ].
     ^ selAppl.
+
+    "Modified (format): / 29-11-2011 / 19:07:57 / cg"
 ! !
 
 !FileApplicationNoteBook methodsFor:'actions-app-spec'!
@@ -769,19 +773,30 @@
     ].
 !
 
+doAddArchiverOn:aFilename
+    |item|
+
+    item := DirectoryContentsBrowser itemClass fileName:aFilename.
+    self openArchiveViewApplication:item.
+
+    "Created: / 29-11-2011 / 19:05:49 / cg"
+!
+
 newTextEditor
 
     ^ self openApplicationClass:TextEditor withItem:nil withType:#file checkExisting:false 
 !
 
 openArchiveViewApplication:anItem
-
     | result |
+
     result := self openApplicationClass:ArchiveViewApplication withItem:anItem withType:nil.
     result isNil ifTrue:[
         Dialog warn:'file type of ', anItem fileName baseName, ' not yet supported'.
         ^ self.
     ].
+
+    "Modified (format): / 29-11-2011 / 18:57:21 / cg"
 !
 
 openCommandResultApplication
@@ -1556,13 +1571,15 @@
     suffix := anItem fileName suffix asLowercase.
     ( #('c' 'h' 'bat' 'sh') includes:suffix) ifTrue:[^ false].
 
+    ( #('xlsx' 'ets') includes:suffix) ifTrue:[^ true].
+
     mimeType := anItem mimeType.
     ( #('application/x-make') includes:mimeType) ifTrue:[^ false].
 
     Archiver isNil ifTrue:[^ false].
     ^ (Archiver classForMimeType:mimeType fileName:anItem fileName) notNil
 
-    "Modified: / 16-09-2011 / 16:17:46 / cg"
+    "Modified: / 29-11-2011 / 18:59:35 / cg"
 !
 
 wantNewApplicationAnyway
@@ -1812,8 +1829,6 @@
 !
 
 copyFilesToClipboard
-
-
     |sel list stream|
 
     sel := self selectionHolder value.
@@ -1827,6 +1842,8 @@
         self window setClipboardText:stream contents.
         stream close.
     ].
+
+    "Modified (format): / 29-11-2011 / 18:57:40 / cg"
 !
 
 dblClick
@@ -1835,14 +1852,16 @@
 !
 
 doStopProcess
-
     | archiver |
+
     self stopProcess.
     archiver := self archiver.
     archiver notNil ifTrue:[
         self archiver stopProcess.
     ].
     self enableStopButton value:false.
+
+    "Modified (format): / 29-11-2011 / 18:57:50 / cg"
 !
 
 removeErrorOutput
@@ -2260,7 +2279,6 @@
 !
 
 extractSelectionTo:aDirectory askForExtractOptions:askForExtractOptionsBoolean
-
     |  sel index extractWithDirectoryPart extractAllFilesInSelectedDirectories extractFiles|
 
     extractWithDirectoryPart := true.
@@ -2291,10 +2309,11 @@
         self extractWithOutDirectoryPartTo:aDirectory with:extractFiles.
     ].
     ^ true
+
+    "Modified (format): / 29-11-2011 / 18:57:54 / cg"
 !
 
 extractWithDirectoryPartTo:aDirectory with:extractFiles
-
     self archiver 
         outStream:nil 
         errorStream:(self getErrorStream) 
@@ -2303,10 +2322,11 @@
         makeProcessFor:[ self archiver extractFiles:extractFiles to:aDirectory ] 
         with:('Extracting files to %1' bindWith:aDirectory asString).
     ^ true.
+
+    "Modified (format): / 29-11-2011 / 18:57:58 / cg"
 !
 
 extractWithOutDirectoryPartTo:aDirectory with:extractFiles
-
     self archiver 
         outStream:nil 
         errorStream:(self getErrorStream) 
@@ -2319,6 +2339,8 @@
         ] 
         with:('Extracting files to %1' bindWith:aDirectory asString).
     ^ true.
+
+    "Modified (format): / 29-11-2011 / 18:58:01 / cg"
 ! !
 
 !FileApplicationNoteBook::ArchiveViewApplication methodsFor:'commands list'!
@@ -6567,9 +6589,9 @@
 !FileApplicationNoteBook class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.258 2011-10-06 10:47:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.259 2011-11-29 19:19:48 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.258 2011-10-06 10:47:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FileApplicationNoteBook.st,v 1.259 2011-11-29 19:19:48 cg Exp $'
 ! !