Community
Participate
Working Groups
We need a public API to allow us to explicitly save the state (primarily the layout) of a perspective and a showPerspective API that would allow us to specify the state. The existing saveAndRestoreState functionality does not work for us for a variety of reasons. First, we need the state to be available across devices so the local file storage does not work. Second, we have a “home” perspective which should always be displayed upon application load regardless of which perspective was visible when the application was closed. Third, we do not want changes to be implicitly saved. A modification to the layout of the perspective should only be saved when the user indicates that he wants to preserve it.
Reassigning bugs in component areas that are changing ownership.
There are currently no plans to work on this feature. PW
Changes requested on bug 193523
We have a little different use-case related to saving/restoring perspective. In our application, we have several modules, with each having it's own primary perspective. After the module instance is launched, it derives it's own perspective prom the module primary perspective. Then there is a user functionality save/save as/restore layout, which stores the perspective layout into the database (shared among all users/machines). Since there is no public API for this, we use the following workaround (using the Eclipse internal classes): // To Save the perspective XMLMemento memento = XMLMemento.createWriteRoot("perspective"); WorkbenchPage activePage = (WorkbenchPage)PlatformUI.getWorkbench(). getActiveWorkbenchWindow().getActivePage(); Perspective perspective = activePage.getActivePerspective(); if(!perspective.saveState(memento).isOK()) { log.error("Save state not OK"); } // To Restore the perspective IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow(); IWorkbenchPage activePage = activeWindow.getActivePage(); PerspectiveDescriptor pd = (PerspectiveDescriptor) activePage.getPerspective(); PerspectiveRegistry perspRegistry = (PerspectiveRegistry) workbench.getPerspectiveRegistry(); // Remove the original definition (not custom) - not needed // In the registry any more, since the module instance // was already constructed perspRegistry.deletePerspective(pd); try { perspRegistry.saveCustomPersp(pd, memento); activePage.resetPerspective(); } catch (IOException e) { log.error("Unable to save perspective definition", e); } // We don't want to leave this in the registry perspRegistry.deletePerspective(pd);
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.