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

Bug 325743

Summary: [PropertiesView] Blank display when maximize Properties view for a resource in a different view
Product: [Eclipse Project] Platform Reporter: Missing name <kathy.turetzky>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: major    
Priority: P3 CC: agfitzp, cji, CraigFoote, daniel_megert, gtang, jessev, kensmith, prakash, remy.suen
Version: 3.5.2   
Target Milestone: 3.6.2+   
Hardware: PC   
OS: Windows XP   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=548305
Whiteboard:
Bug Depends on:    
Bug Blocks: 479855    
Attachments:
Description Flags
Plugin project with view that adapts to IContributedContentView and IPropertySheetPage.
none
Screen capture using previously attached project demonstrating bug.
none
Simple project to recreate the blank properties view
none
Screen shots before/after the problem occurs
none
Ignore parts going hidden none

Description Missing name CLA 2010-09-20 08:37:07 EDT
Build Identifier: M20100211-1343

The properties view displays the properties information successfully when maximize the properties view for a file resource that resides in the same view within the Eclipse Workbench.
It is when the file resource does not reside in the same view as the Properties View that maximizing the Properties View shows a blank view.
This problem does not occur in Eclipse 3.4.1 but does occur in Eclipse 3.5 and 3.6.


Reproducible: Always

Steps to Reproduce:
1. Click on Properties for a file resource in view that is in a different view than the Properties View.
2. Click on maximize in the Properties view.
3. The data in the Properties View is gone.
Comment 1 Craig Foote CLA 2010-12-22 19:21:17 EST
I may be seeing the same problem in 3.5.1 but frankly I don't understand this description. File resources never reside in the Properties view. Can you re-phrase the first step to reproduce please?

1. Click on Properties for a file resource in view that is in a different view
than the Properties View.

Do you mean observe the Properties view when an object is selected in a view within the same "perspective" as the Properties view? Or perhaps the same "stack"?

Personally I have a custom IPropertySheetPage implementation to which my  selection-providing view adapts and so the PropertySheet ("Properties" view) properly displays the properties of the view's selected object - as I want them displayed (notably using a DeferredTreeContentProvider). My problem is that maximizing the PropertySheet causes the default PropertySheetPage implementation to replace my custom implementation. Pinning prevents the change but is unacceptable as a solution. It seems to be hard-coded behaviour in the PropertySheet's PartListener! To make the situation worse, and I haven't investigated why, the default PropertySheetPage displays blank. 

I would appreciate some clarity on this matter. Is it a bug that the PropertySheet displays the default PropertySheetPage implementation upon maximization? I can't imagine why it would do so by design. Or have I misunderstood the code and the bug is mine? If it is an eclipse bug, when can we expect a fix?
Comment 2 Missing name CLA 2010-12-29 08:17:38 EST
Sorry for the confusion.  My reproducible steps aren't very clear - my first step is not very detailed and I was speaking in terms of another view I created which then leads me to the properties view.  Rather follow these steps for ease of reproducibility:
(1) Create a general project in Project Explorer 
File -> New -> General -> Project 
(2) Create a new file resource within this project
Project Explorer -> right click on project name created above -> New -> File ->
Click on <<Advanced button -> check "Link to file in the file system" -> click Browse... button -> select a file.
(3) Open Properties View
Window -> Show View -> Properties
(4)Click on the file in the project to get the properties for that file.  The Properties displays with the proper information. Maximize the Properties View.  Now the Properties view is blank.
Comment 3 Missing name CLA 2010-12-29 08:19:13 EST
This bug appears to be within the GUI controls of Eclipse's Properties View.
Comment 4 Craig Foote CLA 2010-12-29 14:26:02 EST
(In reply to comment #3)
> This bug appears to be within the GUI controls of Eclipse's Properties View.

Thanks Kathy. I agree it sees to be an eclipse bug. And I think we now have two ways to reproduce as well: yours in the IDE and mine in an RCP. I see it's been assigned to an eclipse triage team so hopefully we'll hear something back soon.

Craig
Comment 5 Eric Moffatt CLA 2011-02-01 15:55:27 EST
[offline email from Craig...]

Craig, thanks for the 'poke', this is an example of a defect that never made it onto my radar due to my being swamped. I did try to repro this using Kathy's second set of steps but couldn't so went back to slogging on the 4.1 compatibility layer...

I have no doubt that the problem is in our code though...;-).

If you could provide a small project that demonstrates this it would really be helpful (many times the setup time is >> the amount of time needed to fix the defect). Even a set of repro steps that could show this in a 'standard' eclipse build would work for me.

If the selection is coming from the active editor then it may be related to a defect where the 'active editor' will go null when the editor area is minimized (as a result of maximizing the view).

Tagging for a look in M6, likely late in the milestone. If a sample project or more complete repro steps become available I'd be more than happy to try them out though.
Comment 6 Craig Foote CLA 2011-02-04 00:12:45 EST
Created attachment 188288 [details]
Plugin project with view that adapts to IContributedContentView and IPropertySheetPage.
Comment 7 Craig Foote CLA 2011-02-04 00:14:02 EST
Created attachment 188289 [details]
Screen capture using previously attached project demonstrating bug.
Comment 8 Missing name CLA 2011-02-04 06:39:17 EST
Created attachment 188308 [details]
Simple project to recreate the blank properties view
Comment 9 Missing name CLA 2011-02-04 06:41:19 EST
Created attachment 188309 [details]
Screen shots before/after the problem occurs

I didn't see the request posted on 2/1/11 until today when Craig sent his attachments.  I sent two attachements...(1) A simple project exported from Eclipse (zip file) and (2) Screen shots (before/after) of the issue.
Comment 10 Craig Foote CLA 2011-02-04 10:43:27 EST
I just tried playing my attached screen capture movie in Windows Media Player without success (I created it in Ubuntu). I downloaded and installed VLC and it played ok though.
Comment 11 Craig Foote CLA 2011-02-07 22:36:10 EST
I've done some more debugging and have what I hope is a fix. When maximizing the "Properties" view, PageBookView#partListener#partHidden calls PropertySheet#partHidden which calls PageBookView#partHidden (parent > child > parent). Its last statement, showPageRec(defaultPageRec), replaces my custom IPropertySheetPage with the default PropertySheetPage implementation. By commenting out the content of PropertySheet#partHidden (its check for pinned and super#partHidden) I'm getting the behavior I expect. When maximized, PropertySheet continues to display its current PropertySheetPage. When the contributing part is minimized, the PropertySheet also continues to display the current PropertySheetPage. It continues to do so until another selection-providing view is given focus. This seems correct to me. This has what might be considered the desired effect of affecting only the PropertySheet and not affecting other subclasses of PageBookView (that might want the current behavior for some reason). 

Let me know what you think. Again the fix I'm proposing is:

org.eclipse.ui.views.properties.PropertySheet#partHidden

    protected void partHidden(IWorkbenchPart part) {
-        // if we are pinned, then we are not interested if parts are hidden, if
-        // our target part is hidden, we should still show whatever content we
-        // have been pinned on
-        if (!isPinned()) {
-            super.partHidden(part);
-        }
+       /*
+        * Do nothing when a part is hidden; respond to part activated and +        * selection events only.
+        */
    }
Comment 12 Eric Moffatt CLA 2011-02-09 10:29:40 EST
Craig, thanks a lot! 

This fix not only fixes your issue but at least one other (that I'm trying to find the defect number for...;-). You can induce the issue by selecting an element in the Project (not Package) Explorer (which uses a TabbedPropertySheetPage) and then maximizing the Properties view.

I've been looking to see if it introduces any regressions but so far I can't detect any (even in situations that are the most likely).

The fix is certainly not 'dangerous' since it's already in place for pinned Property views...
Comment 13 Eric Moffatt CLA 2011-02-09 10:39:57 EST
Created attachment 188593 [details]
Ignore parts going hidden


This is certainly safe since the current code was ignoring these events for 'pinned' Property views, this patch simply extends the behavior to the unpinned view...
Comment 14 Eric Moffatt CLA 2011-02-09 10:48:45 EST
Committed in >20110209. Applied the patch.

Prakash, I've kicked this around looking for regressions but if you have time a second set of eyes is always a good thing.

Craig, thanks again...this earns you what we call an 'attribution' (since you did all the work...;-). If you look at the copyright notice at the top of the file (PropertySheet.java) you can see a couple of examples of what they look like. Feel free to send me (by email so I won't miss it) whatever info you want there...
Comment 15 Eric Moffatt CLA 2011-02-10 13:14:52 EST
*** Bug 300574 has been marked as a duplicate of this bug. ***
Comment 16 Alex Fitzpatrick CLA 2011-02-10 16:44:07 EST
Just to be clear. As far as I can tell this was fixed in 3.7 but not in 3.6.2, is that correct?
Comment 17 Remy Suen CLA 2011-02-10 16:59:31 EST
(In reply to comment #16)
> Just to be clear. As far as I can tell this was fixed in 3.7 but not in 3.6.2,
> is that correct?

Correct, the fix is in HEAD (3.7 stream).
Comment 18 Jesse CLA 2011-03-10 15:16:30 EST
This may be unrelated this issue, but I did notice some odd behavior... It's kind of awkward to explain so I'll just do through the steps to show you:

- open both the Package Explorer and Project Explorer views.

- open the Properties view in a stack other than where the Package & Project Explorer are

- in the PACKAGE Explorer, double-click on any *.java file inside some project, then the Properties view should update and another view with the contents of that java file should appear (okay)

- in the PROJECT Explorer, click on a different *.java file, then the Properties view will update (okay)

- now double-click that same *.java from the previous step, then another view with the contents will open (okay), BUT the Properties view gets cleared and shows the properties of the java file that we clicked on in the Package Explorer (I'm under the impression that this part should not be happening)

Anytime a file is opened in the Project Explorer, it seems that the Properties view always gets refreshed to what was previously there from the selected resource in the Package Explorer view. This seems to happen 100% of the time with java files. 

I also tried opening files with extensions other than .java, and most of them seem to clear the properties view entirely (both in the Package Explorer and Project Explorer). I'm unsure as to whether or not this is supposed to happen.

What do we think?
Comment 19 Chunqiu Ji CLA 2011-12-06 13:12:53 EST
To bugzilla owner,
Since the problem is identified and the fix is available, can you let me know how I can request a Eclipse 3.6 fix patch for this problem? We'd like to have the fix patch built into IES 3.6 ASAP so that the fix can be available with IBM Data Studio product (which is Eclipse 3.6 based product) before the coming release GA date. 

Thanks

Chun