author | Claus Gittinger <cg@exept.de> |
Tue, 23 Oct 2012 15:13:20 +0200 | |
changeset 11904 | 62240b5bf008 |
parent 11775 | cb66177200d8 |
child 11906 | 2d6cd1623d50 |
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 |
|
11904 | 138 |
first |
139 |
"backward compatible list protocol" |
|
140 |
||
141 |
^ items first |
|
142 |
||
143 |
"Created: / 04-07-2011 / 22:45:21 / cg" |
|
144 |
! |
|
145 |
||
10142 | 146 |
isEmpty |
147 |
"backward compatible list protocol" |
|
148 |
||
149 |
^ items isEmpty |
|
150 |
||
151 |
"Created: / 04-07-2011 / 22:44:54 / cg" |
|
152 |
! |
|
153 |
||
154 |
notEmpty |
|
155 |
"backward compatible list protocol" |
|
156 |
||
157 |
^ items notEmpty |
|
158 |
||
159 |
"Created: / 04-07-2011 / 22:45:45 / cg" |
|
160 |
! |
|
161 |
||
10715 | 162 |
removeAll |
163 |
items removeAll. |
|
164 |
||
165 |
"Created: / 21-09-2011 / 16:27:38 / cg" |
|
166 |
! |
|
167 |
||
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
168 |
removeIdentical:anEntry |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
169 |
"backward compatible list protocol" |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
170 |
|
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
171 |
items removeIdentical:anEntry. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
172 |
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
|
173 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
174 |
"Created: / 03-07-2011 / 13:27:34 / cg" |
10142 | 175 |
! |
176 |
||
177 |
reverseDo:aBlock |
|
178 |
"backward compatible list protocol" |
|
179 |
||
180 |
items reverseDo:aBlock |
|
181 |
||
182 |
"Created: / 04-07-2011 / 22:44:28 / cg" |
|
8778 | 183 |
! ! |
184 |
||
185 |
!NavigationHistory methodsFor:'initialization'! |
|
186 |
||
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
187 |
beGlobalHistory |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
188 |
isGlobalHistory := true |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
189 |
|
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
190 |
"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
|
191 |
! |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
192 |
|
8778 | 193 |
initialize |
194 |
"Invoked when a new instance is created." |
|
195 |
||
196 |
"/ please change as required (and remove this comment) |
|
197 |
"/ items := nil. |
|
198 |
"/ position := nil. |
|
199 |
||
200 |
"/ super initialize. -- commented since inherited method does nothing |
|
201 |
items := OrderedCollection new. |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
202 |
position := 0. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
203 |
isGlobalHistory := false. |
8778 | 204 |
|
205 |
"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
|
206 |
"Modified: / 03-07-2011 / 14:43:08 / cg" |
8778 | 207 |
! ! |
208 |
||
209 |
!NavigationHistory methodsFor:'menu & menu actions'! |
|
210 |
||
211 |
goBackMenu |
|
212 |
|menu| |
|
213 |
||
214 |
menu := Menu new. |
|
215 |
self goBackItems do:[:item | |
|
216 |
menu addItem:(MenuItem label:item displayString value:[ self goTo:item ]) |
|
217 |
]. |
|
218 |
^ menu |
|
219 |
||
220 |
"Created: / 22-02-2008 / 16:57:46 / janfrog" |
|
221 |
"Modified: / 27-02-2008 / 11:52:12 / janfrog" |
|
222 |
! |
|
223 |
||
224 |
goForwardMenu |
|
225 |
|menu| |
|
226 |
||
227 |
menu := Menu new. |
|
228 |
self goForwardItems do:[:item | |
|
229 |
menu addItem:(MenuItem label:item displayString value:[ self goTo:item ]) |
|
230 |
]. |
|
231 |
^ menu |
|
232 |
||
233 |
"Created: / 22-02-2008 / 16:58:11 / janfrog" |
|
234 |
"Modified: / 27-02-2008 / 11:52:26 / janfrog" |
|
235 |
! ! |
|
236 |
||
237 |
!NavigationHistory methodsFor:'navigation'! |
|
238 |
||
239 |
goBack |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
240 |
| value | |
8778 | 241 |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
242 |
isGlobalHistory ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
243 |
items size <= 1 ifTrue:[^ nil]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
244 |
^ self goTo:(items second). |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
245 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
246 |
|
8778 | 247 |
position := (position - 1) max: 1. |
248 |
self changed: #currentItem with: (value := self currentItem). |
|
249 |
^value |
|
250 |
||
251 |
"Created: / 21-02-2008 / 16:37:37 / janfrog" |
|
252 |
"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
|
253 |
"Modified: / 03-07-2011 / 16:19:27 / cg" |
8778 | 254 |
! |
255 |
||
256 |
goForward |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
257 |
| value | |
8778 | 258 |
|
259 |
position := (position + 1) min: items size. |
|
260 |
self changed: #currentItem with: (value := self currentItem). |
|
261 |
^value |
|
262 |
||
263 |
"Created: / 21-02-2008 / 16:37:37 / janfrog" |
|
264 |
"Modified: / 27-02-2008 / 08:48:24 / janfrog" |
|
265 |
! |
|
266 |
||
267 |
goTo: navigationHistoryItem |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
268 |
| idx | |
8778 | 269 |
|
270 |
idx := items indexOf:navigationHistoryItem. |
|
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
271 |
isGlobalHistory ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
272 |
idx ~~ 0 ifTrue:[ |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
273 |
items removeIndex:idx. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
274 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
275 |
items addFirst:navigationHistoryItem. |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
276 |
] ifFalse:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
277 |
idx == 0 ifFalse: [ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
278 |
position := idx |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
279 |
] ifTrue:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
280 |
position < items size ifTrue:[ |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
281 |
items removeFromIndex: position + 1 toIndex: items size |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
282 |
]. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
283 |
items addLast: navigationHistoryItem. |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
284 |
position := position + 1 |
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
285 |
]. |
10049
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
286 |
]. |
8b6c0289ff0a
hack: configurable to behave either as a global history
Claus Gittinger <cg@exept.de>
parents:
9989
diff
changeset
|
287 |
|
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
288 |
"/ for the canGoXXX apect. |
8778 | 289 |
self changed: #value with: navigationHistoryItem. |
10121
9ffc433015ec
comment/format in: #goForward
Claus Gittinger <cg@exept.de>
parents:
10049
diff
changeset
|
290 |
^ navigationHistoryItem |
8778 | 291 |
|
292 |
"Created: / 21-02-2008 / 16:40:39 / janfrog" |
|
293 |
"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
|
294 |
"Modified: / 03-07-2011 / 16:03:11 / cg" |
8778 | 295 |
! ! |
296 |
||
297 |
!NavigationHistory methodsFor:'queries'! |
|
298 |
||
299 |
canGoBack |
|
10122 | 300 |
isGlobalHistory ifTrue:[ |
301 |
^ items size > 2 |
|
302 |
]. |
|
8778 | 303 |
|
10122 | 304 |
^ position > 1 |
8778 | 305 |
|
306 |
"Created: / 21-02-2008 / 16:40:48 / janfrog" |
|
307 |
! |
|
308 |
||
309 |
canGoForward |
|
310 |
||
311 |
^position < items size |
|
312 |
||
313 |
"Created: / 21-02-2008 / 16:40:48 / janfrog" |
|
314 |
! ! |
|
315 |
||
316 |
!NavigationHistory class methodsFor:'documentation'! |
|
317 |
||
8804 | 318 |
version_CVS |
11904 | 319 |
^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationHistory.st,v 1.12 2012-10-23 13:13:20 cg Exp $' |
8804 | 320 |
! |
321 |
||
8818 | 322 |
version_CVS_jvrany |
9989 | 323 |
^ '§Header: /opt/data/cvs/stx/goodies/libtool3/Tools__NavigationHistory.st,v 1.2 2008-02-27 13:45:21 vranyj1 Exp §' |
324 |
! |
|
325 |
||
326 |
version_SVN |
|
327 |
^ '§Id: Tools__NavigationHistory.st 7486 2009-10-26 22:06:24Z vranyj1 §' |
|
8778 | 328 |
! ! |