Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320163

Summary: RCP Mail Example broken when run on 4.0
Product: [Eclipse Project] Platform Reporter: Stefan Mücke <s.muecke>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bokowski, ob1.eclipse, remy.suen
Version: 3.7Flags: ob1.eclipse: review+
bokowski: review+
Target Milestone: 4.1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch
ob1.eclipse: iplog+
Perspective handling patch v2 none

Description Stefan Mücke CLA 2010-07-17 08:05:29 EDT
1. Create a new RCP application plugin with the RCP Mail Example
2. Add the applicationXMI property to the 'product' extension:

    <property
        name="applicationXMI"
	value="org.eclipse.platform/LegacyIDE.e4xmi">
    </property>

3. Create a launch configuration
   (add 'ds', 'event' and 'platform' manually, then 'Add Required')

4. Launch the RCP Example

Result: No views. Quick access in the toolbar.

Should the 4.0 compatibility platform work for RCP applications?
Comment 1 Remy Suen CLA 2010-07-17 12:56:20 EDT
(In reply to comment #0)
> Should the 4.0 compatibility platform work for RCP applications?

We have put zero effort into the handling of advisors so I'm not sure how it's going to fly. Though it sounds like it doesn't fly at all.

Also see bug 317912.
Comment 2 Stefan Mücke CLA 2010-07-18 06:14:49 EDT
Created attachment 174574 [details]
Patch

The problem is two lines in the perspective factory (class Perspective):

  folder.addPlaceholder(View.ID + ":*");
  ...
  layout.getViewLayout(NavigationView.ID).setCloseable(false);

1. Adding a placeholder for a wildcard ID doesn't work.
2. Method getViewLayout(...) returns null.

See patch for a workaround for (1) and a possible solution for (2).
Comment 3 Boris Bokowski CLA 2010-07-19 13:05:25 EDT
From a cursory glance at the patch, looks like something we could do for RC3.
Comment 4 Remy Suen CLA 2010-07-21 08:34:31 EDT
Created attachment 174842 [details]
Perspective handling patch v2

To get the RCP mail example to run, I also had to make some changes to the workbench and perspective code. Not sure why Stefan was able to get it up without this problem though.
Comment 5 Stefan Mücke CLA 2010-07-21 08:39:05 EDT
Remy, you are right. The patch worked, but I had to open the perspective manually. Thanks for fixing the missing part.
Comment 6 Oleg Besedin CLA 2010-07-22 13:43:44 EDT
+1 on the "Perspective handling patch v2"

With the patch RCP mail demo runs with some hickups:

- The RCP Mail app has "Quick Access" control in its toolbar
- Min/max looks different from 3.x verison
- Drag&Drop message view results in NPE if I drag a message view on the tree view

I also needed to add the org.eclipse.e4.ui.workbench.addons.swt bundle in addition to the bundles listed in the comment 0, but that is part of the bug 317912 (or even more general Wizards update).
Comment 7 Oleg Besedin CLA 2010-07-22 13:44:07 EDT
Adding Boris for review.
Comment 8 Boris Bokowski CLA 2010-07-22 14:02:07 EDT
+1 for patch v2
Comment 9 Oleg Besedin CLA 2010-07-22 14:22:12 EDT
Patch "Perspective handling patch v2" applied to CVS Head. Thanks Stefan and Remy!

The bug 317912 will remain open for the rest of the items.
Comment 10 Remy Suen CLA 2010-07-23 08:37:37 EDT
(In reply to comment #6)
> - Drag&Drop message view results in NPE if I drag a message view on the tree
> view

Sounds like we should probably open a bug about this if it's still reproducible with the code from HEAD? :o
Comment 11 Oleg Besedin CLA 2010-07-23 11:50:00 EDT
(In reply to comment #6)
> - The RCP Mail app has "Quick Access" control in its toolbar

Opened bug 320744

> - Drag&Drop message view results in NPE if I drag a message view on the tree
> view

Opened bug 320743

Also, the bug 317912 comment 6 contains current steps needed to make RCP Mail demo work on e4.
Comment 12 Eric Moffatt CLA 2010-07-27 14:37:29 EDT
I did the steps in comment #0 but it's still failing for me in I20100726-2152.
Comment 13 Oleg Besedin CLA 2010-07-27 14:44:05 EDT
Did you add org.eclipse.e4.ui.workbench.addons.swt and its required plugins?