This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 418429 - [Workbench] ClassCastException in WorkbenchPage (when using pure e4 parts)
Summary: [Workbench] ClassCastException in WorkbenchPage (when using pure e4 parts)
Status: CLOSED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 enhancement with 5 votes (vote)
Target Milestone: 4.4 M6   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-01 10:42 EDT by Alexander Fichtinger CLA
Modified: 2014-01-22 07:46 EST (History)
3 users (show)

See Also:


Attachments
StackTrace (5.19 KB, text/plain)
2013-10-01 10:42 EDT, Alexander Fichtinger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Fichtinger CLA 2013-10-01 10:42:03 EDT
Created attachment 236014 [details]
StackTrace

=================
Scenario
=================

I'm using a pure e4 part in an Eclipse 3.x perspective. When i open the part via "Show in (<ViewName>)" via the quick access then a ClassCastException occurs (see attachment for the stacktrace).

The code line where the exception occurs is the following (in org.eclipse.ui.internal.WorkbenchPage.busyShowView):


legacyWindow.firePerspectiveChanged(this, getPerspective(), CHANGE_VIEW_SHOW);
	}
	return compatibilityView.getView();
	}

	part = showPart(mode, part);

EXCEPTION OCCURS IN THIS LINE OF CODE
============================================================================
CompatibilityView compatibilityView = (CompatibilityView) part.getObject();
============================================================================

	if (compatibilityView != null) {
		IWorkbenchPartReference ref = compatibilityView.getReference();

legacyWindow.firePerspectiveChanged(this, getPerspective(), ref, CHANGE_VIEW_SHOW);
legacyWindow.firePerspectiveChanged(this, getPerspective(), CHANGE_VIEW_SHOW);
		}
	return compatibilityView.getView();
}

I considered, that the fix could be that at this location an instanceof-check is performed, but I really don't know if this is the correct fix.

Also it's very strange, that the ClassCastException occurs, but the view is opened and except of the ClassCast everything is fine.
Comment 1 Daniel Rolka CLA 2013-10-01 10:54:37 EDT
Could you please prepare simple plugin that exposes this issue?

Daniel
Comment 2 Paul Webster CLA 2013-10-01 10:59:58 EDT
A pure Eclipse4 view in the Workbench is not yet supported.  I'll leave this open so it can be addressed.

PW
Comment 3 Alexander Fichtinger CLA 2013-10-02 02:17:11 EDT
Hi Paul, 

thank you for the pretty fast response.
Is there any way so that I can fix this issue (or probably avoid the occurence of the exception) in our own code temporarily?

For example override some method or override the command which does the "Show In" action?

Thanks for your help! :)
Comment 4 Paul Webster CLA 2013-10-04 13:48:45 EDT
(In reply to Alexander Fichtinger from comment #3)
> Hi Paul, 
> 
> thank you for the pretty fast response.
> Is there any way so that I can fix this issue (or probably avoid the
> occurence of the exception) in our own code temporarily?

You wouldn't be able to use your Eclipse4 view with the Show View command, you'd have to write your own command and handler for your view and add it to the model so it renders yourself.

PW
Comment 5 Paul Webster CLA 2013-10-10 16:27:14 EDT
Eric, related to your work with hosting Eclipse4 parts.

PW
Comment 6 Edwin Bruckner CLA 2013-12-11 05:00:59 EST
Voted for this bug because it causes some problems within our new product:

For example, it causes standard eclipse keyboard shortcuts like Ctrl+F7, Ctrl+F10, F12, etc, not to work within our views.
Comment 7 Alexander Fichtinger CLA 2014-01-08 04:31:52 EST
Yesterday we wanted to fix the ClassCastException which I mentioned in the bug description.

Then we discovered that it does not occur anymore (with Luna Milestone 4).

But we still have the problem that the shortcuts like Ctrl+F7, Ctrl+F10, F12, Ctrl+M etc do not work within our own views (E4 views).

Is it necessary to implement the shortcuts for ourselves or should the work in E4 parts automatically?

Thanks for any help!
Comment 8 Alexander Fichtinger CLA 2014-01-22 07:46:53 EST
We discovered that this bug is already fixed (with Luna M4.4).

For the issue concerning the "view shortcuts" we created the bug 426345.