author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 27 Feb 2013 12:34:59 +0000 | |
branch | jv |
changeset 12431 | 9f0c59c742d5 |
parent 12401 | 4714b9640528 |
child 13173 | e9da2324940d |
permissions | -rw-r--r-- |
9989 | 1 |
" |
2 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
3 |
All Rights Reserved |
9989 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
"{ Package: 'stx:libtool' }" |
|
8778 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
Object subclass:#NavigationHistory |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
17 |
instanceVariableNames:'items position isGlobalHistory' |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
18 |
classVariableNames:'' |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
19 |
poolDictionaries:'' |
11775 | 20 |
category:'Interface-Browsers-New-History' |
8778 | 21 |
! |
22 |
||
9989 | 23 |
!NavigationHistory class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2006 by eXept Software AG |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
28 |
All Rights Reserved |
9989 | 29 |
|
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
37 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
38 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
39 |
documentation |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
40 |
" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
41 |
two variants: |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
42 |
a forward-backward history, as in a browser: |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
43 |
navigating backward moves a pointer in a list |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
44 |
a global history |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
45 |
navigating moves the navigated item to the front position |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
46 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
47 |
hack: configurable to behave either as a global history |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
48 |
or as a local-tab navigation history. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
49 |
Also implement backward compatible list-style acccess interface, |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
50 |
to support old browsers (I guess, this is temporary and the other |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
51 |
users of the global history (debugger, old systembrowser etc. should |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
52 |
be changed) |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
53 |
" |
9989 | 54 |
! ! |
8778 | 55 |
|
56 |
!NavigationHistory class methodsFor:'instance creation'! |
|
57 |
||
58 |
new |
|
59 |
^ self basicNew initialize. |
|
60 |
||
61 |
"Created: / 21-02-2008 / 15:26:05 / janfrog" |
|
62 |
! ! |
|
63 |
||
64 |
!NavigationHistory methodsFor:'accessing'! |
|
65 |
||
66 |
currentItem |
|
67 |
||
68 |
^(position between:1 and: items size) |
|
69 |
ifTrue:[items at: position] |
|
70 |
ifFalse:[nil] |
|
71 |
||
72 |
"Created: / 27-02-2008 / 08:46:37 / janfrog" |
|
73 |
! |
|
74 |
||
75 |
currentItem: anObject |
|
76 |
||
77 |
self goTo: anObject |
|
78 |
||
79 |
"Created: / 27-02-2008 / 08:47:04 / janfrog" |
|
80 |
! |
|
81 |
||
82 |
goBackItems |
|
10176 | 83 |
isGlobalHistory ifTrue:[^ items "isEmpty ifTrue:[items] ifFalse:[items copyFrom:2]"]. |
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
84 |
|
8778 | 85 |
^ (items copyTo:position - 1) reverse |
86 |
||
87 |
"Created: / 27-02-2008 / 11:52:12 / janfrog" |
|
10176 | 88 |
"Modified: / 05-07-2011 / 16:53:18 / cg" |
8778 | 89 |
! |
90 |
||
91 |
goForwardItems |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
92 |
isGlobalHistory ifTrue:[^ #()]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
93 |
|
8778 | 94 |
^ items copyFrom:position + 1 |
95 |
||
96 |
"Created: / 27-02-2008 / 11:52:26 / janfrog" |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
97 |
"Modified: / 03-07-2011 / 16:00:45 / cg" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
98 |
! ! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
99 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
100 |
!NavigationHistory methodsFor:'backward list compatibility'! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
101 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
102 |
addFirst:anEntry |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
103 |
"backward compatible list protocol" |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
104 |
|
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
105 |
items addFirst:anEntry. |
10122 | 106 |
items size > 30 ifTrue:[ |
107 |
items removeLast |
|
108 |
]. |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
109 |
self changed: #value with: anEntry. |
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
110 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
111 |
"Created: / 03-07-2011 / 13:26:48 / cg" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
112 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
113 |
|
10142 | 114 |
collect:aBlock |
115 |
"backward compatible list protocol" |
|
116 |
||
117 |
^ items collect:aBlock |
|
118 |
||
119 |
"Created: / 04-07-2011 / 22:45:21 / cg" |
|
120 |
! |
|
121 |
||
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
122 |
collect:aBlock thenSelect:filter |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
123 |
"backward compatible list protocol" |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
124 |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
125 |
^ items collect:aBlock thenSelect:filter |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
126 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
127 |
"Created: / 03-07-2011 / 13:34:14 / cg" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
128 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
129 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
130 |
detect:aBlock ifNone:exeptionalValue |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
131 |
"backward compatible list protocol" |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
132 |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
133 |
^ items detect:aBlock ifNone:exeptionalValue |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
134 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
135 |
"Created: / 03-07-2011 / 13:25:37 / cg" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
136 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
137 |
|
12058 | 138 |
do:aBlock |
139 |
"backward compatible list protocol" |
|
140 |
||
141 |
^ items do:aBlock |
|
142 |
! |
|
143 |
||
11904 | 144 |
first |
145 |
"backward compatible list protocol" |
|
146 |
||
147 |
^ items first |
|
148 |
||
149 |
"Created: / 04-07-2011 / 22:45:21 / cg" |
|
150 |
! |
|
151 |
||
10142 | 152 |
isEmpty |
153 |
"backward compatible list protocol" |
|
154 |
||
155 |
^ items isEmpty |
|
156 |
||
157 |
"Created: / 04-07-2011 / 22:44:54 / cg" |
|
158 |
! |
|
159 |
||
11906 | 160 |
isEmptyOrNil |
161 |
"backward compatible list protocol" |
|
162 |
||
163 |
^ items isEmptyOrNil |
|
164 |
||
165 |
"Created: / 04-07-2011 / 22:44:54 / cg" |
|
166 |
! |
|
167 |
||
10142 | 168 |
notEmpty |
169 |
"backward compatible list protocol" |
|
170 |
||
171 |
^ items notEmpty |
|
172 |
||
173 |
"Created: / 04-07-2011 / 22:45:45 / cg" |
|
174 |
! |
|
175 |
||
11906 | 176 |
notEmptyOrNil |
177 |
"backward compatible list protocol" |
|
178 |
||
179 |
^ items notEmptyOrNil |
|
180 |
||
181 |
"Created: / 04-07-2011 / 22:45:45 / cg" |
|
182 |
! |
|
183 |
||
10715 | 184 |
removeAll |
185 |
items removeAll. |
|
186 |
||
187 |
"Created: / 21-09-2011 / 16:27:38 / cg" |
|
188 |
! |
|
189 |
||
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
190 |
removeIdentical:anEntry |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
191 |
"backward compatible list protocol" |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
192 |
|
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
193 |
items removeIdentical:anEntry. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
194 |
self changed: #value with:nil. |
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
195 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
196 |
"Created: / 03-07-2011 / 13:27:34 / cg" |
10142 | 197 |
! |
198 |
||
199 |
reverseDo:aBlock |
|
200 |
"backward compatible list protocol" |
|
201 |
||
202 |
items reverseDo:aBlock |
|
203 |
||
204 |
"Created: / 04-07-2011 / 22:44:28 / cg" |
|
8778 | 205 |
! ! |
206 |
||
207 |
!NavigationHistory methodsFor:'initialization'! |
|
208 |
||
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
209 |
beGlobalHistory |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
210 |
isGlobalHistory := true |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
211 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
212 |
"Created: / 03-07-2011 / 14:42:57 / cg" |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
213 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
214 |
|
8778 | 215 |
initialize |
216 |
"Invoked when a new instance is created." |
|
217 |
||
218 |
"/ please change as required (and remove this comment) |
|
219 |
"/ items := nil. |
|
220 |
"/ position := nil. |
|
221 |
||
222 |
"/ super initialize. -- commented since inherited method does nothing |
|
223 |
items := OrderedCollection new. |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
224 |
position := 0. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
225 |
isGlobalHistory := false. |
8778 | 226 |
|
227 |
"Created: / 21-02-2008 / 15:26:05 / janfrog" |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
228 |
"Modified: / 03-07-2011 / 14:43:08 / cg" |
8778 | 229 |
! ! |
230 |
||
231 |
!NavigationHistory methodsFor:'menu & menu actions'! |
|
232 |
||
233 |
goBackMenu |
|
234 |
|menu| |
|
235 |
||
236 |
menu := Menu new. |
|
237 |
self goBackItems do:[:item | |
|
238 |
menu addItem:(MenuItem label:item displayString value:[ self goTo:item ]) |
|
239 |
]. |
|
240 |
^ menu |
|
241 |
||
242 |
"Created: / 22-02-2008 / 16:57:46 / janfrog" |
|
243 |
"Modified: / 27-02-2008 / 11:52:12 / janfrog" |
|
244 |
! |
|
245 |
||
246 |
goForwardMenu |
|
247 |
|menu| |
|
248 |
||
249 |
menu := Menu new. |
|
250 |
self goForwardItems do:[:item | |
|
251 |
menu addItem:(MenuItem label:item displayString value:[ self goTo:item ]) |
|
252 |
]. |
|
253 |
^ menu |
|
254 |
||
255 |
"Created: / 22-02-2008 / 16:58:11 / janfrog" |
|
256 |
"Modified: / 27-02-2008 / 11:52:26 / janfrog" |
|
257 |
! ! |
|
258 |
||
259 |
!NavigationHistory methodsFor:'navigation'! |
|
260 |
||
261 |
goBack |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
262 |
| value | |
8778 | 263 |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
264 |
isGlobalHistory ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
265 |
items size <= 1 ifTrue:[^ nil]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
266 |
^ self goTo:(items second). |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
267 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
268 |
|
8778 | 269 |
position := (position - 1) max: 1. |
270 |
self changed: #currentItem with: (value := self currentItem). |
|
271 |
^value |
|
272 |
||
273 |
"Created: / 21-02-2008 / 16:37:37 / janfrog" |
|
274 |
"Modified: / 27-02-2008 / 08:48:14 / janfrog" |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
275 |
"Modified: / 03-07-2011 / 16:19:27 / cg" |
8778 | 276 |
! |
277 |
||
278 |
goForward |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
279 |
| value | |
8778 | 280 |
|
281 |
position := (position + 1) min: items size. |
|
282 |
self changed: #currentItem with: (value := self currentItem). |
|
283 |
^value |
|
284 |
||
285 |
"Created: / 21-02-2008 / 16:37:37 / janfrog" |
|
286 |
"Modified: / 27-02-2008 / 08:48:24 / janfrog" |
|
287 |
! |
|
288 |
||
289 |
goTo: navigationHistoryItem |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
290 |
| idx | |
8778 | 291 |
|
292 |
idx := items indexOf:navigationHistoryItem. |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
293 |
isGlobalHistory ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
294 |
idx ~~ 0 ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
295 |
items removeIndex:idx. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
296 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
297 |
items addFirst:navigationHistoryItem. |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
298 |
] ifFalse:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
299 |
idx == 0 ifFalse: [ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
300 |
position := idx |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
301 |
] ifTrue:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
302 |
position < items size ifTrue:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
303 |
items removeFromIndex: position + 1 toIndex: items size |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
304 |
]. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
305 |
items addLast: navigationHistoryItem. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
306 |
position := position + 1 |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
307 |
]. |
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
308 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
309 |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
310 |
"/ for the canGoXXX apect. |
8778 | 311 |
self changed: #value with: navigationHistoryItem. |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
312 |
^ navigationHistoryItem |
8778 | 313 |
|
314 |
"Created: / 21-02-2008 / 16:40:39 / janfrog" |
|
315 |
"Modified: / 21-02-2008 / 19:12:35 / janfrog" |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
316 |
"Modified: / 03-07-2011 / 16:03:11 / cg" |
8778 | 317 |
! ! |
318 |
||
319 |
!NavigationHistory methodsFor:'queries'! |
|
320 |
||
321 |
canGoBack |
|
10122 | 322 |
isGlobalHistory ifTrue:[ |
323 |
^ items size > 2 |
|
324 |
]. |
|
8778 | 325 |
|
10122 | 326 |
^ position > 1 |
8778 | 327 |
|
328 |
"Created: / 21-02-2008 / 16:40:48 / janfrog" |
|
329 |
! |
|
330 |
||
331 |
canGoForward |
|
332 |
||
333 |
^position < items size |
|
334 |
||
335 |
"Created: / 21-02-2008 / 16:40:48 / janfrog" |
|
336 |
! ! |
|
337 |
||
338 |
!NavigationHistory class methodsFor:'documentation'! |
|
339 |
||
8804 | 340 |
version_CVS |
12058 | 341 |
^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationHistory.st,v 1.14 2012-11-13 09:07:18 mb Exp $' |
8804 | 342 |
! |
343 |
||
8818 | 344 |
version_CVS_jvrany |
9989 | 345 |
^ '§Header: /opt/data/cvs/stx/goodies/libtool3/Tools__NavigationHistory.st,v 1.2 2008-02-27 13:45:21 vranyj1 Exp §' |
346 |
! |
|
347 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
348 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
349 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
350 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
351 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12401
diff
changeset
|
352 |
|
9989 | 353 |
version_SVN |
354 |
^ '§Id: Tools__NavigationHistory.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
8778 | 355 |
! ! |
12401
4714b9640528
Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
diff
changeset
|
356 |