@Override
protected void showPageRec(PageRec pageRec) {
super.showPageRec(pageRec);
if (pageRec.page instanceof LayerViewPage) {
MapEditor mapEditor = ((LayerViewPage) pageRec.page).getMapEditor();
UndoActionHandler undoAction = new UndoActionHandler(getSite(), mapEditor.getUndoContext());
undoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO);
RedoActionHandler redoAction = new RedoActionHandler(getSite(), mapEditor.getUndoContext());
redoAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
IActionBars actionBars = ((IViewSite) getSite()).getActionBars();
actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
// Update action bars.