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

Bug 222183

Summary: [Trim] Minimize view-shortcuts disappear
Product: [Eclipse Project] Platform Reporter: Carsten Spieker <carsten.spieker>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: pwebster
Version: 3.3.1   
Target Milestone: 3.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Carsten Spieker CLA 2008-03-11 04:35:53 EDT
Build ID: 3.3.1.1

Steps To Reproduce:
Situation:
I have a RCP application with several perspectives (e.g. "A", "B", "C"). 
There is one main perspective called "Home". In the global toolbar there is 
an action for switching to "Home" from any of the other perspectives. In 
"Home" there are local buttons for switching to the other perspectives.

Problem:
I minimize a view in perspective "A" (equal in "B" and "C"). No the icon for 
restoring this view appears in the trim area. When I go to "Home" and then 
back to "A", the Restore-Icon is not visible any more. If I then minimize a 
second view, all Restore buttons appear again.
If i minimize the editor area the problem does NOT occur.

More information:
Comment 1 Eric Moffatt CLA 2008-03-12 10:03:09 EDT
Carsten, when you say 'no the icon' did you mean 'note' (i.e. the original minimize in "A" works as expected) ?

When you get into the situation where A's minimized view isn't appearing (i.e. after switching to Home and back) what happens if you resize the shell? I'm trying to see if this is just a layout issue (which i can likely do something about...;-).
Comment 2 Carsten Spieker CLA 2008-03-12 10:23:03 EDT
Hi Eric,

sorry, I wanted to say "Now the icon for restoring this view appears in the trim area.". This meant that before switching the perspective everything works fine.

If I resize the shell, the icons appear again. So it really seems to be a layout issue.

Greetz
Comment 3 Eric Moffatt CLA 2008-03-13 16:04:18 EDT
What do your toolbar buttons execute in order to change the perspective? It may be as simple as changing how you're doing this. If you use Ctrl-3 to switch perspectives my suspicion is that it will work correctly. That code AFAIK simply executes the 'Show Perspective' command, filing in the parameter with the id of the perspective that you want to see...perhaps you could try something similar?
Comment 4 Carsten Spieker CLA 2008-03-14 04:49:30 EDT
Hi,

I perform PlatformUI.getWorkbench().showPerspective(id, window) to change the perspective. This way the error occurs as described before.

Greetz,
Carsten
Comment 5 Corey Zimmet CLA 2008-06-11 16:31:14 EDT
I was having a similar but not exactly the same problem as this in my RCP. I added a perspective listener and issued:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().layout() on a perspectiveChange and my problem went away.  

Hope this helps,
Corey
Comment 6 Carsten Spieker CLA 2008-06-12 01:31:22 EDT
Hi,
thanks for that hint.
Unfortunately this solution does not solve my problem.

I have the same problem with a 3.4M7 Target platform in my RCP. So the problem does still exist.

Greetz,
Carsten
Comment 7 Eric Moffatt CLA 2008-06-12 09:01:33 EDT
Carsten, have you tried adding Corey's code:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().layout();

immediately after your call to 'showPerspective' ?

We won't be able to fix this for 3.4 but I'm more than willing to help in finding a work around for now...
Comment 8 Eric Moffatt CLA 2008-06-12 10:05:50 EDT
Carsten, are you using the standard workbench for your RCP app?

I've just hacked up a plugin (from the Hello World command template) that has two commands: Show Java Perspective & Show Debug Perspective. These commands use 'IWorkbench#showPerspective' to show the perspective.

When using these commands in base eclipse I can't reproduce the issue you're seeing. I have minimized stacks in both but the layout always works for me (I'm on XP as well).

Is there any chance that the perspective that's showing this error is throwing an exception on activation? This is the only thing that I can think of that would exit the Perspective#onActivate without forcing a layout...
Comment 9 Carsten Spieker CLA 2008-06-16 09:28:14 EDT
Hi,

it seems that I did not execute Corey´s code at the right position. After Eric´s hint I executed the line

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().layout();

directly after performing "showPerspective". Now the error seems to be solved.

I´d like to thank everyone for their help!!

Greetz,
Carsten
Comment 10 Eric Moffatt CLA 2009-03-05 13:50:58 EST
Based on Carsten's last comment...