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