Bug 117988

Summary: [WorkbenchParts] View initialization error results in unwanted ErrorViewPart
Product: [Eclipse Project] Platform Reporter: benson margulies <bimargulies>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: ASSIGNED --- QA Contact:
Severity: normal    
Priority: P5 CC: eclipse, michaelvanmeekeren, mtabb, n.a.edgar, sxenos
Version: 3.1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description benson margulies CLA 2005-11-24 22:30:59 EST
I have a view extension that implements the init method. In some cases, it throws a PartInitException exception.

However, this exception does not arrive at the caller of IWorkbenchPage.showView.

Instead, showView returns an object of type org.eclipse.ui.internal.ErrorViewPart.

Given that showView is declared with a 'throws' clause of PartInitException, this seems wrong.
Comment 1 Nick Edgar CLA 2005-11-25 11:28:43 EST
If PartInitException is thrown during init, it should get propagated to the caller  of openEditor rather than opening the error view.

Stefan, I thought this was addressed in 3.1.  Do you recall where we ended up on this?
Comment 2 benson margulies CLA 2005-11-25 11:36:38 EST
To be perfectly clear, there's no openEditor involved here (in my code). My IEditorActionDelegate contains the following, and gets back the error view instead of catching the error.

IViewPart view;
		try {
			view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().
			getActivePage().showView("com.basistech.extarbl.gui.text_word_analysis");
		} catch (PartInitException e) {
			/*...*/
		}
Comment 3 Nick Edgar CLA 2005-11-25 11:42:58 EST
Sorry, I ment showView.  It's actually the same case for openEditor.
Comment 4 benson margulies CLA 2005-11-25 11:51:52 EST
Once the error view object comes into existence, it gets harder and harder to control the UI, since showView then simply shows it without attempting to rerun the initialization.
Comment 5 Nick Edgar CLA 2005-11-25 11:59:16 EST
Turns out this wasn't addressed in 3.1 due to high risk of the proposed fix, late in the  game.  For history, see bug 90582 comment 4 and later.
Comment 6 Nick Edgar CLA 2005-11-25 11:59:51 EST
*** Bug 102309 has been marked as a duplicate of this bug. ***
Comment 7 benson margulies CLA 2005-11-25 12:01:45 EST
Folks,

Could you do me a favor and tell me how to programmatically close the error view? I'm feeing quite dense, but I can't seem to find the API for closing views (as opposed to editors) anywhere. If I have that information I can work around this problem fairly easily.

--benson
Comment 8 Nick Edgar CLA 2005-11-25 12:13:05 EST
IWorkbenchPage.hideView(IViewPart).
Comment 9 benson margulies CLA 2005-11-25 12:14:48 EST
Thanks.
Comment 10 Paul Webster CLA 2006-09-28 15:17:19 EDT
Is this still a problem in 3.3?

PW
Comment 11 Denis Roy CLA 2007-06-22 09:33:13 EDT
Changes requested on bug 193523
Comment 12 Eclipse Webmaster CLA 2019-09-06 16:18:57 EDT
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.