Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355763 - Provide tag which prohibits a PartStack to collapse when empty
Summary: Provide tag which prohibits a PartStack to collapse when empty
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.1   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Thomas Schindl CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
: 360173 (view as bug list)
Depends on:
Blocks: 355750
  Show dependency tree
 
Reported: 2011-08-24 16:32 EDT by Thomas Schindl CLA
Modified: 2012-05-07 11:09 EDT (History)
6 users (show)

See Also:


Attachments
Can it be so easy? (3.69 KB, patch)
2012-04-13 10:55 EDT, Thomas Schindl CLA
no flags Details | Diff
do not overload NO_CLOSE (3.48 KB, patch)
2012-04-13 11:18 EDT, Thomas Schindl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2011-08-24 16:32:09 EDT
Currently our cleanup addon removes a PartStack when it has no contents anymore for IDEs where Views show only additional informations this makes sense but in RCP-Application one often fakes an none-perspective-shared "editor area" and there it's not making sense to collapse the PartStack.

In 3.x API was added in bug 213645 to allow ViewStack to be dureable and if bug 355750 is fixed in 3.8 the ViewStack is even restored on restart.

There are 2 things we need to make sure:
a) add support to EAP to allow stacks to not collapse when gone empty
b) in compat layer we support the durable API
Comment 1 Eric Moffatt CLA 2011-08-26 09:25:45 EDT
Thanks Tom, We currently have a few of these constants defined in IPresentationEngine (NO_TITLE, NO_MOVE & NO_CLOSE). This seems to be a good place for this type of tag as well since, while they are API, they're in a low-level spot so are unlikely to confuse folks just writing e4 apps (this API is for folks doing renderers...).

How about:

NO_AUTO_COLLAPSE - Don't remove the element from the display even if it has no displayable children (i.e. ViewStacks will still collapse even if they have non-open views unless this is set).

NO_AUTO_REMOVE - Don't remove the element from the model even if it has no children.

The actual implementation is straightforward, it's just a tweak to test the tag in the appropriate parts of the CleanupAddon.
Comment 2 Eric Moffatt CLA 2011-10-07 09:40:52 EDT
*** Bug 360173 has been marked as a duplicate of this bug. ***
Comment 3 Eric Moffatt CLA 2011-10-07 11:24:42 EDT
I think I'll re-use the existing NO_CLOSE tag rather than introducing NO_AUTO_COLLAPSE. I'll update its jdoc to something like:

Usage: Applying this tag to a container will ensure that the container remains visible in the UI even if it has no visible content. Applying the tag to a UI 'leaf' element (MPart / MPlaceholder) will cause the renderer to not provide a 'close' affordance.

While I'm in there I'll also change the jdocs of the other tags as well to match this type of 'usage' info...
Comment 4 Laura V CLA 2012-04-03 02:49:03 EDT
Dear Sirs
I see no target milestone for this, but we are building an enterprise application where this bug is giving us troubles.
We used a workaround in M4 (added a "fake" invisible part in the stack, so that it won't be deleted) but unfortunately it doesn't work in M6 anymore. 
Tom, how do you advise us to proceed?
Thanks a lot in advance

Laura
Comment 5 Tom K. CLA 2012-04-04 05:56:01 EDT
Dear e4 friends

We struggled now quite a bit with this "bug" but finaly we understood that the feature is ok like it is. If you don't want, that the PartStack gets closed or "cleaned up" then just use an "Area" and put your Partstack inside it.
The it has the features as the Editor Area has in the IDE. And keeps the space open even if it is empty.

But there is still a bug with the area - that keeps us back: bug 376045
Comment 6 Thomas Schindl CLA 2012-04-10 06:45:45 EDT
I don't think this is the correct solution - Eric can we take a look at this one? Just ping me
Comment 7 Thomas Schindl CLA 2012-04-13 10:55:23 EDT
Created attachment 213980 [details]
Can it be so easy?

Oh well is it possible that this is the only thing needed? How long did we fight the never ending durable battel in 3.x, 1,2,3 weeks? Fixed in less than 5 minutes amazing!
Comment 8 Thomas Schindl CLA 2012-04-13 11:02:35 EDT
Can we consider this for M7 - i think this a save change with a very low risk of breaking something.
Comment 9 Thomas Schindl CLA 2012-04-13 11:07:04 EDT
@Laura V, Tom K: If this patch doesn't make it into the build you can simple clone the CleanUpAddon, apply the patch there and point the e4xmi to it instead of the one from the default addons - like many things in e4 you don't need to wait for upstream because this cleanup stuff is not hardwired into the workbench.
Comment 10 Thomas Schindl CLA 2012-04-13 11:18:45 EDT
Created attachment 213981 [details]
do not overload NO_CLOSE

after having discussed this with Eric on IRC we came to the conclusion that overloading NO_CLOSE is a bad idea.
Comment 12 Eric Moffatt CLA 2012-04-13 13:27:24 EDT
Thanks Dude !
Comment 13 Eric Moffatt CLA 2012-05-07 11:09:34 EDT
Verified (visually) in I20120503-1800.