1 16 package com.google.gwt.user.client.impl; 17 18 import com.google.gwt.user.client.Element; 19 20 24 abstract class HistoryImplFrame extends HistoryImpl { 25 26 private static native Element findHistoryFrame() ; 30 31 private static native Element getTokenElement(Element historyFrame) ; 41 42 private Element historyFrame; 43 44 public boolean init() { 45 historyFrame = findHistoryFrame(); 46 if (historyFrame == null) { 47 return false; 48 } 49 50 initHistoryToken(); 51 52 Element tokenElement = getTokenElement(historyFrame); 55 if (tokenElement != null) { 56 setToken(getTokenElementContent(tokenElement)); 57 } else { 58 newItemImpl(historyFrame, getToken(), true); 59 } 60 61 injectGlobalHandler(); 62 return true; 63 } 64 65 public void newItem(String historyToken) { 66 newItemImpl(historyFrame, historyToken, false); 67 } 68 69 protected abstract String getTokenElementContent(Element tokenElement); 70 71 protected abstract void initHistoryToken(); 72 73 protected abstract void injectGlobalHandler(); 74 75 protected abstract void newItemImpl(Element historyFrame, 76 String historyToken, boolean forceAdd); 77 } 78 | Popular Tags |