// have an open page in the view:
Editor page = getPageForEntity(entity);
if (page == null) {
// The entity is not currently displayed. Create a new page.
EntityConfig config = view.getEntityConfig(entity.getEntityType());
EntityPageFactory pageFactory = config.getPageFactory();
page = pageFactory.createPage(entity);
}
return page;
}