@Override public void saveState(IMemento memento) { for (Iterator<Entry<IPageBookViewPage, DummyPart>> iter = fPagesToParts.entrySet().iterator(); iter.hasNext(); ) { Entry<IPageBookViewPage, DummyPart> entry = iter.next(); ISearchResultPage page = (ISearchResultPage) entry.getKey(); DummyPart part = entry.getValue(); IMemento child = memento.createChild(MEMENTO_TYPE, page.getID()); page.saveState(child); child.putInteger(MEMENTO_KEY_LAST_ACTIVATION, part.getLastActivation()); } }
private void updateHelpContextID(ISearchResultPage page) { String helpContextId = null; String pageId = null; if (page != null) { pageId = page.getID(); } if (pageId != null) { helpContextId = fSearchViewPageService.getHelpContextId(pageId); } if (helpContextId == null) { helpContextId = ISearchHelpContextIds.New_SEARCH_VIEW; } PlatformUI.getWorkbench().getHelpSystem().setHelp(fPageContent.getParent(), helpContextId); }
@Override protected void initPage(IPageBookViewPage page) { super.initPage(page); IActionBars actionBars = page.getSite().getActionBars(); actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), fSearchAgainAction); actionBars.updateActionBars(); fUndoRedoActionGroup.fillActionBars(actionBars); ISearchResultPage srPage = (ISearchResultPage) page; IMemento memento = null; if (fPageState != null) { IMemento[] mementos = fPageState.getChildren(MEMENTO_TYPE); for (int i = 0; i < mementos.length; i++) { if (mementos[i].getID().equals(srPage.getID())) { memento = mementos[i]; break; } } } srPage.restoreState(memento); }