CustomBrowserContext.st
author Jakub Nesveda <jakubnesveda@seznam.cz>
Wed, 19 Nov 2014 19:39:02 +0100
changeset 755 37d50424e347
parent 747 008860f4cbd4
child 771 ff42535f163f
permissions -rw-r--r--
tests fixes - global instance of RBNamespace for creating RBClass holds old data when the global system namespace changes its state - in this case it is old real class instance Now is RBNamespace initialized for each instace of CustomContext
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
500
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'jn:refactoring_custom' }"
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
     3
CustomContext subclass:#CustomBrowserContext
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
     4
	instanceVariableNames:'perspective state'
500
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'Interface-Refactoring-Custom'
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
!
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
525
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
    10
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    11
!CustomBrowserContext class methodsFor:'instance creation'!
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    12
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    13
perspective: perspective state: state
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    14
    ^ self new perspective: perspective state: state
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    15
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    16
    "Created: / 26-01-2014 / 11:00:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    17
! !
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    18
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    19
!CustomBrowserContext methodsFor:'accessing'!
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    20
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    21
perspective
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    22
    ^ perspective
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    23
!
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    24
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    25
perspective:perspectiveArg state:stateArg 
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    26
    perspective := perspectiveArg.
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    27
    state := stateArg.
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    28
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    29
    "Created: / 26-01-2014 / 11:00:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    30
! !
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    31
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    32
!CustomBrowserContext methodsFor:'accessing-selection'!
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    33
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    34
selectedClassCategories
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    35
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    36
    ^ state selectedCategories value
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    37
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    38
    "Modified: / 05-08-2014 / 21:35:11 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    39
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    40
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    41
selectedClasses
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    42
    "Returns a set of classes currently selected in
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    43
     the browser"
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    44
746
a25dc307d4e8 Make CustomContext>>selectedClasses always return a collection of RBClass...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 722
diff changeset
    45
    ^ state selectedClasses value collect:[ :cls | self asRBClass: cls ]
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    46
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
    47
    "Created: / 26-01-2014 / 22:06:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
746
a25dc307d4e8 Make CustomContext>>selectedClasses always return a collection of RBClass...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 722
diff changeset
    48
    "Modified: / 14-11-2014 / 20:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    49
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    50
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    51
selectedCodes
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    52
    | codeSelection currentMethod codeView |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    53
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    54
    currentMethod := state theSingleSelectedMethod.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    55
    codeView := state codeView.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    56
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    57
    (codeView isNil or: [ currentMethod isNil ]) ifTrue: [ 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    58
        ^ nil
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    59
    ].
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    60
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    61
    codeSelection := CustomSourceCodeSelection new.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    62
    codeSelection
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    63
        selectedInterval: codeView selectedInterval;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    64
        currentSourceCode: codeView contentsAsString; 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    65
        selectedMethod: currentMethod; 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    66
        selectedClass: currentMethod mclass;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    67
        selectedSelector: currentMethod selector.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    68
        
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    69
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    70
    ^ Array with: codeSelection
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    71
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    72
    "Created: / 18-08-2014 / 21:34:56 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    73
    "Modified: / 18-08-2014 / 23:51:57 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    74
!
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    75
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    76
selectedMethods
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    77
747
008860f4cbd4 Make CustomContext>>selectedMethods always return a collection of RBMethod...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 746
diff changeset
    78
    ^ state selectedMethods value collect:[ :m | self asRBMethod: m ]
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    79
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    80
    "Modified: / 05-08-2014 / 21:31:21 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
747
008860f4cbd4 Make CustomContext>>selectedMethods always return a collection of RBMethod...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 746
diff changeset
    81
    "Modified: / 14-11-2014 / 20:17:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    82
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    83
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    84
selectedPackages
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    85
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    86
    ^ state packageFilter value
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    87
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    88
    "Modified: / 05-08-2014 / 21:38:14 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    89
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    90
718
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    91
selectedProtocols
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    92
    "Returns a collection of method protocols which are visible and selected in the Browser."
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    93
    
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    94
    |protocols allIncluded|
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    95
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    96
    protocols := state selectedProtocols value.
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    97
     "Support to return all protocols when all protocol ('* all *') is selected in the Browser.
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    98
     This is a little duplicate as in Tools::NewSystemBowser >> selectedProtocolsDo: ,
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
    99
     but using this method would require a referece to the Browser and furthermore is marked as private."
722
23ea76589d1b fix error when protocols are empty in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 718
diff changeset
   100
    allIncluded := protocols ? #() 
718
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   101
            includes:(Tools::BrowserList nameListEntryForALL).
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   102
    allIncluded ifTrue:[
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   103
        protocols := Set new.
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   104
        self selectedClasses do:[:class | 
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   105
            protocols addAll:class categories
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   106
        ]
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   107
    ].
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   108
    ^ protocols
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   109
755
37d50424e347 tests fixes - global instance of RBNamespace for creating RBClass holds old data when the global system namespace changes its state - in this case it is old real class instance
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 747
diff changeset
   110
    "Modified: / 19-11-2014 / 08:45:13 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
718
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   111
!
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   112
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   113
selectedVariables
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   114
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   115
    ^ state variableFilter value
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   116
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   117
    "Modified: / 17-05-2014 / 13:29:57 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   118
! !
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   119
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
   120
!CustomBrowserContext methodsFor:'enumerating'!
506
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   121
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   122
codeGeneratorsAndRefactoringDo:aBlock 
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   123
    "Evaluate a block on each generator and refactoring class available in my
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   124
     perspective.
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   125
     NOTE: the block gets class, not an instance of generator/refactoring"
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   126
    
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   127
    CustomManager current generatorsAndRefactoringsForPerspective:perspective
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   128
        do:aBlock
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   129
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   130
    "Created: / 26-01-2014 / 13:39:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   131
! !
b611cc119554 Added support for custom menu building and injecting into class browser's menus.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 500
diff changeset
   132
668
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   133
!CustomBrowserContext methodsFor:'testing'!
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   134
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   135
isInteractiveContext
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   136
    "Return true, if this generator/refactoring context is interactive,
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   137
     i.e., if it may interact with user (like asking for class name or
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   138
     similar) or not. 
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   139
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   140
     Generally speaking, only top-level context is interactive an only
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   141
     if generator/refactoring was triggerred from menu.
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   142
    "
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   143
    ^ true
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   144
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   145
    "Created: / 16-09-2014 / 09:23:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   146
! !
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   147
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
   148
!CustomBrowserContext class methodsFor:'documentation'!
525
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   149
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   150
version_HG
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   151
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   152
    ^ '$Changeset: <not expanded> $'
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   153
! !
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   154