ouch - sniplet is a type;
authorClaus Gittinger <cg@exept.de>
Thu, 05 Sep 2013 15:37:29 +0200
changeset 13500 0128772ce63d
parent 13499 a2c7d7c34d00
child 13501 4b0882beb9b2
ouch - sniplet is a type; but I wont rename the methods now...
WorkspaceApplication.st
--- a/WorkspaceApplication.st	Thu Sep 05 13:06:56 2013 +0200
+++ b/WorkspaceApplication.st	Thu Sep 05 15:37:29 2013 +0200
@@ -175,8 +175,8 @@
         name: manageSnipletsDialogSpec
         window: 
        (WindowSpec
-          label: 'Manage Sniplets'
-          name: 'Manage Sniplets'
+          label: 'Manage Snippets'
+          name: 'Manage Snippets'
           min: (Point 10 10)
           bounds: (Rectangle 0 0 379 590)
         )
@@ -184,7 +184,7 @@
        (SpecCollection
           collection: (
            (LabelSpec
-              label: 'Sniplet:'
+              label: 'Snippet:'
               name: 'Label1'
               layout: (LayoutFrame 0 0 0 0 0 1 30 0)
               translateLabel: true
@@ -729,19 +729,19 @@
           )
          (MenuItem
             enabled: hasSelectionInActiveWorkspace
-            label: 'Copy as Sniplet...'
+            label: 'Copy as Snippet...'
             itemValue: addSelectionToSniplets
             translateLabel: true
           )
          (MenuItem
             enabled: selectedWorkspaceIsTextView
-            label: 'Paste Sniplet...'
+            label: 'Paste Snippet...'
             itemValue: pasteSniplet
             translateLabel: true
           )
          (MenuItem
             enabled: selectedWorkspaceIsTextView
-            label: 'Manage Sniplets...'
+            label: 'Manage Snippets...'
             itemValue: manageSniplets
             translateLabel: true
           )
@@ -2609,61 +2609,61 @@
 manageSniplets
     |bindings listOfSniplets removeAction pasteAction
      hasSelectionHolder removeEnabledHolder pasteEnabledHolder
-     selectedSnipletHolder selectedSnipletsTextHolder selectedSnipletsName
-     snipletsDictionary saveEnabledHolder saveAction |
-
-    snipletsDictionary := Workspace sniplets.
-    snipletsDictionary isEmptyOrNil ifTrue:[
-        Dialog information:(resources string:'No Sniplets to Manage').
+     selectedSnippetHolder selectedSnippetsTextHolder selectedSnippetsName
+     snippetsDictionary saveEnabledHolder saveAction |
+
+    snippetsDictionary := Workspace sniplets.
+    snippetsDictionary isEmptyOrNil ifTrue:[
+        Dialog information:(resources string:'No Snippets to Manage').
         ^ self.
     ].
 
-    listOfSniplets := List withAll:(snipletsDictionary keysSorted).
-    selectedSnipletsTextHolder := '' asValue.
-
-    selectedSnipletHolder := nil asValue.
-    selectedSnipletHolder onChangeEvaluate:[
-        (selectedSnipletHolder value) isNil ifTrue:[
-            selectedSnipletsName := nil.
-            selectedSnipletsTextHolder value:''.
+    listOfSniplets := List withAll:(snippetsDictionary keysSorted).
+    selectedSnippetsTextHolder := '' asValue.
+
+    selectedSnippetHolder := nil asValue.
+    selectedSnippetHolder onChangeEvaluate:[
+        (selectedSnippetHolder value) isNil ifTrue:[
+            selectedSnippetsName := nil.
+            selectedSnippetsTextHolder value:''.
         ] ifFalse:[
-            selectedSnipletsName := listOfSniplets at:(selectedSnipletHolder value).
-            selectedSnipletsTextHolder value:(snipletsDictionary at:selectedSnipletsName).
+            selectedSnippetsName := listOfSniplets at:(selectedSnippetHolder value).
+            selectedSnippetsTextHolder value:(snippetsDictionary at:selectedSnippetsName).
         ].
     ].
 
-    hasSelectionHolder := BlockValue with:[:m | m value notNil] argument:selectedSnipletHolder.
+    hasSelectionHolder := BlockValue with:[:m | m value notNil] argument:selectedSnippetHolder.
     removeEnabledHolder := hasSelectionHolder.
     pasteEnabledHolder := hasSelectionHolder.
     saveEnabledHolder := BlockValue with:[:m :textHolder| 
         m value notNil
-            and:[(snipletsDictionary at:(listOfSniplets at:(selectedSnipletHolder value))) ~= textHolder value]
-    ] argument: selectedSnipletHolder argument: selectedSnipletsTextHolder.
+            and:[(snippetsDictionary at:(listOfSniplets at:(selectedSnippetHolder value))) ~= textHolder value]
+    ] argument: selectedSnippetHolder argument: selectedSnippetsTextHolder.
 
     removeAction := [
-        snipletsDictionary removeKey:selectedSnipletsName.
-        listOfSniplets remove:selectedSnipletsName.
+        snippetsDictionary removeKey:selectedSnippetsName.
+        listOfSniplets remove:selectedSnippetsName.
     ].
 
     pasteAction := [
         |text|
-        text := snipletsDictionary at:selectedSnipletsName.
+        text := snippetsDictionary at:selectedSnippetsName.
         self paste:text
     ].
     saveAction := [
         |originalText newText|
-        originalText := snipletsDictionary at:selectedSnipletsName.
-        newText := selectedSnipletsTextHolder value.
+        originalText := snippetsDictionary at:selectedSnippetsName.
+        newText := selectedSnippetsTextHolder value.
         originalText ~= newText ifTrue:[
-            snipletsDictionary at: selectedSnipletsName put: newText.
+            snippetsDictionary at: selectedSnippetsName put: newText.
         ].
         saveEnabledHolder recomputeValue.
     ].
 
     bindings := IdentityDictionary new.
     bindings at:#listOfSniplets put:listOfSniplets.
-    bindings at:#selectedSniplet put:selectedSnipletHolder asValue.
-    bindings at:#selectedSnipletsText put:selectedSnipletsTextHolder.
+    bindings at:#selectedSniplet put:selectedSnippetHolder asValue.
+    bindings at:#selectedSnipletsText put:selectedSnippetsTextHolder.
     bindings at:#removeSelectedSniplet put:removeAction.
     bindings at:#pasteSelectedSniplet put:pasteAction.
     bindings at:#saveSelectedSniplet put:saveAction.
@@ -2719,23 +2719,23 @@
 !
 
 pasteSniplet
-    |allSniplets snipletToPaste snipletsDictionary|
-
-    snipletsDictionary := Workspace sniplets.
-    snipletsDictionary isEmptyOrNil ifTrue:[
-        Dialog information:(resources string:'No Sniplets to Paste').
+    |allSnippets snippetToPaste snippetsDictionary|
+
+    snippetsDictionary := Workspace sniplets.
+    snippetsDictionary isEmptyOrNil ifTrue:[
+        Dialog information:(resources string:'No Snippet to Paste').
         ^ self.
     ].
-    allSniplets := snipletsDictionary keysSorted.
-
-    snipletToPaste := Dialog 
-                choose:(resources string:'Paste Sniplet:')
-                fromList:allSniplets
+    allSnippets := snippetsDictionary keysSorted.
+
+    snippetToPaste := Dialog 
+                choose:(resources string:'Paste Snippet:')
+                fromList:allSnippets
                 lines:10.
-    snipletToPaste isNil ifTrue:[
+    snippetToPaste isNil ifTrue:[
         ^ self
     ].
-    self paste:(snipletsDictionary at:snipletToPaste) withCRs.
+    self paste:(snippetsDictionary at:snippetToPaste) withCRs.
 
     "Modified: / 29-10-2010 / 10:21:29 / cg"
 !
@@ -3182,7 +3182,7 @@
 !
 
 addSelectionToSniplets
-    |selection snipletsBaseName snipletsName nr snipletsDictionary|
+    |selection snippetsBaseName snippetsName nr snippetsDictionary|
 
     selection := (self selectedWorkspacesTextView selection ? '') asString.
     selection isEmpty ifTrue:[
@@ -3190,26 +3190,26 @@
         ^ self
     ].
 
-    snipletsBaseName := Dialog request:(resources string:'Name of Sniplet:').
-    snipletsBaseName isNil ifTrue:[
+    snippetsBaseName := Dialog request:(resources string:'Name of Snippet:').
+    snippetsBaseName isNil ifTrue:[
         ^ self
     ].
-    snipletsBaseName isEmpty ifTrue:[
-        snipletsBaseName := Time now asString.
+    snippetsBaseName isEmpty ifTrue:[
+        snippetsBaseName := Time now asString.
     ].
-    snipletsDictionary := Workspace sniplets.
-
-    snipletsName := snipletsBaseName.
-    (snipletsDictionary includesKey:snipletsName) ifTrue:[
-        (Dialog confirm:(resources string:'Replace existing sniplet named "%1" ?' with:snipletsName))
+    snippetsDictionary := Workspace sniplets.
+
+    snippetsName := snippetsBaseName.
+    (snippetsDictionary includesKey:snippetsName) ifTrue:[
+        (Dialog confirm:(resources string:'Replace existing snippet named "%1" ?' with:snippetsName))
         ifFalse:[
-            [snipletsDictionary includesKey:snipletsName] whileTrue:[
+            [snippetsDictionary includesKey:snippetsName] whileTrue:[
                 nr := (nr ? 1) + 1.
-                snipletsName := (snipletsBaseName,'(%1)') bindWith:nr
+                snippetsName := (snippetsBaseName,'(%1)') bindWith:nr
             ].
         ]
     ].
-    snipletsDictionary at:snipletsName put:selection
+    snippetsDictionary at:snippetsName put:selection
 
     "Modified: / 24-11-2006 / 12:44:16 / cg"
 !
@@ -4028,14 +4028,14 @@
 !WorkspaceApplication class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.247 2013-08-31 17:19:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.248 2013-09-05 13:37:29 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.247 2013-08-31 17:19:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.248 2013-09-05 13:37:29 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: WorkspaceApplication.st,v 1.247 2013-08-31 17:19:15 cg Exp $'
+    ^ '$Id: WorkspaceApplication.st,v 1.248 2013-09-05 13:37:29 cg Exp $'
 ! !