DoWhatIMeanSupport.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Aug 2003 17:40:52 +0200
changeset 2560 cc5ba9cf02b8
parent 2559 f9f489baf23f
child 2661 f68913f2facf
permissions -rw-r--r--
insertion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2002 by eXept Software AG
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libwidg2' }"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Object subclass:#DoWhatIMeanSupport
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:''
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	category:'System-Support'
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
!DoWhatIMeanSupport class methodsFor:'documentation'!
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
copyright
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
 COPYRIGHT (c) 2002 by eXept Software AG
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
              All Rights Reserved
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 This software is furnished under a license and may be used
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 only in accordance with the terms of that license and with the
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 be provided or otherwise made available to, or used by, any
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 other person.  No title to or ownership of the software is
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 hereby transferred.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    misc collected UI support (functional)
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    [author:]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        Claus Gittinger (cg@exept.de)
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [instance variables:]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    [class variables:]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    [see also:]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
! !
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
!DoWhatIMeanSupport class methodsFor:'rename support'!
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName
2513
de7a2f5335c2 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
    58
    "generate a reasonable default for a rename operation.
de7a2f5335c2 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
    59
     (used for rename category etc.)"
2468
beeedb5f57f4 comment
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
    60
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
    61
    |prefix suffix lastNewSize lastOldSize left right inserted deleted|
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    lastNewName isNil ifTrue:[ ^ nil].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    lastNewSize := lastNewName size.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    lastOldSize := lastOldName size.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
    (lastNewName endsWith:lastOldName) ifTrue:[
2514
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    69
        "last rename was 
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    70
            'foo' -> 'Xfoo'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    71
         then, a good default for
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    72
            'bar' would be 'Xbar'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    73
        "
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
        prefix := lastNewName copyTo:(lastNewSize - lastOldSize).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
        ^ (prefix , oldName).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    (lastOldName endsWith:lastNewName) ifTrue:[
2514
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    78
        "last rename was 
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    79
            'Xfoo' -> 'foo'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    80
         then, a good default for
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    81
            'Xbar' would be 'bar'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    82
        "
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
        prefix := lastOldName copyTo:(lastOldSize - lastNewSize).
2514
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    84
        (oldName startsWith:prefix) ifTrue:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    85
            ^ (oldName copyFrom:prefix size+1).
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    86
        ]
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    87
    ].
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    88
    (lastOldName asLowercase = lastNewName asLowercase) ifTrue:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    89
        (lastOldName first ~= lastNewName first) ifTrue:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    90
            (lastOldName first isLowercase = oldName first isLowercase) ifTrue:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    91
                "last rename was 
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    92
                    'xfoo' -> 'Xfoo'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    93
                 then, a good default for
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    94
                    'xbar' would be 'Xbar'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    95
                "
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    96
                lastOldName first isLowercase ifTrue:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    97
                    ^ oldName first asUppercase asString , (oldName copyFrom:2).
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    98
                ] ifFalse:[
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
    99
                    ^ oldName first asLowercase asString , (oldName copyFrom:2).
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   100
                ]
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   101
            ]
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   102
        ].
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    (lastOldName withoutSeparators = lastNewName) ifTrue:[
2514
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   105
        "last rename was 
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   106
            '  foo   ' -> 'foo'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   107
         then, a good default for
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   108
            '  bar   ' would be 'bar'
4f8d8658289a comments
Claus Gittinger <cg@exept.de>
parents: 2513
diff changeset
   109
        "
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
        ^ oldName withoutSeparators.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    (lastNewName startsWith:lastOldName) ifTrue:[
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   113
        "last rename was 
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   114
            'foo' -> 'fooX'
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   115
         then, a good default for
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   116
            'bar' would be 'barX'
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   117
        "
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
        suffix := lastNewName copyLast:(lastNewSize - lastOldSize).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
        ^ (oldName , suffix).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    (lastOldName startsWith:lastNewName) ifTrue:[
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   122
        "last rename was 
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   123
            'fooX' -> 'foo'
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   124
         then, a good default for
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   125
            'barX' would be 'bar'
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   126
        "
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
        suffix := lastOldName copyLast:(lastOldSize - lastNewSize).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
        (oldName endsWith:suffix) ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
            ^ (oldName copyWithoutLast:suffix size).
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
        ]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ].
2558
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   132
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   133
    prefix := lastOldName commonPrefixWith:lastNewName.
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   134
    suffix := lastOldName commonSuffixWith:lastNewName.
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   135
2558
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   136
    (prefix size > 0) ifTrue:[
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   137
        (suffix size > 0) ifTrue:[
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   138
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   139
            prefix := prefix copyTo:(((lastNewName size - suffix size) min:(lastOldName size - suffix size)) min:prefix size).
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   140
2558
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   141
            "last rename was 
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   142
                'fooR' -> 'fooXR'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   143
             then, a good default for
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   144
                'barR' would be 'barXR'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   145
            "
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   146
            left := lastOldName copyTo:prefix size.
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   147
            right := lastOldName copyLast:suffix size.
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   148
            lastNewSize > lastOldSize ifTrue:[
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   149
                inserted := (lastNewName copyFrom:(left size + 1)) copyWithoutLast:(right size).
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   150
                inserted size > 0 ifTrue:[
2560
cc5ba9cf02b8 insertion
Claus Gittinger <cg@exept.de>
parents: 2559
diff changeset
   151
                    ^ (oldName copyTo:prefix size) , inserted , (oldName copyFrom:prefix size + 1) 
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   152
                ].
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   153
            ].
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   154
            (oldName endsWith:suffix) ifTrue:[
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   155
                deleted := (lastOldName copyFrom:(prefix size + 1)) copyWithoutLast:(suffix size).
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   156
                ((oldName copyFrom:oldName size-suffix size-deleted size + 1) copyTo:deleted size) = deleted ifTrue:[
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   157
                    "last rename was 
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   158
                        'fooXR' -> 'fooR'
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   159
                     then, a good default for
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   160
                        'barXS' would be 'barS'
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   161
                    "
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   162
                    ^ (oldName copyTo:oldName size-suffix size-deleted size) , suffix
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   163
                ]
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   164
            ]
2558
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   165
        ].
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   166
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   167
        (oldName endsWith:(lastOldName copyFrom:prefix size+1)) ifTrue:[
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   168
            "last rename was 
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   169
                'fooX' -> 'fooY'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   170
             then, a good default for
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   171
                'barX' would be 'barY'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   172
            "
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   173
            left := oldName copyWithoutLast:(lastOldName copyFrom:prefix size+1) size.
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   174
            right := lastNewName copyFrom:prefix size+1.
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   175
            ^ left , right
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   176
        ] 
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   177
    ].
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
2382
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   179
    ^ nil
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   180
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   181
    "
2558
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   182
     self goodRenameDefaultFor:'bar' lastOld:'foo' lastNew:'fooXX'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   183
     self goodRenameDefaultFor:'bar' lastOld:'foo' lastNew:'XXfoo'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   184
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   185
     self goodRenameDefaultFor:'barXX' lastOld:'fooXX' lastNew:'foo' 
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   186
     self goodRenameDefaultFor:'XXbar' lastOld:'XXfoo' lastNew:'foo'
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   187
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   188
     self goodRenameDefaultFor:'barXX' lastOld:'fooXX' lastNew:'fooYY' 
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   189
     self goodRenameDefaultFor:'XXbar' lastOld:'XXfoo' lastNew:'foo'  
81ef3253fd23 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2557
diff changeset
   190
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   191
     self goodRenameDefaultFor:'bar2' lastOld:'foo1' lastNew:'foo01'  
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   192
     self goodRenameDefaultFor:'barXY' lastOld:'fooXY' lastNew:'fooY'
2560
cc5ba9cf02b8 insertion
Claus Gittinger <cg@exept.de>
parents: 2559
diff changeset
   193
     self goodRenameDefaultFor:'bar' lastOld:'foo' lastNew:'fXoo'            
cc5ba9cf02b8 insertion
Claus Gittinger <cg@exept.de>
parents: 2559
diff changeset
   194
     self goodRenameDefaultFor:'bar' lastOld:'foo' lastNew:'fXXXoo'          
2559
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   195
     self goodRenameDefaultFor:'bar' lastOld:'foo' lastNew:'foXXXo'  
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   196
f9f489baf23f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2558
diff changeset
   197
     self goodRenameDefaultFor:'bar001' lastOld:'foo001' lastNew:'foo002_001'  
2560
cc5ba9cf02b8 insertion
Claus Gittinger <cg@exept.de>
parents: 2559
diff changeset
   198
     self goodRenameDefaultFor:'CoastCore-CSFoo' lastOld:'CoastCore-CSBar' lastNew:'Coast-Core-CSBar'  
2557
b1d8a61319d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2553
diff changeset
   199
    "
2382
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   200
!
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   201
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   202
goodRenameDefaultForFile:oldName lastOld:lastOldName lastNew:lastNewName
2513
de7a2f5335c2 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
   203
    "generate a reasonable default for a file rename operation.
de7a2f5335c2 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
   204
     (Try to rename multiple files in the new fileBrowser, 
de7a2f5335c2 comments
Claus Gittinger <cg@exept.de>
parents: 2468
diff changeset
   205
     to see what this is doing)"
2468
beeedb5f57f4 comment
Claus Gittinger <cg@exept.de>
parents: 2434
diff changeset
   206
2382
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   207
    |prefix suffix t
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   208
     lastOldWOSuffix lastNewWOSuffix oldWOSuffix lastOldRest oldRest lastNewRest
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   209
     lastRemoved lastInserted default|
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   210
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   211
    default := self goodRenameDefaultFor:oldName lastOld:lastOldName lastNew:lastNewName.
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   212
    default notNil ifTrue:[ ^ default].
d89d86edaae4 separated default for arbitrary renames and deault for files.
Claus Gittinger <cg@exept.de>
parents: 2376
diff changeset
   213
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    lastOldWOSuffix := lastOldName asFilename withoutSuffix name.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
    lastNewWOSuffix := lastNewName asFilename withoutSuffix name.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    oldWOSuffix := oldName asFilename withoutSuffix name.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
2434
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   218
    "/ suffix change ?
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   219
    lastOldWOSuffix = lastNewWOSuffix ifTrue:[
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   220
        lastOldName asFilename suffix ~= lastNewName asFilename suffix ifTrue:[
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   221
            ^ (oldName asFilename withSuffix:(lastNewName asFilename suffix)) pathName
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   222
        ].
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   223
    ].
e7758915432e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2382
diff changeset
   224
2553
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   225
    default := self goodRenameDefaultFor:oldWOSuffix lastOld:lastOldWOSuffix lastNew:lastNewWOSuffix.
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   226
    default notNil ifTrue:[ 
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   227
        lastOldRest := lastOldName copyFrom:lastOldWOSuffix size + 1.
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   228
        lastNewRest := lastNewName copyFrom:lastNewWOSuffix size + 1.
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   229
        oldRest := oldName copyFrom:oldWOSuffix size + 1.
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   230
        
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   231
        ^ default , lastNewRest
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   232
    ].
9925f0aca022 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2517
diff changeset
   233
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    prefix := lastOldWOSuffix commonPrefixWith:oldWOSuffix.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    (lastNewWOSuffix startsWith:prefix) ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
        lastOldRest := lastOldWOSuffix copyFrom:prefix size + 1.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
        lastNewRest := lastNewWOSuffix copyFrom:prefix size + 1.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
        oldRest := oldWOSuffix copyFrom:prefix size + 1.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
        (lastNewRest endsWith:lastOldRest) ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
            t := lastNewRest copyWithoutLast:lastOldRest size.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
            ^ ((prefix , t , oldRest) asFilename withSuffix:oldName asFilename suffix) name
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
        ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    suffix := lastOldWOSuffix commonSuffixWith:lastNewWOSuffix.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    suffix size > 0 ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
        "/ last change changed something at the beginning
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
        prefix := oldWOSuffix commonPrefixWith:lastOldWOSuffix.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
        prefix size > 0 ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
            "/ this name starts with the same characters
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
            lastRemoved := lastOldWOSuffix copyWithoutLast:suffix size.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
            lastInserted := lastNewWOSuffix copyWithoutLast:suffix size.
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
            (lastRemoved startsWith:lastInserted) ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
                oldWOSuffix size >= lastInserted size ifTrue:[
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
                    ^ (oldWOSuffix copyTo:lastInserted size) , (oldName copyFrom:lastRemoved size + 1)
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
                ]
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
            ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
            ^ lastInserted , (oldName copyFrom:lastRemoved size + 1)
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
        ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    ].
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    ^ nil
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
! !
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   266
!DoWhatIMeanSupport class methodsFor:'typing distance'!
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   267
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   268
isKey:k1 nextTo:k2
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   269
    "return true, if k1 and k2 are adjacent keys on the keybaord.
2516
9f022f76308d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   270
     CAVEAT: hard coded us-keyboard here."
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   271
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   272
    |keys|
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   273
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   274
    "/ for now: hardcoded US keyboard (should be language dependent)
2516
9f022f76308d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   275
    "/ (i.e. ask userPreferences ...)
9f022f76308d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2515
diff changeset
   276
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   277
    keys := #( 
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   278
               '1234567890-'
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   279
               '*qwertyuiop'
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   280
               '**asdfghjkl:'
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   281
               '***zxcvbnm' ).
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   282
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   283
    ^ self isKey:k1 nextTo:k2 onKeyboard:keys
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   284
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   285
    "
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   286
     self isKey:$a nextTo:$a 
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   287
     self isKey:$a nextTo:$s 
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   288
     self isKey:$a nextTo:$s 
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   289
     self isKey:$a nextTo:$q 
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   290
     self isKey:$a nextTo:$w 
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   291
     self isKey:$a nextTo:$z 
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   292
     self isKey:$a nextTo:$x 
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   293
    "
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   294
!
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   295
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   296
isKey:k1 nextTo:k2 onKeyboard:keys
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   297
    "return true, if k1 and k2 are adjacent keys on the keybaord.
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   298
     CAVEAT: hard coded us-keyboard here"
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   299
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   300
    |row1 row2 col1 col2|
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   301
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   302
    row1 := keys findFirst:[:row | row includes:k1].
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   303
    row1 == 0 ifTrue:[^ false].
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   304
    row2 := keys findFirst:[:row | row includes:k2].
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   305
    row2 == 0 ifTrue:[^ false].
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   306
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   307
    (row1-row2) abs <= 1 ifFalse:[^ false].
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   308
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   309
    col1 := (keys at:row1) indexOf:k1.
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   310
    col2 := (keys at:row2) indexOf:k2.
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   311
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   312
    ^ (col1-col2) abs <= 1
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   313
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   314
    "
2517
a5323c17b767 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2516
diff changeset
   315
     self isKey:$a nextTo:$x
2515
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   316
    "
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   317
! !
69cbb89c127e +isKey:nextTo: for simple typo detection
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
   318
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
!DoWhatIMeanSupport class methodsFor:'documentation'!
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
version
2560
cc5ba9cf02b8 insertion
Claus Gittinger <cg@exept.de>
parents: 2559
diff changeset
   322
    ^ '$Header: /cvs/stx/stx/libwidg2/DoWhatIMeanSupport.st,v 1.14 2003-08-28 15:40:52 cg Exp $'
2376
41e0228c4c58 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
! !