[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Perspectives switching


I register my editor as a part listener and then use the following
public void partBroughtToTop(final IWorkbenchPart part) {
        if (part == this) {
                try {
                        final IWorkbench workbench = PlatformUI.getWorkbench();
                        final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                        workbench.showPerspective(Perspective.ID, window);
                } catch (final WorkbenchException e) {
                        e.printStackTrace();
                }
        }
}