SavePerspectiveDialog dlg = new SavePerspectiveDialog(page.getWorkbenchWindow()
.getShell(), reg);
// Look up the descriptor by id again to ensure it is still valid.
IPerspectiveDescriptor description = reg.findPerspectiveWithId(oldDesc.getId());
dlg.setInitialSelection(description);
if (dlg.open() != IDialogConstants.OK_ID) {
return;
}
// Create descriptor.
PerspectiveDescriptor newDesc = (PerspectiveDescriptor) dlg.getPersp();