@Override public void onPageClosed(PageClosedEvent event) { final Page page = event.getPage(); if (page.willClose()) { pages.remove(page); current.setWidget(pages.peek()); } }
@Inject public LayoutViewStack(EventBus eventBus) { this.eventBus = checkNotNull(eventBus); this.pages = Lists.newLinkedList(); this.current = new SimplePanel(); PageAddedEvent.bind(eventBus, this); PageClosedEvent.bind(eventBus, this); initWidget(current); }