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

Bug 338124

Summary: [Compatibility] Investigate a way to allow views to be defined inside the shared area in 4.x using 3.x code and extensions only
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: eiswind
Version: 1.0   
Target Milestone: 4.1 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
ModeledPageLayout patch v1 none

Description Remy Suen CLA 2011-02-24 12:37:25 EST
Thomas wants to put a view inside the shared area in 4.x. This is not possible in 3.x so being the wonderfully compatible citizens our bundles are, this is also not possible in 4.x.

We should investigate a way to allow developers to define a view that should be shown inside the shared area using only 3.x code and extensions. The caveat of course is that the code is safe when run in a 3.x environment.
Comment 1 Thomas Kratz CLA 2011-02-25 03:13:40 EST
Hi remy, don't have the bundle at hand. I tried a perspectivextension  with org.eclipse.ui.editorss and relation stack.
Comment 2 Remy Suen CLA 2011-02-25 09:07:02 EST
This is the XML snippet I am using to test:

<extension
    point="org.eclipse.ui.perspectiveExtensions">
  <perspectiveExtension
      targetID="org.eclipse.team.cvs.ui.cvsPerspective">
    <view
        id="org.eclipse.ant.ui.views.AntView"
        relationship="stack"
        relative="org.eclipse.ui.editorss">
    </view>
  </perspectiveExtension>
</extension>

I can make this work on 4.x but on 3.x the error message will be logged. Is this a problem for you, Thomas?

!MESSAGE Referenced part does not exist yet: org.eclipse.ui.editorss.
Comment 3 Thomas Kratz CLA 2011-02-25 09:09:00 EST
Thats exactly what I've tried. As I don't think of stepping back after the first e4 release this is ok to me. Great news :)
Comment 4 Remy Suen CLA 2011-02-25 09:24:47 EST
Created attachment 189803 [details]
ModeledPageLayout patch v1
Comment 5 Remy Suen CLA 2011-02-25 09:26:32 EST
(In reply to comment #3)
> Thats exactly what I've tried.

Great! Just wanted to make sure we're doing the same thing/tests. :)

(In reply to comment #4)
> Created attachment 189803 [details]
> ModeledPageLayout patch v1

Patch released to HEAD.
Comment 6 Thomas Kratz CLA 2011-03-15 04:52:32 EDT
Hi Remy,

I tried to add the view with "visible=false" to my perspective, as I don't want to show it at startup but only if some restricted command gets executed. But now I get

Caused by: java.lang.IllegalArgumentException: The selected element org.eclipse.e4.ui.model.application.ui.advanced.impl.PlaceholderImpl@67969fa5 (elementId: de.eiswind.paris.client.core.ui.user.UserView, tags: null, contributorURI: null, transientData: null) (widget: null, renderer: null, toBeRendered: false, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (closeable: false) must be visible in the UI presentation

Can you give me a pointer how I could make the view show up later but not at startup in the shared area?
Comment 7 Remy Suen CLA 2011-03-15 06:14:54 EDT
(In reply to comment #6)
> Can you give me a pointer how I could make the view show up later but not at
> startup in the shared area?

Can you open a new bug with the error stack trace in it? I will take a look this week.
Comment 8 Thomas Kratz CLA 2011-03-15 06:32:08 EDT
filed as bug #339994
Comment 9 Thomas Kratz CLA 2011-03-20 10:17:44 EDT
HI Remy,

guess youzr on your way right now. I found that when I open two views in the shared area (wich works fine now) and close them both again, the other one gets reopened when I close the last one. It then toggles between both views when I close the view. No Exceptions, only this strange behaviour.

Guess you have a good time at eclipsecon.
So long Thomas
Comment 10 Remy Suen CLA 2011-03-20 17:32:29 EDT
(In reply to comment #9)
> guess youzr on your way right now. I found that when I open two views in the
> shared area (wich works fine now) and close them both again, the other one gets
> reopened when I close the last one. It then toggles between both views when I
> close the view. No Exceptions, only this strange behaviour.

Hi Thomas, this is very disturbing! Please use breakpoints in CompatibilityPart to see when it calls the createPartControl(Composite) method after you close the second view (and presumably recreate the first one). After you get the stack trace, open a new bug and let me know.

I dragged two views into the shared area with I20110317-2200 on Windows XP and could not reproduce the problem so it must be something specific to the perspective extension.

> Guess you have a good time at eclipsecon.

Thanks and thanks for testing 4.1 as always!
Comment 11 Remy Suen CLA 2011-03-20 23:47:31 EDT
I tried to reproduce the problem with this XML snippet and could not make the problem appear. I opened the 'Projects' and 'Markers' view and then tried closing them, they did not disappear.

<extension
    point="org.eclipse.ui.perspectiveExtensions">
  <perspectiveExtension
      targetID="org.eclipse.jdt.ui.JavaPerspective">
    <view
        closeable="true"
        id="org.eclipse.jdt.ui.ProjectsView"
        minimized="false"
        moveable="true"
        ratio="1.0"
        relationship="stack"
        relative="org.eclipse.ui.editorss"
        showTitle="true"
        standalone="false"
        visible="false">
    </view>
    <view
        closeable="true"
        id="org.eclipse.ui.views.AllMarkersView"
        minimized="false"
        moveable="true"
        ratio="1.0"
        relationship="stack"
        relative="org.eclipse.ui.editorss"
        showTitle="true"
        standalone="false"
        visible="false">
    </view>
  </perspectiveExtension>
</extension>