author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 14 Jun 2018 22:19:39 +0100 | |
branch | jv |
changeset 18227 | d25a407ba86d |
parent 18226 | 346376844040 |
child 19646 | 235fea37201a |
permissions | -rw-r--r-- |
9997 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 3 |
COPYRIGHT (c) 2015 Jan Vrany |
4 |
COPYRIGHT (c) 2017 Jan Vrany |
|
9997 | 5 |
All Rights Reserved |
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libtool' }" |
|
8777 | 15 |
|
16 |
"{ NameSpace: Tools }" |
|
17 |
||
18 |
Object subclass:#Inspector2Tab |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
19 |
instanceVariableNames:'inspector label view application priority' |
8777 | 20 |
classVariableNames:'' |
21 |
poolDictionaries:'' |
|
10459 | 22 |
category:'Interface-Inspector2' |
8777 | 23 |
! |
24 |
||
9997 | 25 |
!Inspector2Tab class methodsFor:'documentation'! |
26 |
||
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
18226 | 30 |
COPYRIGHT (c) 2015 Jan Vrany |
31 |
COPYRIGHT (c) 2017 Jan Vrany |
|
9997 | 32 |
All Rights Reserved |
33 |
||
34 |
This software is furnished under a license and may be used |
|
35 |
only in accordance with the terms of that license and with the |
|
36 |
inclusion of the above copyright notice. This software may not |
|
37 |
be provided or otherwise made available to, or used by, any |
|
38 |
other person. No title to or ownership of the software is |
|
39 |
hereby transferred. |
|
40 |
" |
|
41 |
! ! |
|
8777 | 42 |
|
17265 | 43 |
!Inspector2Tab class methodsFor:'special instance creation'! |
44 |
||
45 |
toBrowseClass:aClass selector:initialSelectorOrNil label:label |
|
46 |
"create and return an inspector tab containing |
|
47 |
a browser on aClass (and optional initialSelector). |
|
48 |
This is a utility to be used by inspector2TabXXX methods, which want to embed a clas browser." |
|
49 |
||
50 |
|makeView view| |
|
51 |
||
52 |
makeView := |
|
53 |
[ |
|
54 |
|spec browser navigationState canvas| |
|
55 |
||
56 |
||
17266 | 57 |
(view isNil ifTrue:[ |
17265 | 58 |
"/ spec := #singleClassBrowserSpec. |
59 |
spec := #multipleClassBrowserSpec. |
|
60 |
||
61 |
browser := Tools::NewSystemBrowser new. |
|
62 |
browser isEmbeddedBrowser:true. |
|
63 |
browser createBuilder. |
|
64 |
||
65 |
navigationState := browser navigationState. |
|
66 |
navigationState canvasType:spec. |
|
67 |
browser browserCanvasType:spec. |
|
68 |
||
69 |
canvas := browser browserCanvas value. |
|
70 |
canvas builder:(browser builder). |
|
71 |
navigationState canvas:canvas. |
|
72 |
"/ browser switchToClassHierarchyView. |
|
73 |
"/ browser showInheritedMethods. |
|
74 |
||
17266 | 75 |
navigationState classList value:(aClass theNonMetaclass withAllSuperclasses). |
76 |
navigationState meta value:(aClass isMetaclass). |
|
77 |
browser classListGenerator value:(aClass theNonMetaclass withAllSuperclasses). |
|
17265 | 78 |
browser sortByNameAndInheritance value:true. |
79 |
browser |
|
80 |
selectClass:aClass; |
|
81 |
selectProtocol: (Tools::BrowserList nameListEntryForALL). |
|
17266 | 82 |
browser switchToClass:aClass selector:initialSelectorOrNil updateHistory: false. |
17265 | 83 |
view := ApplicationSubView new client: browser spec: spec. |
17266 | 84 |
"/ sigh must be done after postbuild |
17265 | 85 |
navigationState classListApplication addOwnerClasses value:false. |
17266 | 86 |
]). |
17265 | 87 |
view |
88 |
]. |
|
89 |
||
90 |
^ self new |
|
91 |
priority: 0; |
|
92 |
label:label; |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
93 |
view: makeView; |
17265 | 94 |
yourself |
17266 | 95 |
|
96 |
" |
|
97 |
GenericToolbarIconLibrary systemBrowserIcon inspect |
|
98 |
" |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
99 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
100 |
"Modified: / 09-02-2017 / 00:33:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17265 | 101 |
! ! |
102 |
||
8777 | 103 |
!Inspector2Tab methodsFor:'accessing'! |
104 |
||
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
105 |
application:anApplicationModelOrBlockOrValueModel |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
106 |
view := [ |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
107 |
ApplicationSubView new |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
108 |
client: anApplicationModelOrBlockOrValueModel value; |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
109 |
yourself |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
110 |
]. |
8777 | 111 |
|
112 |
"Created: / 16-01-2008 / 16:51:05 / janfrog" |
|
113 |
"Modified: / 17-02-2008 / 08:58:34 / janfrog" |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
114 |
"Modified: / 09-02-2017 / 09:23:43 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8777 | 115 |
! |
116 |
||
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
117 |
applicationHolder:aValueModelOrBlock |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
118 |
<resource: #obsolete> "/ use #application: |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
119 |
self application: aValueModelOrBlock |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
120 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
121 |
"Modified: / 09-02-2017 / 09:23:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
122 |
! |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
123 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
124 |
inspector: anInspector2 |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
125 |
inspector := anInspector2 |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
126 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
127 |
"Created: / 09-02-2017 / 00:53:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
16724 | 128 |
! |
129 |
||
8777 | 130 |
label |
131 |
^ label |
|
132 |
||
133 |
"Created: / 16-01-2008 / 16:51:05 / janfrog" |
|
134 |
! |
|
135 |
||
136 |
label:aString |
|
137 |
label := aString. |
|
138 |
||
139 |
"Created: / 16-01-2008 / 16:51:05 / janfrog" |
|
140 |
"Modified: / 17-02-2008 / 08:58:41 / janfrog" |
|
141 |
! |
|
142 |
||
143 |
priority |
|
144 |
^ priority ? 25 |
|
145 |
||
146 |
"Created: / 17-02-2008 / 10:05:51 / janfrog" |
|
147 |
! |
|
148 |
||
149 |
priority:something |
|
150 |
priority := something. |
|
151 |
||
152 |
"Created: / 17-02-2008 / 10:05:51 / janfrog" |
|
153 |
! |
|
154 |
||
155 |
text:aStringOrValueModel |
|
156 |
||
157 |
self view:((HVScrollableView for:TextView) model: aStringOrValueModel; yourself) |
|
158 |
||
159 |
"Modified: / 17-02-2008 / 08:58:41 / janfrog" |
|
160 |
"Created: / 07-11-2008 / 08:40:35 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
161 |
! |
|
162 |
||
163 |
view |
|
10874 | 164 |
view isNil ifTrue:[ |
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
165 |
application notNil ifTrue:[ |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
166 |
view := ApplicationSubView new. |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
167 |
view client: application value. |
10874 | 168 |
] |
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
169 |
] ifFalse:[ |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
170 |
view isBlock ifTrue:[ |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
171 |
view := view value. |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
172 |
]. |
10874 | 173 |
]. |
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
174 |
self setupView. |
8777 | 175 |
^ view |
176 |
||
177 |
"Created: / 16-01-2008 / 16:51:05 / janfrog" |
|
178 |
"Modified: / 17-02-2008 / 10:38:59 / janfrog" |
|
11583
8775311ee2f9
lazy setup of embedded browser brings up inspector much faster
Claus Gittinger <cg@exept.de>
parents:
10874
diff
changeset
|
179 |
"Modified: / 13-06-2012 / 14:57:25 / cg" |
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
180 |
"Modified: / 09-02-2017 / 09:24:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8777 | 181 |
! |
182 |
||
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
183 |
view:aViewOrBlockOrValueModel |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
184 |
view := aViewOrBlockOrValueModel. |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
185 |
|
8777 | 186 |
|
187 |
"Created: / 16-01-2008 / 16:51:05 / janfrog" |
|
188 |
"Modified: / 17-02-2008 / 08:58:46 / janfrog" |
|
15659
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
189 |
"Modified: / 21-05-2015 / 21:31:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
11583
8775311ee2f9
lazy setup of embedded browser brings up inspector much faster
Claus Gittinger <cg@exept.de>
parents:
10874
diff
changeset
|
190 |
! |
8775311ee2f9
lazy setup of embedded browser brings up inspector much faster
Claus Gittinger <cg@exept.de>
parents:
10874
diff
changeset
|
191 |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
192 |
viewHolder:aValueModelOrBlock |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
193 |
<resource: #obsolete> "/ use #view: |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
194 |
self view: aValueModelOrBlock |
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
195 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
196 |
"Modified: / 09-02-2017 / 09:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
14157
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
197 |
! |
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
198 |
|
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
199 |
viewOrNil |
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
200 |
^ view |
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
201 |
|
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
202 |
"Created: / 24-03-2014 / 18:23:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8777 | 203 |
! ! |
204 |
||
16661 | 205 |
!Inspector2Tab methodsFor:'setup'! |
206 |
||
207 |
setupView |
|
208 |
||
209 |
(view respondsTo:#setMasterInspectorApplication:) ifTrue:[ |
|
210 |
"this is for BridgeOjectInspectorView" |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
211 |
view setMasterInspectorApplication:inspector. |
16661 | 212 |
]. |
213 |
(view respondsTo:#sortOrderHolder:) ifTrue:[ |
|
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
214 |
view sortOrderHolder:(inspector sortOrderHolder) |
16661 | 215 |
]. |
17459
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
216 |
|
9f54cb54204c
Issue #120: Fixed regression with Inspector2 not showing custom presentations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
17379
diff
changeset
|
217 |
"Modified: / 09-02-2017 / 09:24:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
16661 | 218 |
! ! |
219 |
||
8777 | 220 |
!Inspector2Tab class methodsFor:'documentation'! |
221 |
||
17266 | 222 |
version |
223 |
^ '$Header$' |
|
224 |
! |
|
225 |
||
8802 | 226 |
version_CVS |
16661 | 227 |
^ '$Header$' |
8802 | 228 |
! |
229 |
||
8815 | 230 |
version_CVS_jvrany |
16661 | 231 |
^ '$Header$' |
9997 | 232 |
! |
233 |
||
15659
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
234 |
version_HG |
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
235 |
|
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
236 |
^ '$Changeset: <not expanded> $' |
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
237 |
! |
bdc9e920f640
Improved API for inspector 2 tabs: allow view to be actually a block returning the view.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
15566
diff
changeset
|
238 |
|
9997 | 239 |
version_SVN |
16661 | 240 |
^ '$Id$' |
8777 | 241 |
! ! |
14157
4467fff63f8c
Performance fixes in Inspector2:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
11583
diff
changeset
|
242 |