BookmarksEditDialog.st
changeset 8262 69dabd2e594a
parent 8023 7fd192f7449e
child 8662 a117da640cb7
--- a/BookmarksEditDialog.st	Thu Sep 04 10:04:39 2008 +0200
+++ b/BookmarksEditDialog.st	Thu Sep 04 10:04:56 2008 +0200
@@ -8,6 +8,22 @@
 !
 
 
+!BookmarksEditDialog class methodsFor:'help specs'!
+
+flyByHelpSpec
+    <resource: #help>
+
+    ^ super flyByHelpSpec addPairsFrom:#(
+
+#moveUp
+'Move Up'
+
+#moveDown
+'Move Down'
+
+).
+! !
+
 !BookmarksEditDialog class methodsFor:'image specs'!
 
 fileIn22x22Icon
@@ -26,19 +42,71 @@
     <resource: #image>
 
     ^Icon
-        constantNamed:'BookmarksDialog class fileIn22x22Icon'
+        constantNamed:'BookmarksEditDialog class fileIn22x22Icon'
         ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
-@@@@@@@@GQ4]GQ4]GQ4]GQ4]GQ4]GP@@@@@@@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]GQ4]GQ4]GQ4]GQ4]@ATUEQTUEQTUEA4]GQ4]GQ4]GQ4]GP@U
-GQ4]DPP''I!!TTGQ4]GQ4]GQ4]GQ4@EQ4]GP$K@"XUG!!P]GQ4]GQ4]GQ4]@AT]GQ4IDPX&EAPTEA4]GQ4]GQ4]GP@UGQ4]C1DEI!!<)HQP]@A4]GQ4]GQ4@EQ4]
-GQLIFQ,)JQ\TGP@@GQ4]GQ4]@AT]GQ4]BRH)JR$)JR$)JR$)GQ4]GP@UGQ4SDPP)JR$)JR$)JR$)JQ4]GQ4@EQ4SC1 )JR$)JR$)JR$)JR$@@A4]@AT]GQDZ
-F2$)JR$)JR$)JR$)GP@]GQ4UGP<LAPX&JR$)JR$)JR$)JP@@GQ4]EQ4@H TFI 8)JPDTGP@@GQ4]GQ4]GQT]ABHEF!!,NJB$AEA4@@A4]GQ4]GQ4UGRHYF XB
-C!!<J@QP]GQ4]GQ4]GQ4]EP$"H TFI 8(B DTGQ4]GQ4]GQ4]@APTEAPTEAPTEAPTEA4]GQ4]GQ4]GP@@@@@@@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]
-GQ4]GQ4]GQ4]GQ4]@@@@@@@@@@@@@@@@@A4]GQ4]GQ4]GP@a') ; colorMapFromArray:#[250 250 255 225 225 237 236 236 244 213 213 228 245 245 252 241 241 248 239 239 246 216 216 230 210 210 224 252 252 255 229 229 239 248 248 254 244 244 250 219 219 232 234 234 243 253 253 255 232 232 241 249 249 254 224 224 236 254 254 255 156 156 182 208 208 223 206 206 221 204 204 219 246 246 253 242 242 249 240 240 247 238 238 245 215 215 229 255 255 255 211 211 225 230 230 240 228 228 238 201 201 218 243 243 249 222 222 235 220 220 233 218 218 231 235 235 244 233 233 242 231 231 240 248 0 0]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@_<@@_>@@_?@@_? @_? @_? @_??@_??@_??@_??@_??@_? @_? @_? @_? @_? @@@@@@@@@@@@@') ; yourself); yourself]
+GQ4]GQ4]GQ4]GQ4]GQ4]GP@@@@@@@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]GQ4]GQ4]GQ4]GQ4]@@@@@@@@GQ4]GQ4]GQ4]GQ4]EATUEQTUEQTU@A4]
+GQ4]GQ4]GQ4]EAT&I0PQGQ4]EP@]GQ4]GQ4]GQ4]EA8UI HKBQ4]GQT@GQ4]GQ4]GQ4]EAPTEBXFDP$]GQ4U@A4]GQ4]GQ4@GQP!!JQ<&AQDOGQ4]EP@]GQ4]
+GQ4@@A4TE2$)F1$ID14]GQT@GQ4]GR$)JR$)JR$)JR$"BQ4]GQ4U@A4]GQ4)JR$)JR$)JR$)JPPQD14]EP@]GP@@JR$)JR$)JR$)JR$)F@<SGQT@GQ4@GR$)
+JR$)JR$)JR$)F1(QGQ4U@A4]@@@)JR$)JR$)JR$)I XEC@<]EQ4]GQ4]GQ4@@A4T@R$)C"XFARH@GQT]GQ4]GQ4]@@@]E@D)J@8[F T"AA4UGQ4]GQ4]GQ4]
+GQPAB!!<N@ XZFRH]EQ4]GQ4]GQ4]GQ4T@P((C"XFARH"BQT]GQ4]GQ4]GQ4]EAPTEAPTEAPTEAPT@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]GQ4]GQ4]
+GQ4]GQ4]@@@@@@@@GQ4]GQ4]GQ4]@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[250 250 255 225 225 237 236 236 244 213 213 228 245 245 252 241 241 248 239 239 246 216 216 230 210 210 224 252 252 255 229 229 239 248 248 254 244 244 250 219 219 232 234 234 243 253 253 255 232 232 241 249 249 254 224 224 236 254 254 255 156 156 182 208 208 223 206 206 221 204 204 219 246 246 253 242 242 249 240 240 247 238 238 245 215 215 229 255 255 255 211 211 225 230 230 240 228 228 238 201 201 218 243 243 249 222 222 235 220 220 233 218 218 231 235 235 244 233 233 242 231 231 240 248 0 0]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@?8@A?8@C?8@G?8@G?8@G?8C??8C??8C??8C??8C??8@G?8@G?8@G?8@G?8@G?8@@@@@@@@@@@@') ; yourself); yourself]
+!
+
+fileOut22x22Icon
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self fileOut22x22Icon inspect
+     ImageEditor openOnClass:self andSelector:#fileOut22x22Icon
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'BookmarksEditDialog class fileOut22x22Icon'
+        ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+GQ4]GQ4]GQ4]GQ4]GQ4]GP@@@@@@@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]GQ4]GQ4]GQ4]GQ4]@@@@@@@@GQ4]GQ4]GQ4]GQ4]EATUEQTUEQTU@A4]
+GQ4]GQ4]GQ4]EAT&I0PQGQ4]EP@]GQ4]GQ4]GQ4]EA8UI HKBQ4]GQT@GQ4]GQ4]GQ4]EAPTEBXFDP$]GQ4U@A4]GQ4]GQ4@GQP!!JQ<&AQDOGQ4]EP@]GQ4]
+GQ4@@A4TE2$)F1$ID14]GQT@GQ4]GR$)JR$)JR$)JR$"BQ4]GQ4U@A4]GQ4)JR$)JR$)JR$)JPPQD14]EP@]GP@@JR$)JR$)JR$)JR$)F@<SGQT@GQ4@GR$)
+JR$)JR$)JR$)F1(QGQ4U@A4]@@@)JR$)JR$)JR$)I XEC@<]EQ4]GQ4]GQ4@@A4T@R$)C"XFARH@GQT]GQ4]GQ4]@@@]E@D)J@8[F T"AA4UGQ4]GQ4]GQ4]
+GQPAB!!<N@ XZFRH]EQ4]GQ4]GQ4]GQ4T@P((C"XFARH"BQT]GQ4]GQ4]GQ4]EAPTEAPTEAPTEAPT@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4]GQ4]GQ4]
+GQ4]GQ4]@@@@@@@@GQ4]GQ4]GQ4]@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[250 250 255 225 225 237 236 236 244 213 213 228 245 245 252 241 241 248 239 239 246 216 216 230 210 210 224 252 252 255 229 229 239 248 248 254 244 244 250 219 219 232 234 234 243 253 253 255 232 232 241 249 249 254 224 224 236 254 254 255 156 156 182 208 208 223 206 206 221 204 204 219 246 246 253 242 242 249 240 240 247 238 238 245 215 215 229 255 255 255 211 211 225 230 230 240 228 228 238 201 201 218 243 243 249 222 222 235 220 220 233 218 218 231 235 235 244 233 233 242 231 231 240 248 0 0]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@@@@@@@?8@A?8@C?8@G?8@G?8@G?8C??8C??8C??8C??8C??8@G?8@G?8@G?8@G?8@G?8@@@@@@@@@@@@') ; yourself); yourself]
 !
 
 icon
 
     ^ ToolbarIconLibrary directoryBookmarksIcon
+!
+
+sort22x22Icon
+    "This resource specification was automatically generated
+     by the ImageEditor of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the ImageEditor may not be able to read the specification."
+
+    "
+     self sort22x22Icon inspect
+     ImageEditor openOnClass:self andSelector:#sort22x22Icon
+     Icon flushCachedIcons
+    "
+
+    <resource: #image>
+
+    ^Icon
+        constantNamed:'BookmarksEditDialog class sort22x22Icon'
+        ifAbsentPut:[(Depth8Image new) width: 22; height: 22; photometric:(#palette); bitsPerSample:(#[8]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'
+GQ4]GQ4]GQ4]GQ4]GQ4]GP@@@@@@@A4]GQ4]GQ4]GQ4]GQ4]GQ4@@@@@@@@]GQ4*J"(*GQ4TEQTUEQTUEQTUEQT@GQ4*GQ4]J!!4]EATUEQTUEQTUEQTU@A4]
+J!!4]GR(]GQP&I"X&I0PQGQ4]EP@]GR(]GQ4*GQ4TI"(*I HKBQ4]GQT@GQ4]J"(*J"(]EBX&I"XFDP$]GQ4U@A4]GQ4]GP@@GQPAJ"(*AQDOGQ4]EP@]GQ4]
+J @@@@@T@PTEF1$ID14]GQT@GQ4]GR()JR$)E@D*J"(*BQ4]GQ4U@A4]@@@*JR$)JQPAAPTEAPPQD14]EP@]GP@]J"$)JR$T@R(*J"(*F@<SGQT@GQ4*J"(*
+J"$)E@DEAPTEF1(QGQ4UGQ4]GR(*J @@GQPAJ"(*J"(*C@<]EQ4]GQ4]J!!4@@A4T@PTEC"XFARH@GQT]GQ4]GQ4]GQ4]E@D*J"(*J"(*AA4UGQ4]J"(*J"(]
+GQPAB!!<N@ XZFRH]EQ4]GQ4]GR(@GQ4T@R(*J"(*J"(*GQT@GQ4]GR(@GQ4]E@DJJ@8&A T"H $U@A4]@B(]GQ4]GQPTEAPTEAPTEAPTE@@]GR(*J"(*GQ4]
+GQ4]GQ4]@@@@@@@@GQ4@@@@@@@@]@@@@@@@@@@@@@@@@@@@a') ; colorMapFromArray:#[250 250 255 225 225 237 236 236 244 213 213 228 245 245 252 241 241 248 239 239 246 216 216 230 210 210 224 252 252 255 229 229 239 248 248 254 244 244 250 219 219 232 234 234 243 253 253 255 232 232 241 249 249 254 224 224 236 254 254 255 156 156 182 208 208 223 206 206 221 204 204 219 246 246 253 242 242 249 240 240 247 238 238 245 215 215 229 255 255 255 211 211 225 230 230 240 228 228 238 201 201 218 243 243 249 222 222 235 220 220 233 218 218 231 235 235 244 233 233 242 231 231 240 248 0 0 0 0 0]; mask:((ImageMask new) width: 22; height: 22; photometric:(#blackIs0); bitsPerSample:(#[1]); samplesPerPixel:(1); bits:(ByteArray fromPackedString:'@@@@@@@@G @@H''?8H''?8H''?8G7?8@G?8BG?8BG?8BG?8BG?8O''?8GG?8BG?8@G?8O''?8AG?8BG?8DG?8O @@@@@@') ; yourself); yourself]
 ! !
 
 !BookmarksEditDialog class methodsFor:'interface specs'!
@@ -157,6 +225,7 @@
             label: '-'
           )
          (MenuItem
+            activeHelpKey: moveUp
             enabled: upButtonEnabledHolder
             label: 'Up'
             itemValue: up
@@ -164,6 +233,7 @@
             labelImage: (ResourceRetriever XPToolbarIconLibrary up22x22Icon)
           )
          (MenuItem
+            activeHelpKey: moveDown
             enabled: downButtonEnabledHolder
             label: 'Down'
             itemValue: down
@@ -174,16 +244,26 @@
             label: '-'
           )
          (MenuItem
+            enabled: sortButtonEnabledHolder
+            label: 'Sort'
+            itemValue: sort
+            translateLabel: true
+            labelImage: (ResourceRetriever BookmarksEditDialog sort22x22Icon)
+          )
+         (MenuItem
+            label: '-'
+          )
+         (MenuItem
             label: 'Import'
             itemValue: import
             translateLabel: true
-            labelImage: (ResourceRetriever BookmarksEditDialog fileIn22x22Icon)
+            labelImage: (ResourceRetriever XPToolbarIconLibrary fileIn22x22Icon)
           )
          (MenuItem
             label: 'Export'
             itemValue: export
             translateLabel: true
-            labelImage: (ResourceRetriever XPToolbarIconLibrary fileIn22x22Icon)
+            labelImage: (ResourceRetriever BookmarksEditDialog fileOut22x22Icon)
           )
          )
         nil
@@ -228,6 +308,7 @@
 bookmarkList: bookmarkStrings
 
     self bookmarkList contents: bookmarkStrings.
+    self sortButtonEnabledHolder value:(bookmarkStrings size > 0).
 !
 
 defaultBookmark
@@ -313,6 +394,11 @@
     ^ selectedBookmarksHolder.
 !
 
+sortButtonEnabledHolder
+
+    ^ builder valueAspectFor:#'sortButtonEnabledHolder' initialValue:false
+!
+
 upButtonEnabledHolder
 
     ^ builder valueAspectFor:#'upButtonEnabledHolder' initialValue:false
@@ -347,7 +433,7 @@
     | filename bookmarks |
 
     filename := Dialog 
-        requestFileName:'Select file to export bookmarks:' 
+        requestFileName:(resources string:'Select file to export bookmarks:') 
         default:'.fileBrowserBookmarks'
         fromDirectory:Filename desktopDirectory. 
     filename isEmptyOrNil ifTrue:[^ self].
@@ -357,11 +443,10 @@
 !
 
 import
-
     | answer filename bookmarksFromFile bookmarksToAdd bookmarks|
 
     answer := Dialog 
-        requestFileName:'Select file to import bookmarks:' 
+        requestFileName:(resources string:'Select file to import bookmarks:') 
         default:'.fileBrowserBookmarks'
         fromDirectory:Filename desktopDirectory.
 
@@ -373,6 +458,8 @@
     bookmarks := self bookmarkList.
     bookmarksToAdd := bookmarksFromFile reject:[:each | bookmarks includes: each].
     bookmarks addAll: bookmarksToAdd.
+
+    self sortButtonEnabledHolder value:(bookmarks size > 0).
 !
 
 new
@@ -409,6 +496,10 @@
     self bookmarkList removeAll: someBookmarks.
 !
 
+sort
+    self bookmarkList sort.
+!
+
 up
 
     | someBookmarks bookmarkToMove index |
@@ -456,7 +547,6 @@
 !
 
 selectedBookmarksChanged
-
     | someBookmarks selectedBookmarkIndex |
 
     someBookmarks := self selectedBookmarks.
@@ -485,5 +575,5 @@
 !BookmarksEditDialog class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/BookmarksEditDialog.st,v 1.2 2008-03-12 16:50:33 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/BookmarksEditDialog.st,v 1.3 2008-09-04 08:04:56 cg Exp $'
 ! !