SmallSense__CustomBrowserContext.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 11 May 2015 09:30:28 +0100
changeset 830 1a88f5e65fe2
parent 828 CustomBrowserContext.st@4c5acc592dc7
permissions -rw-r--r--
Classes moved to namespace SmallSense
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     1
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     2
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     3
Copyright (C) 2013-2015 Jakub Nesveda
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     4
Copyright (C) 2013-now  Jan Vrany
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     5
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     6
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     8
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     9
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    10
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    11
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    14
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    15
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    17
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    19
"
500
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
"{ Package: 'jn:refactoring_custom' }"
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
830
1a88f5e65fe2 Classes moved to namespace SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 828
diff changeset
    22
"{ NameSpace: SmallSense }"
803
95cdac772759 Fixed failing tests caused by new STX release
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 793
diff changeset
    23
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    24
CustomContext subclass:#CustomBrowserContext
780
c45cc4cd91f0 Move perspective variable to CustomContext to be sure that every subclass implements it
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 771
diff changeset
    25
	instanceVariableNames:'state'
500
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	classVariableNames:''
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	poolDictionaries:''
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	category:'Interface-Refactoring-Custom'
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
!
8c2b58d6b2d5 Code reogranization, Defined CustomContext & basic API.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    31
!CustomBrowserContext class methodsFor:'documentation'!
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    32
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    33
copyright
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    34
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    35
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    36
Copyright (C) 2013-2015 Jakub Nesveda
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    37
Copyright (C) 2013-now  Jan Vrany
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    38
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    39
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    41
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    42
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    43
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    44
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    47
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    48
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    50
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    52
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    53
! !
525
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
    54
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    55
!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
    56
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
    57
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
    58
    ^ 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
    59
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
    60
    "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
    61
! !
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
    62
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    63
!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
    64
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
    65
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
    66
    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
    67
    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
    68
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
    69
    "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
    70
! !
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
    71
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
    72
!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
    73
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    74
selectedClassCategories
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    75
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    76
    ^ state selectedCategories value
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    77
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
    78
    "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
    79
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    80
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
    81
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
    82
    "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
    83
     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
    84
793
4bc0e09b252e Fixed error on empty selected classes and methods in CustomBrowserContext >> selectedClasses, CustomBrowserContext >> selectedMethods
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 780
diff changeset
    85
    ^ 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
    86
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
    87
    "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
    88
    "Modified: / 14-11-2014 / 20:08:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
793
4bc0e09b252e Fixed error on empty selected classes and methods in CustomBrowserContext >> selectedClasses, CustomBrowserContext >> selectedMethods
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 780
diff changeset
    89
    "Modified: / 29-12-2014 / 09:43: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
    90
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
    91
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    92
selectedCodes
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    93
    | codeSelection currentMethod codeView |
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    94
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    95
    currentMethod := state theSingleSelectedMethod.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    96
    codeView := state codeView.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    97
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
    98
    (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
    99
        ^ nil
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   100
    ].
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   101
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   102
    codeSelection := CustomSourceCodeSelection new.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   103
    codeSelection
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   104
        selectedInterval: codeView selectedInterval;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   105
        currentSourceCode: codeView contentsAsString; 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   106
        selectedMethod: currentMethod; 
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   107
        selectedClass: currentMethod mclass;
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   108
        selectedSelector: currentMethod selector.
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   109
        
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   110
629
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   111
    ^ Array with: codeSelection
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   112
e85070e8c11b add code selection object (CustomSourceCodeSelection) with code, method, class... to CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 626
diff changeset
   113
    "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
   114
    "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
   115
!
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   116
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   117
selectedMethods
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   118
793
4bc0e09b252e Fixed error on empty selected classes and methods in CustomBrowserContext >> selectedClasses, CustomBrowserContext >> selectedMethods
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 780
diff changeset
   119
    ^ 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
   120
747
008860f4cbd4 Make CustomContext>>selectedMethods always return a collection of RBMethod...
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 746
diff changeset
   121
    "Modified: / 14-11-2014 / 20:17:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
793
4bc0e09b252e Fixed error on empty selected classes and methods in CustomBrowserContext >> selectedClasses, CustomBrowserContext >> selectedMethods
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 780
diff changeset
   122
    "Modified: / 29-12-2014 / 10:10:29 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   123
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   124
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   125
selectedPackages
626
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   126
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   127
    ^ state packageFilter value
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   128
a32e9bcc436e work in progress on first refactoring
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 547
diff changeset
   129
    "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
   130
!
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   131
718
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   132
selectedProtocols
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   133
    "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
   134
    
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   135
    |protocols allIncluded|
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   136
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   137
    protocols := state selectedProtocols value.
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   138
     "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
   139
     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
   140
     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
   141
    allIncluded := protocols ? #() 
718
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   142
            includes:(Tools::BrowserList nameListEntryForALL).
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   143
    allIncluded ifTrue:[
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   144
        protocols := Set new.
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   145
        self selectedClasses do:[:class | 
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   146
            protocols addAll:class categories
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   147
        ]
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   148
    ].
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   149
    ^ protocols
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   150
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
   151
    "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
   152
!
ed7514e9d76c rename selectedMethodProtocols to selecteProtocols in CustomContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 715
diff changeset
   153
547
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   154
selectedVariables
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   155
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   156
    ^ state variableFilter value
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   157
bdacc7f4986c add support for selected variables in CustomBrowserContext
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 534
diff changeset
   158
    "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
   159
! !
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
   160
668
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   161
!CustomBrowserContext methodsFor:'testing'!
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   162
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   163
isInteractiveContext
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   164
    "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
   165
     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
   166
     similar) or not. 
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   167
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   168
     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
   169
     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
   170
    "
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   171
    ^ true
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   172
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   173
    "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
   174
! !
7f8cddf23efa Separated generator/refactoring initialization from actuall execution.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 629
diff changeset
   175
534
f89b11cd6fa5 CustomContext made as abstract class with 2 implementations: Browser and Sub generator
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 525
diff changeset
   176
!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
   177
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   178
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
   179
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   180
    ^ '$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
   181
! !
06b14d49f485 work in progress - create code generator which generates stub methods for missing subclassResponsibility
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 506
diff changeset
   182