// when the user presses the back-button of the browser, he/she expects that some change on the screen happens)
// VALIDATE events are special events which are to be ignored here - they are no user-dispatched events, but a result thereof.
if (event == ComponentUtil.VALIDATE_EVENT) return;
GUIPath guiPath = new GUIPathImpl();
WindowControlInfo curwcI;
if (newWci == null) {
curwcI = wControl.getWindowControlInfo();
} else {
// take the special, supplied info
curwcI = newWci;
newWci = null;
}
WindowControlInfo prev = null;
do {
ExtendedControllerState state = curwcI.getExtendedControllerState();
guiPath.addStateInfo(state);
prev = curwcI;
} while ((curwcI = curwcI.getParentWindowControlInfo()) != null);
// the prev is now the windowcontrol with a null parent = the root
// -> remember for later back-button handling/traversing
if (rootWCI == null) {
rootWCI = prev;
} else if (rootWCI != prev) {
//REVIEW:2008-02-28 PB: this happens for example in DOCKCONTROLLER in popuwindow
//REVIEW:2008-02-28 PB: gets important for BackHandling
log.warn("WindowControlInfo different root now?? for Controller:"+controller.getClass().getCanonicalName());
//throw new AssertException("different root now??");
}
// clear old forward gui paths if needed
int esize = guipathentries.size();
if (curGPpos < esize-1) { // we are not rightmost,
// that is we have traversed back in history -> clear forward history of gui paths, because those are dumped by the browser. (concept of only having one forward path)
guipathentries.subList(curGPpos+1, esize).clear();
guipathentries.add(guiPath);
//System.out.println("first guipath on click after back:"+guiPath.toString());
curGPpos++;
} else { // curGP >= esize-1
if (esize > 0) {
// only add the new guipath if it is not the same as the previous
// (meaning that no state change occured and thus should not be remembered -
// we don't user to experience "nothing" when they press the browser back button)
GUIPath latestGP = guipathentries.get(esize-1);
if (!guiPath.isSame(latestGP)) {
guipathentries.add(guiPath);
//System.out.println("new guipath:"+guiPath.toString());
curGPpos++;
} else {