CustomRefactoryBuilder.st
author Jakub Nesveda <jakubnesveda@seznam.cz>
Wed, 20 Aug 2014 00:12:32 +0200
changeset 629 e85070e8c11b
child 632 7a0f27afd9e0
permissions -rw-r--r--
add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext move builder access to CustomCodeGenerator superclass add CustomRefactoryBuilder for making refactory changes (code replace...)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     1
"{ Package: 'jn:refactoring_custom' }"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     2
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     3
RefactoryBuilder subclass:#CustomRefactoryBuilder
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     4
	instanceVariableNames:'changeManager'
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     5
	classVariableNames:''
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     6
	poolDictionaries:''
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     7
	category:'Interface-Refactoring-Custom'
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     8
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
     9
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    10
!CustomRefactoryBuilder class methodsFor:'documentation'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    11
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    12
documentation
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    13
"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    14
    Encapsulates performing refactoring changes on the source code within single object. 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    15
    Single refactorings are stored as change objects which represens changes in the source code.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    16
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    17
    [author:]
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    18
        Jakub Nesveda <nesvejak@fit.cvut.cz> 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    19
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    20
"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    21
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    22
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    23
!CustomRefactoryBuilder methodsFor:'accessing'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    24
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    25
change
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    26
    "Returns single code change from collected code changes."
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    27
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    28
    | change |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    29
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    30
    changes isEmpty ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    31
        ^ nil
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    32
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    33
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    34
    change := CompositeRefactoryChange new.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    35
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    36
    changes do: [ :codeChange | 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    37
        change addChange: codeChange
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    38
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    39
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    40
    ^ change
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    41
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    42
    "Created: / 15-08-2014 / 00:45:10 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    43
    "Modified (comment): / 17-08-2014 / 17:16:38 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    44
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    45
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    46
searcher
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    47
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    48
    ^ ParseTreeSearcher new
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    49
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    50
    "Created: / 16-08-2014 / 22:13:25 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    51
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    52
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    53
!CustomRefactoryBuilder methodsFor:'compiling'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    54
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    55
execute
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    56
    "
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    57
    Most likely as compile method, but without undo change
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    58
    in global RefactoryChangeManager
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    59
    (true for CustomLocalChangeManager changeManager implementation)
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    60
    "
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    61
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    62
    changeManager performChange: self change
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    63
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    64
    "Created: / 15-08-2014 / 00:45:10 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    65
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    66
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    67
redoChanges
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    68
    "redo all changes made by execute method"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    69
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    70
    changeManager redoChanges
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    71
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    72
    "Created: / 15-08-2014 / 00:46:47 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    73
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    74
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    75
!CustomRefactoryBuilder methodsFor:'initialization'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    76
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    77
initialize
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    78
    "Invoked when a new instance is created."
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    79
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    80
    super initialize.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    81
    changeManager := CustomLocalChangeManager new.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    82
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    83
    "Created: / 15-08-2014 / 00:42:39 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    84
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    85
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    86
!CustomRefactoryBuilder methodsFor:'refactory-changes'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    87
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    88
executeReplace: searchPattern with: rewritePattern inMethod: aMethod
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    89
    "Executes replace in a method source and then creates a method change"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    90
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    91
    | newTree change |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    92
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    93
    newTree := (CustomParseTreeRewriter new)
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    94
        replace: searchPattern with: rewritePattern;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    95
        executeTree: aMethod parseTree;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    96
        tree.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    97
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    98
    change := InteractiveAddMethodChange
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    99
        compile: newTree newSource 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   100
        in: aMethod mclass 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   101
        classified: aMethod category.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   102
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   103
    changes add: change
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   104
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   105
    "Created: / 17-08-2014 / 18:45:20 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   106
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   107
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   108
replace: searchPattern with: rewritePattern inContext: aCustomContext
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   109
    "Searches for given pattern in methods source code and if source code matches then executes replacement"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   110
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   111
    self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   112
        search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   113
        inContext: aCustomContext 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   114
        withResultDo: [ :method |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   115
            self executeReplace: searchPattern with: rewritePattern inMethod: method 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   116
        ]
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   117
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   118
    "Created: / 16-08-2014 / 19:15:10 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   119
    "Modified (comment): / 17-08-2014 / 19:30:11 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   120
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   121
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   122
!CustomRefactoryBuilder methodsFor:'searching'!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   123
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   124
search: searchPattern inClass: aClass withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   125
    | methods |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   126
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   127
    methods := OrderedCollection new.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   128
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   129
    methods addAll: aClass theNonMetaclass methodDictionary values.    
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   130
    methods addAll: aClass theMetaclass methodDictionary values.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   131
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   132
    self search: searchPattern inMethods: methods withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   133
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   134
    "Created: / 17-08-2014 / 13:15:03 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   135
    "Modified: / 17-08-2014 / 17:18:27 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   136
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   137
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   138
search: searchPattern inClassCategories: aCategoryCollection withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   139
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   140
    "To be implemented"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   141
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   142
    "Created: / 17-08-2014 / 16:21:23 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   143
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   144
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   145
search: searchPattern inClasses: aClassCollection withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   146
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   147
    aClassCollection do:[ :class | 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   148
        self search: searchPattern inClass: class withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   149
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   150
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   151
    "Created: / 17-08-2014 / 16:21:22 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   152
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   153
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   154
search: searchPattern inCode: aCode withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   155
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   156
    "To be implemented"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   157
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   158
    "Created: / 17-08-2014 / 16:21:19 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   159
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   160
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   161
search: searchPattern inContext: aCustomContext withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   162
    "Searches for source code pattern in whole context which contains code, methods, classes... "
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   163
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   164
    aCustomContext selectedCode notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   165
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   166
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   167
            inCode: aCustomContext selectedCode
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   168
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   169
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   170
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   171
    aCustomContext selectedMethods notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   172
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   173
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   174
            inMethods: aCustomContext selectedMethods
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   175
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   176
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   177
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   178
    aCustomContext selectedMethodProtocols notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   179
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   180
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   181
            inMethodProtocols: aCustomContext selectedMethodProtocols
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   182
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   183
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   184
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   185
    aCustomContext selectedClasses notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   186
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   187
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   188
            inClasses: aCustomContext selectedClasses
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   189
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   190
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   191
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   192
    aCustomContext selectedClassCategories notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   193
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   194
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   195
            inClassCategories: aCustomContext selectedClassCategories
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   196
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   197
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   198
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   199
    aCustomContext selectedPackages notNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   200
        self 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   201
            search: searchPattern 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   202
            inPackages: aCustomContext selectedPackages
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   203
            withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   204
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   205
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   206
    "Created: / 17-08-2014 / 16:21:24 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   207
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   208
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   209
search: searchPattern inMethod: aMethod withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   210
    | parseTree |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   211
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   212
    parseTree := aMethod parseTree.    
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   213
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   214
    parseTree isNil ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   215
        self error: 'Cannot retrieve parseTree for method: ', aMethod asString.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   216
    ]
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   217
    ifFalse: [
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   218
        (self searcher)
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   219
            matches: searchPattern do: [ :aNode :answer |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   220
                aBlock value: aMethod  
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   221
            ];
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   222
            executeTree: parseTree
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   223
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   224
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   225
    "Created: / 16-08-2014 / 22:27:35 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   226
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   227
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   228
search: searchPattern inMethodProtocols: aProtocolCollection withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   229
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   230
    "To be implemented"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   231
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   232
    "Created: / 17-08-2014 / 16:21:21 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   233
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   234
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   235
search: searchPattern inMethods: aMethodCollection withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   236
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   237
    aMethodCollection do: [ :method | 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   238
        self search: searchPattern inMethod: method withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   239
    ].
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   240
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   241
    "Created: / 17-08-2014 / 11:56:23 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   242
    "Modified: / 17-08-2014 / 20:35:16 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   243
!
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   244
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   245
search: searchPattern inPackages: aPackageCollection withResultDo: aBlock
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   246
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   247
    "To be implemented"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   248
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   249
    "Created: / 17-08-2014 / 16:21:24 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   250
! !
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   251